Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Trying to bind apache2 to localhost only, running Ubuntu 12.04.3 LTS on OpenVZ VPS. It fails on me (see /var/log/apache2/error.log). Default configuration is:

# cat /etc/hosts
fe00::0     ip6-localnet
ff00::0     ip6-mcastprefix
ff02::1     ip6-allnodes
ff02::2     ip6-allrouters

127.0.0.1 localhost.localdomain localhost
# Auto-generated hostname. Please do not remove this comment.
<some-ext-ipv6-address> <some-hostname>
::1     localhost ip6-localhost ip6-loopback
# netstat -lntup
tcp6       0      0 :::80                   :::*                    LISTEN      623/apache2

I change Listen 80 to Listen 172.0.0.1:80 in /etc/apache2/ports.conf.

Apache2 errors out. There is no other service listening on port 80, also there is no other (conflicting) Listen declaration, just the default ports.conf apache2 ships with + the single change described.

# cat /var/log/apache2/error.log
apache2: Could not reliably determine the server's fully qualified domain name, using <some-ext-ipv6-address> for ServerName
(99)Cannot assign requested address: make_sock: could not bind to address 172.0.0.1:80
no listening sockets available, shutting down
Unable to open logs
share|improve this question
    
sorry, preschool mistake actually. localhost is 127.0.0.1, not 172.0.0.1. omg! –  Dirk Jung Oct 5 '13 at 11:44
    
If you have solved your problem then I would recommend you either delete the question. Or if you believe it may be useful to others post the solution as an answer. –  Warren Hill Oct 5 '13 at 13:47
    
Something else, not directly related to your problem, but it may help others: Your '/etc/hosts' defines 'localhost' twice. Once for IPv4 127.0.0.1, once for IPv6 ::1. There can (or should) be only one ;) This caused some name resolution problems on my virtual servers which had me scratch my head before I found the cause. –  Henning Kockerbeck Jul 18 at 20:43
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.