# HG changeset patch # User Christophe Lincoln # Date 1307313851 -7200 # Node ID 2c795c9ffacef396cf94fe1e016f70014174694e # Parent 481d1e820d8576c302c738120e8364a7f9479c6a busybox: add HTTPD_OPTIONS and start httpd as www user (+ add files forgot in previews commit) diff -r 481d1e820d85 -r 2c795c9fface busybox/receipt --- a/busybox/receipt Mon Jun 06 00:30:06 2011 +0200 +++ b/busybox/receipt Mon Jun 06 00:44:11 2011 +0200 @@ -137,6 +137,23 @@ mv $1$i-busybox-install $1$i done < $1$INSTALLED/$PACKAGE/files.list chmod 4755 $1/bin/busybox + + # /etc/daemons.conf (tftp + dnsd + httpd may not be present) + if ! grep -q ^DNSD_OPTIONS $root/etc/daemons.conf; then + echo '# Domain name server options.' >> $root/etc/daemons.conf + echo 'DNSD_OPTIONS="-d"' >> $root/etc/daemons.conf + echo '' >> $root/etc/daemons.conf + fi + if ! grep -q ^TFTPD_OPTIONS $root/etc/daemons.conf; then + echo '# Tftp daemon options.' >> $root/etc/daemons.conf + echo 'TFTPD_OPTIONS="-r /boot"' >> $root/etc/daemons.conf + echo '' >> $root/etc/daemons.conf + fi + if ! grep -q ^HTTPD_OPTIONS $root/etc/daemons.conf; then + echo '# Busybox HTTP web server options.' >> $root/etc/daemons.conf + echo 'HTTPD_OPTIONS="-u www"' >> $root/etc/daemons.conf + echo '' >> $root/etc/daemons.conf + fi } pre_remove() diff -r 481d1e820d85 -r 2c795c9fface busybox/stuff/applications/httpd-cgi.desktop --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/busybox/stuff/applications/httpd-cgi.desktop Mon Jun 06 00:44:11 2011 +0200 @@ -0,0 +1,7 @@ +[Desktop Entry] +Encoding=UTF-8 +Name=CGI SHell Environment +Exec=browser http://localhost/cgi-env.sh +Icon=text-x-script +Type=Application +Categories=Application;Development; diff -r 481d1e820d85 -r 2c795c9fface busybox/stuff/applications/httpd.desktop --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/busybox/stuff/applications/httpd.desktop Mon Jun 06 00:44:11 2011 +0200 @@ -0,0 +1,7 @@ +[Desktop Entry] +Encoding=UTF-8 +Name=HTTP Web server +Exec=browser http://localhost/ +Icon=network +Type=Application +Categories=Application;System; diff -r 481d1e820d85 -r 2c795c9fface busybox/stuff/httpd.conf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/busybox/stuff/httpd.conf Mon Jun 06 00:44:11 2011 +0200 @@ -0,0 +1,34 @@ +# /etc/httpd.conf: Busybox HTTP web server configuration file. + +# Server root. +H:/var/www + +# Allow address. +A:0.0.0.0/0 + +# File to open by default. +#I:index.html + +# Path to the 404 error page. +#E404:/path/404.html + +# Require user root, password root on urls starting with /adm/. +#/adm:root:root + +# Reverse proxy. +#P:/url:[http://]hostname[:port]/new/path + +# CGI interpreter path. +*.sh:/bin/sh +*.cgi:/bin/sh +#*.php:/usr/bin/php-cgi + +# MIME type. +.txt:text/plain +.css:text/css +.xml:text/xml +.png:image/png +.jpg:image/jpeg +.tgz:application/x-tgz +.tar.gz:application/x-tgz +.tazpkg:application/x-tazpkg diff -r 481d1e820d85 -r 2c795c9fface busybox/stuff/www/cgi-env.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/busybox/stuff/www/cgi-env.sh Mon Jun 06 00:44:11 2011 +0200 @@ -0,0 +1,46 @@ +#!/bin/sh +. /usr/bin/httpd_helper.sh +header + +cat << EOT + + + + CGI SHell Environment + + + + + + + + + +
+ +

+ Welcome to SliTaz web server CGI Shell environment. Let the power of + SHell script meet the web! Here you can check HTTP info and try some + requests. Including /usr/bin/httpd_helper.sh in your scripts let you + use PHP alike syntax such as: \$(GET var) +

+

+ QUERY_STRING test: + $SCRIPT_NAME?var=value +

+ +

HTTP Info

+
+$(httpinfo)
+
+ + +
+ + + +EOT + +exit 0 diff -r 481d1e820d85 -r 2c795c9fface busybox/stuff/www/index.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/busybox/stuff/www/index.html Mon Jun 06 00:44:11 2011 +0200 @@ -0,0 +1,38 @@ + + + + SliTaz Web Server + + + + + + + + + +
+

Index of /

+ +

+ Welcome to SliTaz Busybox HTTP web server. You can delete or modify this + page to put your own xHTML pages, web sites, CGI or PHP scripts. The server + configuration file is: /etc/httpd.conf. CGI support is activated by default + using the SHell interpreter for *.sh and *.cgi files. This page is located + in the server root directory: /var/www. Default configuration is to allow + connection only from localhost so the port 80 is not open for security + reason. +

+ + +
+ + + + + + diff -r 481d1e820d85 -r 2c795c9fface busybox/stuff/www/style.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/busybox/stuff/www/style.css Mon Jun 06 00:44:11 2011 +0200 @@ -0,0 +1,44 @@ +/* CSS style for SliTaz GNU/Linux. */ + +html { min-height: 102%; } + +body { + background: #ffffff; + color: black; + font: 13px sans-serif, vernada, arial; + margin: 0; + min-width: 640px; +} + +a { text-decoration: underline; color: #215090; } +a:hover { text-decoration: none; color: blue; } +img { border: 0pt none; vertical-align: middle; } +h2 { color: #444; } +h3 { color: #666; font-size: 140%; } + +#header { + height: 40px; + background: #351a0a; + border-bottom: 8px solid #d66018; +} + +#header h1 { + margin: 0; + padding: 8px 0 0 8px; + color: white; + font-size: 20px; +} + +#content { + padding: 30px 80px; + text-align: justify; +} + +#footer { + text-align: center; + border-top: 1px solid #ddd; + padding: 40px; + color: #666; +} + +#footer a { color: #666; padding: 0 2px; } diff -r 481d1e820d85 -r 2c795c9fface slitaz-base-files/receipt --- a/slitaz-base-files/receipt Mon Jun 06 00:30:06 2011 +0200 +++ b/slitaz-base-files/receipt Mon Jun 06 00:44:11 2011 +0200 @@ -100,18 +100,6 @@ if ! grep -q audio $root/etc/group; then chroot $root/ /bin/addgroup -g 20 audio fi - - # daemons.conf (tftp + dnsd) - if ! grep -q ^TFTPD_OPTIONS $root/etc/daemons.conf; then - echo '# Tftp daemon options.' >> $root/etc/daemons.conf - echo 'TFTPD_OPTIONS="-r /boot"' >> $root/etc/daemons.conf - echo '' >> $root/etc/daemons.conf - fi - if ! grep -q ^DNSD_OPTIONS $root/etc/daemons.conf; then - echo '# Domain name server options.' >> $root/etc/daemons.conf - echo 'DNSD_OPTIONS="-d"' >> $root/etc/daemons.conf - echo '' >> $root/etc/daemons.conf - fi } pre_remove()