Showing posts with label Http Errors. Show all posts
Showing posts with label Http Errors. Show all posts

Wednesday, April 15, 2009

500 Internal server error for easy apache

I logged into the WHM and tried to run the EasyApache (Apache Update) under the Software section.

But when i tried to run it, i got this wierd error :

Premature end of script headers: /usr/local/cpanel/whostmgr/docroot/cgi/easyapache.pl: Please check / usr / local / cpanel / logs / error_log for the exact error.


look in the log file but it just repeats the above error and doesnt supply any additional info.

Do the following from shell to fix above error

/scripts/upcp --force

Sunday, April 12, 2009

HTTPD ERRORS AND TROUBLESHOOTING

(1) Address already in use: make_sock: could not bind to address - Apache - HTTPD Error

While restarting httpd service, getting below error

root@srv [/tmp]# service httpd start
[warn] NameVirtualHost
xx.xx.xx.xx:80 has no VirtualHosts
(98)Address already in use: make_sock: could not bind to address
0.0.0.0:443
no listening sockets available, shutting down
Unable to open logs

If you are not able to start httpd and unable to open log

root@srv [/tmp]# tail -f /usr/local/apache/logs/error_log
[Sun Apr 12 03:26:05 2009] [error] could not make child process
11204 exit, attempting to continue anyway
[Sun Apr 12 03:26:05 2009] [error] could not make child process
11208 exit, attempting to continue anyway
[Sun Apr 12 03:26:05 2009] [error] could not make child process
11210 exit, attempting to continue anyway
[Sun Apr 12 03:26:05 2009] [error] could not make child process
11230 exit, attempting to continue anyway
[Sun Apr 12 03:26:05 2009] [error] could not make child process
11231 exit, attempting to continue anyway
[Sun Apr 12 03:26:05 2009] [error] could not make child process
11233 exit, attempting to continue anyway

The fix is as follows. Run the following command
check if anyother service is running on port 80 instead of httpd and if it is running then stop that service or kill that process forcefully and try to start httpd.

netstat -lnp | grep '0.0.0.0:80'
# output
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 30982/crond

In my case the output showed that crond was using the port. I

ran the following to learn more

ps 30982
PID TTY STAT TIME COMMAND
30982 ? S 0:34 crond

I tried the following a couple of times

service crond stop OR kill -9 processid

and then

service httpd restart
Stopping httpd: [FAILED]
Starting httpd: [ OK ]

and later


service crond start
Starting crond: [ OK ]

===================================