Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. 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

1 Answer 1

up vote 0 down vote accepted

localhost address is 127.0.0.1 not 172.0.0.1

share|improve this answer
1  
omg, what a silly mistake. thanks, works perfect! back to preschool then. –  Dirk Jung Oct 5 '13 at 11:41

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.