Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have set up a virtual network adapter with a secondary IP address on my server (as per here: http://www.liberiangeek.net/2012/04/create-virtual-network-adapters-in-ubuntu-12-04-precise-pangolin/)

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 httpd.apache.org/docs/2.2/bind.html –  user16081 Dec 29 '13 at 19:51
add comment

2 Answers 2

up vote 3 down vote accepted

I think what you want is the listen directive.

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

e.g.

listen 192.168.1.1:80
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
add comment

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
add comment

Your Answer

 
discard

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.