Reputation: 53
Once I a2enmod the ssl module and restart apache I get the following error:
Restarting web server apache2
AH00548: NameVirtualHost has no effect and will be removed in the next
release /etc/apache2/ports.conf:14
(98)Address already in use: AH00072: make_sock: could not bind to address
[::]:443
(98)Address already in use: AH00072: make_sock: could not bind to address
0.0.0.0:443
no listening sockets available, shutting down
AH00015: Unable to open logs
Action 'start' failed.
The Apache error log may have more information.
To stop it I can either disenmod or comment out the following module lines in the ports.conf file:
Listen 80
#<IfModule mod_ssl.c>
# Listen 443
#</IfModule>
<IfModule mod_gnutls.c>
Listen 443
</IfModule>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
Any help would be much appreciated
Upvotes: 5
Views: 30211
Reputation: 1801
Based directly on this answer, you should kill httpd
(it has server.port = 80
in its lighttpd.conf
) and then try to start apache
.
= Show processes hung =
ps wax | grep httpd
= Kill Process ID 1234 =
kill 1234
= Start Apache24 =
apachectl start
= Verify it is running =
service apache24 status
Upvotes: 0
Reputation: 389
The error "AH00015: Unable to open logs" is indicative of a missing file or directory in one of your log definitions. If you have a web server with a lot of virtual named sites running on it, it is easy to delete an old directory and forget to update the httpd-vhosts.conf
or httpd-ssl.conf
files to remove the config.
I run FreeBSD 10.3 with Apache 2.4, so my files may be in another location that yours. But once you find where your virtual hosts files are located, the solution is the same. This is what you need to do to solve this:
Change into the directory where your virtual named hosts are defined:
cd /usr/local/www/conf/extra
Use grep to pull all of the log file references out of your named virtual host definitions:
grep -i log * > x.tmp
This will create a file with entries that show the name of the file, the apache log directive (ErrorLog, CustomeLog, TransferLog), and the name of the log file.
Use the bash shell to setup a while read loop to pull the file apart and capture the names of the log files in another file:
cat x.tmp | while read a b c d; do echo $c >> y.tmp; done
Use your favorite editor to edit the y.tmp
file to remove anything
that does not look like the name of a log file (junk). This junk is
inevitable with using grep to search for text in a big file. Once
you have a list of files (and nothing else), insert "ls -la " in
front of the file names. With the vi editor you can do this with
the following command:
:%s/^/ls -la /
Run the file as a script using sh or bash as follows:
sh y.tmp
It will show the individual file if it exists, and if it does not exists it will display an error similar to the following:
ls: /usr/local/www/virtual/nsr/logs/access.log: No such file or directory
This could be caused by a misspelling, a missing directory, or some other cause (a symlink that points to a non existent object). Either edit your virtual named hosts definitions to remove it from the configuration, or define the directory with the correct permissions for the web server to access it.
Restart the web server (apachectl start
) and verify the httpd
daemons are running using ps awx | grep http
.
Upvotes: 0
Reputation: 766
The following lines of your output state that an other programme is already listening on port 443 and due to the fact that Apache does not support port sharing it is unable to bind to that port and so it shuts down.
(98)Address already in use: AH00072: make_sock: could not bind to address
(98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:443
Thus I recommend you to shut the programme listening to that port down. You can determine which programmes are listening on TCP port 443 with the following command (must be executed as super user):
netstat -tlpn | grep 443
Then shut down the already listening programme (for example by using service <programme> stop
or by using kill <processID>
(the process ID is also supplied by netstat
). Afterwards, you can start Apache by using service apache2 start
or by executing /etc/init.d/apache2 start
. Both commands work when you are working with Ubuntu/Debian. If you are working with CentOS/RedHat Apache is named httpd
.
Upvotes: 4