Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have two files that are loaded by apache2.conf:

roundcube.conf:

NameVirtualHost *:3333

 

roundcube.vhost:

<VirtualHost *:3333>

        DocumentRoot /usr/share/roundcube
        DirectoryIndex index.php

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

</VirtualHost>

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 1.2.3.4:3333

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


iptables

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?


Netstat

root@myservername:/etc/apache2/sites-enabled# netstat -tulpn | grep -e ':3333' -e ':80' -e ':8080' -e ':443'
tcp        0      0 0.0.0.0:3333            0.0.0.0:*               LISTEN      7690/apache2
tcp        0      0 0.0.0.0:8080            0.0.0.0:*               LISTEN      7690/apache2
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      7690/apache2
tcp        0      0 0.0.0.0:8081            0.0.0.0:*               LISTEN      7690/apache2
tcp        0      0 0.0.0.0:443             0.0.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
add comment

1 Answer

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
show 2 more comments

Your Answer

 
discard

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.