Forum OpenACS Q&A: virtual IPs, apache reverse proxy and aolserver...

I just got more IP addresses for my server and want to move apache to my 4th IP address, while using my 3 instances of aolserver on the first 3 IP addresses. I can easily access my server via putty over the 3 new IP addresses so that I figured that they are set up correctly with my server...

But whenever I want to bind aolserver to port 80 of one of the new IP addresses the aolserver error log tells me that port 80 is already in use. I can only bind aolserver to the new IP address whenever I stop apache, but then apache won't start anymore...

Any experienced network admins??? 😊

Cheers

Collapse
Posted by Jeff Davis on
You probably have something listening on port 80 for all IPs. eg:
$ netstat -an
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN
...
in this case ssh is listening on port 22 for all IPs. if you see 0.0.0.0:80 that probably means apache has taken port 80...
Collapse
Posted by Malte Sussdorff on
Well, if you can do it when Apache is down, then it shows that apache is grabing all IP addresses it can lay it's hand on (as is the default btw.).

You have to configure a virtual server and make apache listen only on that specific address.

Take a look at the "Listen" directive.

A virtual host can look like this

<VirtualHost 193.201.xxx.xxx>
    ScriptAlias /cgi/ /usr/local/httpd/cgi-bin/
    DocumentRoot /web/apache/www/
    ServerName myserver.com
</VirtualHost>

Collapse
Posted by Mark Aufflick on
As Malte said, you also need to look at the Listen directive. If you have:

Listen 80

it will bind to port 80 everywhere. If you want to bind to just a specific address, use the following format:

Listen: 203.63.9.10:80

See the apache docs - they are actually very nice to use. eg: http://httpd.apache.org/docs-2.0/mod/mpm_common.html#listen

Collapse
Posted by Mark Aufflick on
further to the above, note that VirtualHost directives only tell apache what to do with the addresses/ports it is listening on, they do not affect what addresses/ports apache will bind to.
Collapse
Posted by David Kuczek on
Mille gracie Jeff, Malte and Mark... I feel like an apache crack 😉 Everything works smoothly now!

Cheers

Collapse
Posted by David Kuczek on
Another quick question:

As most DNS servers still have the old IPs registered I am currently using apache to rewrite all connections from www.mydomain.com to MyNewIP. While Mozilla is presenting me the IP address in the URL input field at the top, IE is still showing www.mydomain.com?! Weird?

How could I make Mozilla also show www.mydomain.com and not the IP address?