Pages

Showing posts with label Apache2. Show all posts
Showing posts with label Apache2. Show all posts

Wednesday, May 1, 2013

Apache web service wont start after restart, apache2 error "Address already in use"

If you stopped or restarted the apache2 server service and it failed to start this article should help.

You might type the command: rcapache2 start

You might get an error like this:

Starting httpd2 (prefork) (98)Address already in use: make_sock: could not bind to address [::]:80
(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
startproc:  exit status of parent of /usr/sbin/httpd2-prefork: 1               ...        failed


Try this:

Run each of these commands

for i in `ps auwx | grep -i nobody | awk {'print $2'}`; do kill -9 $i; done
for i in `lsof -i :80 | grep http | awk {' print $2'}`; do kill -9 $i; done
for i in `lsof -i :80 | grep http | awk {' print $2'}`; do kill -9 $i; done

then run
service httpd restart
or run
 rcapache2 start



Until next time
thanks

P.S. like anything else on this blog, the instructions are 'as is' and use art your own risk.

Monday, January 28, 2013

Apache2 in Open SUSE - Start Stop Restart


To start, stop, or manipulate Apache on a running system, use the init script /usr/sbin/rcapache2. Thercapache2 command takes the following parameters:
status
Checks if Apache is started.
start
Starts Apache if it is not already running.
startssl
Starts Apache with SSL support if it is not already running. For more information about SSL support, refer toSection 20.6, “Setting Up a Secure Web Server with SSL”.
stop
Stops Apache by terminating the parent process.
restart
Stops and then restarts Apache. Starts the Web server if it was not running before.
try-restart
Stops then restarts Apache only if it is already running.
reload or graceful
Stops the Web server by advising all forked Apache processes to first finish their requests before shutting down. As each process dies, it is replaced by a newly started one, resulting in a complete restart of Apache.





Restart Apache 2 web server, enter:

# /etc/init.d/apache2 restart

If you are using Ubuntu use sudo:

$ sudo /etc/init.d/apache2 restart

To stop Apache 2 web server, enter:

# /etc/init.d/apache2 stop
OR
$ sudo /etc/init.d/apache2 stop

To start Apache 2 web server, enter:

# /etc/init.d/apache2 start
OR
$ sudo /etc/init.d/apache2 start