← Back to team overview

sslug-teknik team mailing list archive

Apache IP-virtual host

 

Ved hjælp af ifconfig har jeg til samme netkort tilegnet to ip addresser. Apache er sat op, så der er to virtual host til hver addresse . http://192.168.2.3 og http://192.168.2.4 giver det forventet output.

Men vælger jeg min rigtige ip addresse, den som findes ude på det store internet, og som routeren angiveligt sender videre til 192.168.2.4, så får jeg indholdet fra 192.168.2.3 . Hvorfor ?

<VirtualHost 192.168.2.3 >
    DocumentRoot /var/www/html-test
    ServerName 192.168.2.3
    <Directory "/var/www/html-test">
       Options Indexes Includes FollowSymLinks
       AllowOverride None
       Order allow,deny
       Allow from all
    </Directory>
</VirtualHost>

<VirtualHost 192.168.2.4 >
    DocumentRoot /var/www/html
    ServerName 192.168.2.4
    <Directory "/var/www/html">
       Options Indexes Includes FollowSymLinks
       AllowOverride None
       Order allow,deny
       Allow from all
    </Directory>
</VirtualHost>



Follow ups