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 have an Apache2 + Virtual Host config that runs perfectly fine on port 80, but I'm trying to get the same setup to run on port 9000 instead. I went into my httpd.conf and changed the Listen line to be:


and I went into my Virtual Host config for my website and changed the to be:


I opened up port 9000 on my iptables like:

$ iptables -A INPUT -i eth0 -p tcp --dport 9000 -j ACCEPT
$ iptables -A OUTPUT -i eth0 -p tcp --dport 9000 -j ACCEPT

Yet I'm running into the issue where the website still won't work. Most of the time I will get a straight up connection error, and sometimes (after changing some config) I'll get it to load the servers default htdocs directory.

Don't know what else I'm missing.

share|improve this question
up vote 0 down vote accepted

chances are your html links to not include :9000, so they are not hitting the correct port (without port specification, they default to tcp/80.

also, your iptables directive

iptables -A OUTPUT -i eth0 -p tcp --dport 9000 -j ACCEPT

should not be necessary because return traffic would almost never be sourced from port 9000, and even if it was, it would be covered by ESTABLISHED/EXISTING state table entries from first directive, so you can kill that second one

otherwide your listen and virtual host apache dirtectives look right...l (which is why im guessing it may be the urls on your page missing the

share|improve this answer
Correctamundo! Created a basic hello world index.php script and that loads fine. – Marius Miliunas Nov 30 '13 at 20:24

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.