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:

Listen xxx.xxx.xxx.xxx:9000

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

<VirtualHost xxx.xxx.xxx.xxx:9000>

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.


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 http://your.domain.com:9000)

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.