Es geht um apache2-2.2.4-70.4 auf einem Opensuse 10.3 System.
Das Testszenario sollte aus 3 unterschiedlichen Seiten bestehen und jede Seite sollte einen anderen Inhalt anzeigen.
- Code: Select all
rcapache2 restart
Syntax OK
Shutting down httpd2 (waiting for all children to terminate) done
Starting httpd2 (prefork) done
Die Pfade sollte also stimmen, sonst würde eine Fehlermeldung kommen.
Das habe ich konfiguriert.
- Code: Select all
#/etc/apache2/default-server.conf
# alles default bis auf letzte Zeile
DocumentRoot "/srv/www/htdocs"
<Directory "/srv/www/htdocs">
Options None
AllowOverride None
Order allow,deny
Allow from all
</Directory>
Alias /icons/ "/usr/share/apache2/icons/"
<Directory "/usr/share/apache2/icons">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
ScriptAlias /cgi-bin/ "/srv/www/cgi-bin/"
<Directory "/srv/www/cgi-bin">
AllowOverride None
Options +ExecCGI -Includes
Order allow,deny
Allow from all
</Directory>
<IfModule mod_userdir.c>
UserDir public_html
Include /etc/apache2/mod_userdir.conf
</IfModule>
Include /etc/apache2/conf.d/*.conf
Include /etc/apache2/conf.d/apache2-manual?conf
NameVirtualHost 192.168.2.100
Es wurden also 2 virtuelle Hosts angelegt
- Code: Select all
#/etc/apache2/vhosts.d/vhost.conf
<VirtualHost 192.168.2.100>
DocumentRoot /srv/www/htdocs/crystalball.site
servername crystalball.site
DocumentRoot /srv/www/htdocs/glaskugel.site
servername glaskugel.site
</VirtualHost>
Das sollte erscheinen, wenn 192.168.2.100 aufgerufen wird:
- Code: Select all
cat /srv/www/htdocs/index.html
<html><body><h1>It works!</h1></body></html>
Diese Seie habe ich schon gesehen:
- Code: Select all
cat /srv/www/htdocs/crystalball.site/index.html
<html>
<head>
<title></title>
<meta content="">
<style></style>
</head>
<body>crytalball works</body>
</html>
Diese Seite kommt immer:
- Code: Select all
cat /srv/www/htdocs/glaskugel.site/index.html
<html>
<head>
<title></title>
<meta content="">
<style></style>
</head>
<body>Glaskugel ok</body>
</html>