Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have set up a virtual network adapter with a secondary IP address on my server (as per here:

I want apache, mysql and php to work with this secondary IP address. So if I SSH onto my server (using the primary ip address, not the virtual one), and just run something like

sudo apt-get install apache2

This installs apache, but I want it to be installed for the secondary IP address. Will apache automatically work for the secondary IP address too? If not, how do I install it so it will work?

share|improve this question
What, exactly, is a virtual network drive? That's not a term that has any real meaning. – EEAA Dec 29 '13 at 19:46
it will work, you may need to update your LISTEN directives – user16081-JoeT Dec 29 '13 at 19:51
up vote 3 down vote accepted

I think what you want is the listen directive.

listen ip.address.of.eth0-1:port


share|improve this answer
Or just Listen 80 if listening on all interfaces is acceptable. – Shane Madden Dec 29 '13 at 21:19
@ShaneMadden: oh absolutely but the OP witters on about primary and secondary addresses so I ran with it ;) How's it going anyway ? – Iain Dec 29 '13 at 21:37
Heh, fair enough! Not too bad, yourself? – Shane Madden Dec 29 '13 at 22:39
@ShaneMadden: Good thanks. – Iain Dec 29 '13 at 23:05
This is exactly what i needed. Thank you – user203834 Dec 30 '13 at 20:21

assuming real ip is aa and virtual ip is bb, then by default with no config changes, both ips will serve the same content, as apache accepts incoming http requests on all interfaces. however using virtual-host will allow you to serve specific content for ip aa and another different content for ip bb.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.