Ich habe meine Apache konfiguriert, um 2 Websites einzurichten. Ich habe nach dem in meinem apache2.confMehrere Websites auf Apache2
Include /opt/bitnami/apps/www.website1.com/conf/app.conf
Include /opt/bitnami/apps/www.website2.com/conf/app.conf
Hier sind die app.conf für die 2-Websites
Website1
<VirtualHost *>
DocumentRoot /opt/bitnami/apps/www.website1.com/htdocs
ServerName www.website1.com:80
ServerAlias website1.com
ErrorLog /opt/bitnami/apps/www.website1.com/log/error.log
CustomLog /opt/bitnami/apps/www.website1.com/log/access.log common
<Directory "/opt/bitnami/apps/www.website1.com/htdocs">
Options Indexes MultiViews
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
<VirtualHost *>
DocumentRoot /opt/bitnami/apps/www.website1.com/htdocs
ServerName website1.uat.com:80
ServerAlias website1.uat.com
ErrorLog /opt/bitnami/apps/www.website1.com/log/error.log
CustomLog /opt/bitnami/apps/www.website1.com/log/access.log common
<Directory "/opt/bitnami/apps/www.website1.com/htdocs">
Options Indexes MultiViews
AllowOverride All
Order allow,deny
Allow from all
</Directory>
Webseite 2
<VirtualHost *>
DocumentRoot /opt/bitnami/apps/www.website2.com/htdocs
ServerName www.website2.com:80
ServerAlias www.website2.com
ErrorLog /opt/bitnami/apps/www.website2.com/log/error.log
CustomLog /opt/bitnami/apps/www.website2.com/log/access.log common
<Directory "/opt/bitnami/apps/www.website2.com/htdocs">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
<VirtualHost *>
DocumentRoot /opt/bitnami/apps/www.website2.com/htdocs
ServerName website2.com:80
ServerAlias website2.com
ErrorLog /opt/bitnami/apps/www.website2.com/log/error.log
CustomLog /opt/bitnami/apps/www.website2.com/log/access.log common
<Directory "/opt/bitnami/apps/www.website2.com/htdocs">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
Im testet diese lokal, so dass ich unter meinen Host-Setup
xx.xxx.xx.xxx www.website1.com
xx.xxx.xx.xxx www.website2.com
Wenn ich auf www.website2.com, apache2 Seite erscheint Wenn ich zu www.website1.com gehen, apache2 Seite Pop up
Wenn ich auf www.website2.com/htdocs gehe, sehe ich die richtige Website und es funktioniert. Als ich zu www.website1.com/htdocs kam, sehe ich website2. Ich verstehe nicht, warum ich Website 2 hier sehe.