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 a Linux system that has two Ethernet ports, one GPRS modem interface and Wifi. How can I configure Apache to run on all or a subset of those interfaces? Wifi & GPRS modem IP addresses will prob. be dynamic, ethernet addresses fixed.

share|improve this question

2 Answers 2

up vote 1 down vote accepted

The Apache Listen directive handles that.

All interfaces:

Listen 80

Specific IP only:

Listen 192.0.2.1:80
share|improve this answer
    
How could I specify it to listen say only on the Wifi interface, where the address is assigned by DHCP? Is there any way to specify an inteface, e.g. "wlan0"? –  fred basset May 26 '13 at 20:37
    
Those addresses are usually more static than you'd think. At least, as long as your host is perpetually online. In the worst case, write some shell script to check the output of ifconfig/ip for the interface you want and then stuff that into your apache config and restart. –  dmourati May 26 '13 at 22:56

By default apache will listen on all available interfaces

# cat /etc/httpd/conf/httpd.conf | grep ^Listen
Listen 80

So there is no need in any specific configuration at all

share|improve this answer

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.