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 want apache to do this >  --- opens var/www1  --- opens var/ww2  --- opens var/www3

Problem is I dont know if those ports are open on Linux (how do i check?)

And if they're not how do I open them in the firewall and get apache to listen?

I tried doing this

> iptables -A RH-Firewall-1-INPUT -m  NEW -m tcp -p tcp –dport 81 -j ACCEPT
iptables v1.3.5: Couldn't load match `NEW':/lib64/iptables/ cannot open shared object file: No such file or directory

and I checked the ports... looks like httpd is listening... but I dunno why I can't hit my URL

> netstat -tulpn | less
tcp        0      0 :::80       :::*      LISTEN      6840/httpd
tcp        0      0 :::81       :::*      LISTEN      6840/httpd
tcp        0      0 :::82       :::*      LISTEN      6840/httpd
share|improve this question
up vote 8 down vote accepted

To expand on Jeff's answer you'll need something like this in your apache configuration

Listen 80
Listen 81
Listen 82

# Listen for virtual host requests on all IP addresses
NameVirtualHost *:80

<VirtualHost *:80>
DocumentRoot /var/www1

NameVirtualHost *:81
<VirtualHost *:81>
DocumentRoot /var/www2

NameVirtualHost *:82
<VirtualHost *:82>
DocumentRoot /var/www3
share|improve this answer
I did exactly that ... but still no love – qodeninja Mar 13 '11 at 18:29
can you telnet to any of these ports locally and/or remotely? – sreimer Mar 15 '11 at 14:07

Step 1: Configure Apache to Listen on each of the ports you want to service.

Step 2: Set up a Virtual Host configuration for each port you want to service.

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.