Make all vhosts listen on all IPs (VirtualHost *:80)

Pentium100

Verified User
Joined
Jan 28, 2013
Messages
7
Hi, the server has two IPs, one public and one internal. It should serve the same websites on both IPs. Is there a way to make it do so without altering the generated config files (which would later be rewritten by DA)?

Essentially I need the VirtualHost line to read
<VirtualHost *:80> instead of
<VirtualHost public_ip:80>
 
I edit the custom files, replace the |IP| with *, rewrite but it still does not work correctly.

If I try to access the server trough the external IP I get the "Apache is functioning normally" page.
If I try to access the server trough the LAN IP I get webmail*.

* webmail is set up as "webmail.example.com", but I try to access www.example.com.

If I replace the * back with |IP| it starts working normally, but not from the LAN IPs ovbiously.
 
Did you add all of the IPs in directadmin? And did you mark them as shared? You might need to do it in order to get them added properly into apache config. For now you must be missing NameVirtualHost directives for some of them in /etc/httpd/conf/ips.conf
 
OK, it looks like I managed to make it work. I added the IP to DA (shown as "free") then edited custom templates and added the internal IP there, so now the virtualhost line reads as
<VirtualHost external_ip:80 internal_ip:80>

Thanks for your help.
 
Back
Top