minhttpd - le serveur http minimum en script shell
Pour lancer minhttpd :
Pour arreter minhttpd :
Par defaut minhttpd ecoute sur le port 8080. Taper dans le navigateur
l'adresse http://localhost:8080/. Pour modifier ces parametres, éditer
httpd.sh et changer la ligne nc -v -l -p 8080 pour mettre le nouveau
numero de port, le fichier w.sh et changer la variable ROOT pour indiquer
la nouvelle racine des pages HTML.
Pour tester sans connexion le serveur http, taper :
$ ./w.sh
GET /
HTTP/1.1 200 OK
Content-Length: 960
Date: dim fév 3 08:45:22 CET 2002
Server: minhttpd, v0.1
Connection: close
Content-Type: text/html
<html>
<head>
<title>minhttpd - le serveur http minimum en script shell</title>
[...]
</html>
<hr>
<font size=-1> <i>
<center>
Powered by minhttpd v.0.1 -- a rustic WWW server, on <b>tarsier</b>.
</center>
</i></font>
</html>
$
|
|
Les logs se trouvent dans le fichier httpd.log :
$ tail httpd.log
User-Agent: Mozilla/4.74 [fr] (X11; U; Linux 2.2.16 i686)
Host: localhost:8080
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, image/png, */*
Accept-Encoding: gzip
Accept-Language: en
Accept-Charset: iso-8859-1,*,utf-8
listening on [any] 8080 ...
dim fév 3 08:45:20 CET 2002
GET /home/mdecore/perso/minhttpd/html//index.html
$
|
|
les erreurs dans le fichier httpd.err :
$ tail httpd.err
Error : /usr/local/httpd/htdocs/../../../../etc/passwd
Error : /usr/local/httpd/htdocs/../../../../etc/passwd
Error : /usr/local/httpd/htdocs/../../../../etc/passwd
Error : /usr/local/httpd/htdocs/../../../../etc/passwd
Error : /usr/local/httpd/htdocs/../../../../etc/passwd
Error : /usr/local/httpd/htdocs/../../../../etc/passwd
Error : /usr/local/httpd/htdocs/../../../../etc/passwd
Error : /usr/local/httpd/htdocs/../../../../etc/passwd
Error : /usr/local/httpd/htdocs/../../../../etc/passwd
404 /home/mdecore/perso/minhttpd/html/exec.mod
$ |
|
Ce mini serveur HTTP supporte les extentions SSI exec :
<!--#exec cmd='echo "Host: `hostname -f`, Kernel: `uname -r` (`uname -m`)"' -->
|
|
donne sur ma machine :
Host: tarsier.chez.moi, Kernel: 2.2.16 (i686)
|
|
Voici maintenant, par ordre alphabétique, les différents programmes :