2

Pre Reqs/Useful:

(This is a web/dedicated server)
Distributor ID: Ubuntu
Description:    Ubuntu 13.04
Release:        13.04
Codename:       raring

Hardware: ProLiant DL160G5p

Pastes: Apache vhost configs: http://paste.ubuntu.com/6486692/ & http://paste.ubuntu.com/6486707/

**Issue: Can't listen/bind to any port other than 80

The server has some prior configurations (non default) set on it. It seems that I can't get anything to bind/listen on a port other than 80. For example, I've got apache serving the same document (/var/www/index.html) on port 80 and 90 (two separate and enabled vhost configurations - see the pastes at the beginning of this thread for copies of the configs). Starting apache doesn't throw any errors.

root@beast:/etc/apache2/sites-available# a2ensite default
Site default already enabled
root@beast:/etc/apache2/sites-available# a2ensite default90 
Site default90 already enabled
root@beast:/etc/apache2/sites-available# service apache2 start
 * Starting web server apache2                          [ OK ]

Thus, no typical "cant bind to :::90". The server/apache aren't logging any errors (that I can find?) however I can only connect/serve from port 80.

root@beast:/var/log/apache2# cat error.log 
[Wed Nov 27 13:52:33 2013] [notice] Apache/2.2.22 (Ubuntu) configured -- resuming normal operations

Firewalls are disabled for testing purposes:

root@beast:/etc/ufw# ufw status
Status: inactive
root@beast:/etc/ufw# iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination         

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination         

Output from lsof:

root@beast:/etc/ufw# lsof -i
COMMAND   PID       USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
[...]unnecessary sshd listings [...]
apache2 27566       root    4u  IPv6 260215      0t0  TCP *:http (LISTEN)
apache2 27571   www-data    4u  IPv6 260215      0t0  TCP *:http (LISTEN)
apache2 27572   www-data    4u  IPv6 260215      0t0  TCP *:http (LISTEN)

Does it seem odd that it's only mentioning/listening on IPv6?

What am I missing? What am I overlooking?

I appreciate your time and willingness to help, any guidance or suggestions are very much appreciated!

1 Answer 1

1

You need to add a NameVirtualHost directive to the ports.conf file. For example:

NameVirtualHost *:80
Listen 80

NameVirtualHost *:90
Listen 90

See also apache documentation for NameVirtualHost:

http://httpd.apache.org/docs/2.2/de/mod/core.html#namevirtualhost

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .