How do you get apache to listen on other IP addresses?
Linux - EnterpriseThis forum is for all items relating to using Linux in the Enterprise.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
It's a link about how to set up ipv6, but maybe you can check entries in your httpd.conf against what's told there and remove/change the 'corrupt' (example??) entry.
Does it work with just one ip (Listen 1.2.3.4:80)??
There are no square brackets in the configuration.
Apache listens fine on the first IP in the range.
I tried specifically with just one of the other ips as you suggested and got an error "could not assign requested address: make_sock: could not bind to address...".
Perhaps the server does not acknowledge the other ips - does not know they are there? Is there a configuration to tell it which ip addresses it has, or does it just know automatically? (The hosting company set up the server and I am sure they knew what they were doing).
@KimVette: I do agree that it seems to work. Just tried it
I truly don't know if the *.80 notation is a proven concept and should be added/corrected in the manuals. And if unsure its always wise to remove the undocumented stuff and use documented settings only.
I wonder how the Apache people would react if we filed a bug report
I figured it out. I needed to set-up an IP aliase for the other IP using ifconfig. The command goes like this:
ifconfig eth0:0 ***.***.***.***
where ***.***.***.*** is the ip address.
If anyone comes across this thread with a similiar problem. Do a search on setting up ip aliases with ifconfig. You may also need to also set up a route (with the route command) to the ip, but ifconfig seemed to do this automatically for me.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.