I am getting this error when I try to start Apache in Ubuntu.
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs
Action 'start' failed.
I have this in my ports.conf
NameVirtualHost *:80
Listen 80
This is my vhost file
<VirtualHost *:80>
ServerAdmin example@example.com
ServerName rails.server.com
# ServerAlias
DocumentRoot /var/www/sample_app/current/public
ErrorLog /var/www/sample_app/error.log
RailsEnv production
<Directory "/var/www/sample_app/current/public">
Options Indexes FollowSymLinks MultiViews
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
What am I missing?
In my case, I had removed the default
ssl.conf
file (renamed tossl.conf.bak
), and had my own ssl config file.Then I did a
yum update
and it updated apache... Which also reintroduced the filessl.conf
, which means how I had 2 conf files withListen 443
.Solution (generic - CentOS): go to
/etc/httpd/conf.d
, do agrep -r 'Listen' .
, see if you have duplicateListen XXX
statements, remove them as required.I had the same issue with a very different cause. I am running Apache 2.4.7 with PHP 5.5.6 on CentOS 6.5.
I messed up php.ini by having BOTH output_handler=ob_gzhandler AND zlib.output_compression=On (either one, not both, can be set).
So on restarting Apache, it binds to port 80 but nothing else happens. It looks like it is running but php's error locked it up somewhere.
The clue was to check "php -v" ... when I saw it not returning anything (it wrote the error to error_log), I fixed php.ini and Apache was happy again.
Maybe this helps someone...