Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to make apache listen on specific IP addresses

Status
Not open for further replies.

Droid1

MIS
Nov 11, 2010
2
US
I have a server that has multiple IP addresses on it. I only want ports 80 and 443 to listen on specific addresses. How would I go about doing this? I cannot find anything to help me out.
 
I tried setting the Listen directive but I must have done it wrong. Here is what I tried and it failed.

Code:
;Listen 80
Listen a.b.c.d:80
Listen e.f.g.h:80
Listen i.j.k.l:80
<IfModule mod_ssl.c>
NameVirtualHost *:443
    ;Listen 443
    Listen a.b.c.d:443
    Listen e.f.g.h:443
    Listen i.j.k.l:443
</IfModule>
 
Using, "NameVirtualHost *:443", tells Apache to bind to all addresses. The * is the wild card, use the IP address instead.

Also take a look at this. It covers binding and incorporates both the listen and virtual host directive which can be used together to customize the behavior.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top