I'm having a static ip-address and dns pointing to my internet-router. The router is connected to a computer running IPCop with three interfaces (red = internet, orange = dmz and green = LAN). I use NAT, and the red is configured with my static IP, orange is 192.168.2.0/255.255.255.0 and green is 192.168.3.0/255.255.255.0.
I've set up Apache to receive "www.domain.info" requests, and it works like a charm, and so does "domain.info" (without www). My problem starts when I try to set up virtual hosts. I've added "name1.domain.info" and "name2.domain.info" to dns, so they both points to my ip-address.
When I type "domain.info" in an external (or internal) browser, my index-page pops up. The problem is that this is the same page presented when I type "name1." or "name2.domain.info". They both end up at my main index-page. Typing "www.domain.info/~name1 or ~name2" works, as well as the aliases "/name1 and /name2".
My last attempt was to copy the config-files from a server that works, but that server doesn't use NAT, so I think this might be the root of my problems.
(From here, my static IP is aa.bbb.ccc.ddd)
My "apache2.conf" contains:
NameVirtualHost aa.bbb.ccc.ddd
Include /etc/apache2/httpd.conf (which is empty)
Include /etc/apache2/ports.conf (contains "Listen 80")
Include /etc/apache2/conf.d
Include /etc/apache2/sites-enabled
my file under /etc/apache2/sites-availiable (and link from sites-enabled by running a2ensite) contains:
<VirtualHost
www.domain.info>
ServerAdmin
webmaster@domain.info
ServerName
www.domain.info
DocumentRoot /home/html/
ErrorLog /var/log/apache/error_log
TransferLog /var/log/apache2/transfer.log
ScriptAlias /cgi-bin /home/html/cgi-bin
Options ExecCgi Includes
ServerAlias domain.info
</VirtualHost>
<VirtualHost name1.domain.info>
ServerAdmin
webmaster@domain.info
ServerName
www.domain.info
DocumentRoot /home/name1/html
ErrorLog /var/log/apache2/name1_error_log
TransferLog /var/log/apache2/name1_transfer.log
ScriptAlias /cgi-bin /home/name1/html/cgi-bin
Options ExecCgi Includes
ServerAlias domain.info
</VirtualHost>
(I've tried changing from domain-name to ip-address as VirtualHost, but no luck..)
Does anyone see what's wrong? I certainly can't, and as I mentioned, I've copied the config-files from another domain "in panic"
Let me know if you need more info, and I'll paste it in..
Does it have anything to do with my NAT?