2

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
Hubro
  • 1,138
  • 4
  • 16
  • 35

1 Answers1

2

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

Listen 3333

Relevant documentation

Kenny Rasschaert
  • 9,045
  • 3
  • 42
  • 58
  • 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 . 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
  • @kenny.r: Done. Yes I am restarting Apache after each edit to the configuration. I have put `Listen 3333` at the very top of `apache2.conf`. Can it get any higher than that? – Hubro Sep 27 '11 at 11:58
  • Netstat shows that Apache is listening on 3333. Looks like you got the configuration part right. The problem is elsewhere. – Kenny Rasschaert Sep 27 '11 at 12:04