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 two files that are loaded by apache2.conf:


NameVirtualHost *:3333



<VirtualHost *:3333>

        DocumentRoot /usr/share/roundcube
        DirectoryIndex index.php

        <Directory /usr/share/roundcube>
                Order Allow,Deny
                Allow from all


I know that both files are loaded and parsed by Apache without errors. When I visit the IP address of my VPS with :3333 I'm getting

Oops! Google Chrome could not connect to

I'm getting no errors from Apache or anything, so I suppose that configuration is erroneous. I'm hoping to be able to visit and have /usr/share/roundcube/index.php be opened in my browser.


root@myservername:~# sudo iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination
fail2ban-ssh  tcp  --  anywhere             anywhere            multiport dports ssh

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

Chain fail2ban-ssh (1 references)
target     prot opt source               destination
RETURN     all  --  anywhere             anywhere

I have added Listen 3333 right below the NameVirtualHost line. It didn't have any effect however. Does order matter when it comes to this? Must for instance NameVirtualHost come before or after <VirtualHost>? Can the same instance of Apache listen to port 80 and 3333 at the same time?


root@myservername:/etc/apache2/sites-enabled# netstat -tulpn | grep -e ':3333' -e ':80' -e ':8080' -e ':443'
tcp        0      0  *               LISTEN      7690/apache2
tcp        0      0  *               LISTEN      7690/apache2
tcp        0      0    *               LISTEN      7690/apache2
tcp        0      0  *               LISTEN      7690/apache2
tcp        0      0   *               LISTEN      7690/apache2
share|improve this question
Can you post the result you get from sudo iptables -L? – Bart De Vos Sep 27 '11 at 11:20
I have added them to my question – Hubro Sep 27 '11 at 11:23
What happens in the logs when you hit the page in the browser? Hint: tail -f /var/log/apache2/* – Bart De Vos Sep 27 '11 at 12:07

Make sure you have set the Listen directive correctly in your Apache configuration.

Listen 3333

Relevant documentation

share|improve this answer
I have updated my question. Please look at the bottom. Thanks for your reply – Hubro Sep 27 '11 at 11:32
3 statements are needed to make this work. Listen 3333, NameVirtualHost *:3333 and <VirtualHost *:3333>. Do you have all 3 in your Apache configuration? – Kenny Rasschaert Sep 27 '11 at 11:40
Yes I do. I still get the same 'timeout' error that I describe in the question. What else could be wrong? – Hubro Sep 27 '11 at 11:44
Listen 3333 should be on top of the config. Next to Listen 80 and don't forget to restart the service. – Bart De Vos Sep 27 '11 at 11:47
At the risk of stating the obvious: you have to restart your Apache before it can listen on the new port. Could you append your question with the output of netstat -tulpn | grep -e ':3333' -e ':80' -e ':8080' -e ':443' ? – Kenny Rasschaert Sep 27 '11 at 11:50

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.