Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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 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
up vote 4 down vote accepted

The Apache Listen directive handles that.

All interfaces:

Listen 80

Specific IP only:

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


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.