-C
habe ich zum ersten Mal unter Debian 8 gebraucht Dies ist eine alte Version des Dokuments!
Die Namen aller Virtual Hosts müssen im DNS eingetragen sein, fehlende wie unter bind gezeigt hinzufügen
getent hosts notebook14.linuxhotel.de getent hosts iw.linuxhotel.de
openSuSE ab 10.2:
<html> <head> <title>Default Host notebook34!</title> </head> <body> <h1>Default Host notebook34</h1> Link zu <a href="http://iw.linuxhotel.de/test.html">Virtual Host</a> </body> </html>
mkdir -p /srv/www/iw.linuxhotel.de/{cgi-bin,htdocs}
openSuSE ab 10.2:
openSuSE bis 12.3:
NameVirtualHost *
openSuSE ab 10.2:
<VirtualHost *> </VirtualHost>
openSuSE ab 42.1:
<VirtualHost *> ServerName iw.linuxhotel.de DocumentRoot /srv/www/iw.linuxhotel.de/htdocs <Directory "/srv/www/iw.linuxhotel.de/htdocs"> Require all granted </Directory> </VirtualHost>
apache2ctl configtest
Vhosts anzeigen:
apache2ctl -S
apache2ctl graceful
<html> <head> <title>Default Host notebook34!</title> </head> <body> <h1>Default Host notebook34</h1> <a href="http://iw.linuxhotel.de/test.html">Virtual Host</a> </body> </html>
mkdir -p /var/www/iw.linuxhotel.de/{cgi-bin,html}
<VirtualHost *:80> </VirtualHost> Include vhosts.d/*.conf
mkdir /etc/httpd/vhosts.d
<VirtualHost *:80> ServerName iw.linuxhotel.de DocumentRoot /var/www/iw.linuxhotel.de/html <Directory "/var/www/iw.linuxhotel.de/html"> Require all granted </Directory> </VirtualHost>
apachectl configtest
Vhosts anzeigen:
httpd -S
apachectl graceful
<html> <head> <title>Default Host notebook34!</title> </head> <body> <h1>Default Host notebook34</h1> Link zu <a href="http://iw.linuxhotel.de/test.html">Virtual Host</a> </body> </html>
mkdir -p /srv/iw.linuxhotel.de/{html,cgi-bin}
ab Debian 5.0:
Debian 5 - 7: apache Version 2.2
<VirtualHost *:80> ServerName iw.linuxhotel.de DocumentRoot /srv/iw.linuxhotel.de/html <Directory "/srv/iw.linuxhotel.de/html"> Order allow,deny Allow from all </Directory> </VirtualHost>
Debian ab 8, Ubuntu 16.04: apache Version 2.4
<VirtualHost *:80> ServerName iw.linuxhotel.de DocumentRoot /srv/iw.linuxhotel.de/html <Directory "/srv/iw.linuxhotel.de/html"> Require all granted </Directory> </VirtualHost>
a2ensite iw.linuxhotel.de
apache2ctl configtest
Vhosts anzeigen:
apache2ctl -S
apache2ctl graceful
netcat -Cv localhost 80 GET /test.html HTTP/1.1 host: iw.linuxhotel.de
wget -nv -O - --header="Host: iw.linuxhotel.de" http://localhost/test.html
ab -H 'Host: iw.linuxhotel.de' http://localhost/test.html
-C
habe ich zum ersten Mal unter Debian 8 gebraucht