CentOS (ab 5):
httpd
openSuSE, Debian (ab 3.1), Ubuntu:
apache2
Im einfachsten Fall
/var/www/html/test.html
: ( CentOS ab 7, Debian ab 8, Ubuntu ab 16.04 )
/srv/www/htdocs/test.html
: ( ab SuSE 10.0 )
<html> <head> <title>Hello World!</title> </head> <body> Hello World </body> </html>
CentOS:
service httpd start
SuSE:
service apache start
Debian/Ubuntu:
service apache2 start
Debian, OpenSuSE:
netcat -Cv localhost 80
CentOS 1)
nc -Cv localhost 80
GET http://localhost/test.html HTTP/1.1 Host: localhost
telnet localhost 80 GET http://localhost/test.html HTTP/1.1 Host: localhost
wget -O - http://localhost/test.html
curl http://localhost/test.html
ab -n 1000 -c 100 http://localhost/test.html
ab2 -n 1000 -c 100 http://localhost/test.html
Debian (ab 8.0), Ubuntu (ab 16.04):
a2enmod cgi
/usr/lib/cgi-bin/test
: ( Debian 6.0, Ubuntu 16.04 )
/srv/www/cgi-bin/test
: ( openSuSE 12.1 )
/var/www/cgi-bin/test
: ( Centos ab 6 )
#!/bin/bash echo -e 'Content-type: text/html\r\n' echo echo "<html>" echo "<head><title>cgi Beispiel</title></head>" echo "<body>" ps ax | sed 's/$/<br>/' echo "</body>" echo "</html>"
Debian, Ubuntu:
chmod +x /usr/lib/cgi-bin/test
SuSE:
chmod +x /srv/www/cgi-bin/test
CentOS:
chmod +x /var/www/cgi-bin/test
http://localhost/cgi-bin/test
im Browser aufrufen
apache2-utils
cat - '<script>alert("Uups")</script>'Funktioniert unter CentOS nur, wenn SELinux abgeschaltet ist:
setenforce Permissive