I have noticed a new thing going on with my server that I can't quite figure out what is making it happen. I'm hoping someone out there has experience with this problem and can help me find a solution to get it to stop.
I did a reboot on my ubuntu server tonight that I have running at slicehost.com. Everything runs great until I go to start apache. I get the following error.
* Starting web server apache2 (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 ...fail!
A little further research using netstat -ltnp | grep ':80'
will show the following:
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 3948/apache2
I can then kill 3948
and apache starts up like normal. The PID 3948 keeps changing to a different number.
This is new and the only thing I have done since I had a successful boot without this happening was uninstalling a manual install of phpmyadmin and then re-install it using the aptitude install commands. Phpmyadmin now runs fine on the server but I don't understand what this error means or how I can go about getting it resolved.
Anyone that might offer some insight would be greatly appreciated!
UPDATE:
After running ls -la /etc/init.d/
I get the following output. @prix it doesn't look like httpd is in this list.
total 308
drwxr-xr-x 2 root root 4096 2010-06-08 16:38 .
drwxr-xr-x 73 root root 4096 2010-08-18 14:56 ..
-rwxr-xr-x 1 root root 6464 2008-09-19 08:42 apache2
-rwxr-xr-x 1 root root 2231 2008-10-14 08:02 bootlogd
-rwxr-xr-x 1 root root 1916 2008-10-14 08:02 bootmisc.sh
-rwxr-xr-x 1 root root 3508 2008-10-14 08:02 checkfs.sh
-rwxr-xr-x 1 root root 10507 2008-10-14 08:02 checkroot.sh
-rwxr-xr-x 1 root root 7948 2008-09-25 04:12 console-screen.kbd.sh
-rwxr-xr-x 1 root root 1670 2008-06-11 16:02 console-setup
-rwxr-xr-x 1 root root 2653 2008-09-09 14:52 cron
-rwxr-xr-x 1 root root 7195 2008-09-29 05:15 glibc.sh
-rwxr-xr-x 1 root root 1329 2008-10-14 08:02 halt
-rwxr-xr-x 1 root root 1287 2008-10-14 08:02 hostname.sh
-rwxr-xr-x 1 root root 4528 2008-09-25 08:07 hwclockfirst.sh
-rwxr-xr-x 1 root root 4521 2008-09-25 08:07 hwclock.sh
-rwxr-xr-x 1 root root 1404 2008-06-11 16:02 keyboard-setup
-rwxr-xr-x 1 root root 1484 2008-10-14 08:02 killprocs
-rwxr-xr-x 1 root root 1818 2008-08-29 19:41 klogd
-rwxr-xr-x 1 root root 748 2008-06-21 17:30 loopback
-rwxr-xr-x 1 root root 1399 2008-10-14 10:51 module-init-tools
-rwxr-xr-x 1 root root 620 2008-10-14 08:02 mountall-bootclean.sh
-rwxr-xr-x 1 root root 1956 2008-10-14 08:02 mountall.sh
-rwxr-xr-x 1 root root 1351 2008-10-14 08:02 mountdevsubfs.sh
-rwxr-xr-x 1 root root 2296 2008-10-14 08:02 mountkernfs.sh
-rwxr-xr-x 1 root root 618 2008-10-14 08:02 mountnfs-bootclean.sh
-rwxr-xr-x 1 root root 2330 2008-10-14 08:02 mountnfs.sh
-rwxr-xr-x 1 root root 1321 2008-10-14 08:02 mountoverflowtmp
-rwxr-xr-x 1 root root 3668 2008-10-14 08:02 mtab.sh
-rwxr-xr-x 1 root root 5755 2008-09-19 07:02 mysql
-rwxr-xr-x 1 root root 2515 2008-09-19 07:02 mysql-ndb
-rwxr-xr-x 1 root root 1905 2008-09-19 07:02 mysql-ndb-mgm
-rwxr-xr-x 1 root root 2663 2008-06-23 09:21 networking
-rwxr-xr-x 1 root root 1271 2008-10-27 06:17 procps
-rwxr-xr-x 1 root root 9600 2008-10-14 08:02 rc
-rwxr-xr-x 1 root root 788 2008-10-14 08:02 rc.local
-rwxr-xr-x 1 root root 117 2008-10-14 08:02 rcS
-rw-r--r-- 1 root root 1510 2008-10-14 08:02 README
-rwxr-xr-x 1 root root 639 2008-10-14 08:02 reboot
-rwxr-xr-x 1 root root 941 2008-10-14 08:02 rmnologin
-rwxr-xr-x 1 root root 5200 2008-07-28 08:42 rsync
-rwxr-xr-x 1 root root 33378 2008-05-20 02:27 sendmail
-rwxr-xr-x 1 root root 2283 2008-10-14 08:02 sendsigs
-rwxr-xr-x 1 root root 590 2008-10-14 08:02 single
-rw-r--r-- 1 root root 4167 2008-10-14 08:02 skeleton
-rwxr-xr-x 1 root root 3710 2008-10-13 13:52 ssh
-rwxr-xr-x 1 root root 525 2008-10-14 08:02 stop-bootlogd
-rwxr-xr-x 1 root root 1096 2008-10-14 08:02 stop-bootlogd-single
-rwxr-xr-x 1 root root 3483 2008-08-29 19:41 sysklogd
-rwxr-xr-x 1 root root 2488 2008-10-24 05:38 udev
-rwxr-xr-x 1 root root 706 2008-10-24 05:38 udev-finish
-rwxr-xr-x 1 root root 3627 2008-10-14 08:02 umountfs
-rwxr-xr-x 1 root root 2140 2008-10-14 08:02 umountnfs.sh
-rwxr-xr-x 1 root root 1456 2008-10-14 08:02 umountroot
-rwxr-xr-x 1 root root 1815 2008-10-14 08:02 urandom
-rwxrwxr-x 1 root root 1314 2010-03-04 19:22 webmin
-rwxr-xr-x 1 root root 1777 2008-10-23 08:40 x11-common
-rwxr-xr-x 1 root root 2154 2008-07-28 07:27 xinetd
ps -auxf|grep httpd
after the server is rebooted ? if you have a few lines with httpd on the output means apache is up and running. Instead of killing the process you could perform sudosudo /etc/init.d/apache2 restart
! Further in a install of phpmyadmin would not cause your apache to fail but a wrong edit of thehttpd.conf
file could, have you changed anything with the file ?service httpd status
reports apache is not running, additionally log files are not being written too and attempts to restart httpd usingservice httpd restart
fail. The only fix is to killall -9 httpd and start apache again correctly. This problem is caused by apache not being able to connect to port 80 but I have not been able to determine why.cat /etc/apache2/ports.conf
what is the output ? @Richard Holloway since centos is very different from ubuntu i would recommend you making your own question i will take a look and try to assist you with what i can. I've used centos a lot but never had such problem if it were a different OS i would'nt say but being centos i would guess that it seems you have 2 separeted installation of apache on it.