0

I already know of the main .conf problem with Ubuntu 13.10 and the change to Apache 2.4 for the suffix to site-available files.

My problem is that when I enable "a2ensite xxxx" for "xxx.conf" in "sites-available" folder, I get this message when I restart/reload Apache:

(98)Address already in use: AH00072: make_sock: could not bind to address [::]:80

Then I can "a2dissite xxxx" and get apache to run again. I don't know why this is. My .conf file is as follows:

# Ensure that Apache listens on port 80
Listen 80

# Listen for virtual host requests on all IP addresses
NameVirtualHost *:80

<VirtualHost *:80>
    ServerAdmin alex@localhost.com
    DocumentRoot /var/www/ethico/docroot
    ServerName ethico-r6.dev
    ServerAlias *.ethico-r6.dev www.ethico-r6.dev
</VirtualHost>

Also for /etc/hosts:

127.0.0.1   *.ethico-r6.dev  www.ethico-r6.dev
127.0.0.1   localhost

Thanks in advance for any help!

-Alex

0

You do not need to add the Listen directive in your virtual host configuration. It is already configured in /etc/apache2/ports.conf.

This is making apache listen to the port 80 more than once.

Error condition

Multiple Listen directives for the same ip address and port will result in an Address already in use error message.
Source: http://httpd.apache.org/docs/2.2/mod/mpm_common.html#listen


On a side note, the NameVirtualHost has no effect in apache 2.4

The NameVirtualHost directive no longer has any effect, other than to emit a warning. Any address/port combination appearing in multiple virtual hosts is implicitly treated as a name-based virtual host.
Source: http://httpd.apache.org/docs/current/upgrading.html#misc

2
  • Thanks Dan. Taking out the Listen directive did fix the problem. On the side note however, I read this in another stackoverflow: "I think you are missing NameVirtualHost :80 in your main config file. This will more or less disable name based virtual hosts (:80)." stackoverflow.com/questions/19518907/… I also took NameVirtualHost out, but you are saying that note is not right? – Alex Finnarn Dec 1 '13 at 0:26
  • @AlexFinnarn I don't believe it's true. Maybe he is still using the old httpd.conf file of apache 2.2. But I can assure that I don't have the NameVirtualHost in my apache configs. And everything is working as expected. – Dan Dec 5 '13 at 11:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.