Apache errors:
1. 403 error:- If you are receiving a 403 forbidden error, and get the apache error log as following,
pcfg_openfile: unable to check htaccess file, ensure it is readable, you will think this as permission error of .htaccess. But Actually this will be the permission error of website dowcument root. Please change the permission according to following,
=-=-
Go to Document root of website and execute the following script,
find . -type f -exec chmod 644 {} \;
find . -type d -exec chmod 755 {} \;
=-=-
The issue will be fixed.
2. Apache failed to start with the error as,
[root@ ~]# service httpd restart
Stopping httpd: [FAILED]
Starting httpd: (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
[FAILED]
[root@ ~]#
To fix,
First check any other application using apache port,
[root@server /]# netstat -lnp | grep :80
o/p should be in the form of PID/httpd
If you find any other application other that apache kill the process ID with the command kill -9 PID and restart apache. Try changing the apache port also.
Another method
1. Change the port 80 in httpd.conf to port 88 just to unbind it.
2. Change the 443 (https) port in /etc/httpd/conf.d/ssl.conf
3. [root@ ~]# service httpd stop
4. Changing ports back to 80 and 443 in both files ssl.conf and httpd.conf:
[root@ ~]# nano /etc/httpd/conf.d/ssl.conf
[root@ ~]# nano /etc/httpd/conf/httpd.conf
5. [root@ ~]# fuser 80/tcp
6. [root@ ~]# fuser 443/tcp
7. [root@ conf.d]# lsof -i :443
httpd PID
8. [root@ conf.d]# lsof -i :80
httpd PID
9. kill -9 PID
10. [root@ conf.d]# service httpd start
Apache Error code help:
101 Switching Protocols
200 OK Action completed successfully
201 Created Success following a POST command
202 Accepted The request has been accepted for processing, but the processing has not been completed.
203 Partial Information Response to a GET command, indicates that the returned meta information is from a private overlaid web.
204 No Content Server has received the request but there is no information to send back.
205 Reset Content
206 Partial Content The requested file was partially sent. Usually caused by stopping or refreshing a web page.
300 Multiple Choices
301 Moved Permanently Requested a directory instead of a specific file. The web server added the filename index.html, index.htm, home.html, or home.htm to the URL.
302 Moved Temporarily
303 See Other
304 Not Modified The cached version of the requested file is the same as the file to be sent.
305 Use Proxy
400 Bad Request The request had bad syntax or was impossible to be satisified.
401 Unauthorized User failed to provide a valid user name / password required for access to file / directory.
402 Payment Required
403 Forbidden The request does not specify the file name. Or the directory or the file does not have the permission that allows the pages to be viewed from the web.
404 Not Found The requested file was not found.
405 Method Not Allowed
406 Not Acceptable
407 Proxy Authentication Required
408 Request Time-Out
409 Conflict
410 Gone
411 Length Required
412 Precondition Failed
413 Request Entity Too Large
414 Request-URL Too Large
415 Unsupported Media Type
500 Server Error In most cases, this error is a result of a problem with the code or program you are calling rather than with the web server itself.
501 Not Implemented The server does not support the facility required.
502 Bad Gateway
503 Out of Resources The server cannot process the request due to a system overload. This should be a temporary condition.
504 Gateway Time-Out The service did not respond within the time frame that the gateway was willing to wait.
505 HTTP Version not supported
====================================
Apache error log show the below errors,
==-
[Wed Dec 29 13:11:34 2010] [error] [client 94.132.92.237] eAccelerator: shmmax should be at least 2MB
[Wed Dec 29 13:11:34 2010] [error] [client 94.132.92.237] Premature end of script headers: announce.php
[Wed Dec 29 13:11:34 2010] [error] [client 94.132.92.237] File does not exist: /home/user/public_html/500.shtml
-==-
This has occurred due to the eaccelerator module. Follow the below step to unistall this,
-------------------------
/scripts/phpextensionmgr uninstall EAccelerator
Uninstalling EAccelerator
Removing EAccelerator from /usr/local/lib/php.ini
---------------------------
1. 403 error:- If you are receiving a 403 forbidden error, and get the apache error log as following,
pcfg_openfile: unable to check htaccess file, ensure it is readable, you will think this as permission error of .htaccess. But Actually this will be the permission error of website dowcument root. Please change the permission according to following,
=-=-
Go to Document root of website and execute the following script,
find . -type f -exec chmod 644 {} \;
find . -type d -exec chmod 755 {} \;
=-=-
The issue will be fixed.
2. Apache failed to start with the error as,
[root@ ~]# service httpd restart
Stopping httpd: [FAILED]
Starting httpd: (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
[FAILED]
[root@ ~]#
To fix,
First check any other application using apache port,
[root@server /]# netstat -lnp | grep :80
o/p should be in the form of PID/httpd
If you find any other application other that apache kill the process ID with the command kill -9 PID and restart apache. Try changing the apache port also.
Another method
1. Change the port 80 in httpd.conf to port 88 just to unbind it.
2. Change the 443 (https) port in /etc/httpd/conf.d/ssl.conf
3. [root@ ~]# service httpd stop
4. Changing ports back to 80 and 443 in both files ssl.conf and httpd.conf:
[root@ ~]# nano /etc/httpd/conf.d/ssl.conf
[root@ ~]# nano /etc/httpd/conf/httpd.conf
5. [root@ ~]# fuser 80/tcp
6. [root@ ~]# fuser 443/tcp
7. [root@ conf.d]# lsof -i :443
httpd PID
8. [root@ conf.d]# lsof -i :80
httpd PID
9. kill -9 PID
10. [root@ conf.d]# service httpd start
Apache Error code help:
101 Switching Protocols
200 OK Action completed successfully
201 Created Success following a POST command
202 Accepted The request has been accepted for processing, but the processing has not been completed.
203 Partial Information Response to a GET command, indicates that the returned meta information is from a private overlaid web.
204 No Content Server has received the request but there is no information to send back.
205 Reset Content
206 Partial Content The requested file was partially sent. Usually caused by stopping or refreshing a web page.
300 Multiple Choices
301 Moved Permanently Requested a directory instead of a specific file. The web server added the filename index.html, index.htm, home.html, or home.htm to the URL.
302 Moved Temporarily
303 See Other
304 Not Modified The cached version of the requested file is the same as the file to be sent.
305 Use Proxy
400 Bad Request The request had bad syntax or was impossible to be satisified.
401 Unauthorized User failed to provide a valid user name / password required for access to file / directory.
402 Payment Required
403 Forbidden The request does not specify the file name. Or the directory or the file does not have the permission that allows the pages to be viewed from the web.
404 Not Found The requested file was not found.
405 Method Not Allowed
406 Not Acceptable
407 Proxy Authentication Required
408 Request Time-Out
409 Conflict
410 Gone
411 Length Required
412 Precondition Failed
413 Request Entity Too Large
414 Request-URL Too Large
415 Unsupported Media Type
500 Server Error In most cases, this error is a result of a problem with the code or program you are calling rather than with the web server itself.
501 Not Implemented The server does not support the facility required.
502 Bad Gateway
503 Out of Resources The server cannot process the request due to a system overload. This should be a temporary condition.
504 Gateway Time-Out The service did not respond within the time frame that the gateway was willing to wait.
505 HTTP Version not supported
====================================
Apache error log show the below errors,
==-
[Wed Dec 29 13:11:34 2010] [error] [client 94.132.92.237] eAccelerator: shmmax should be at least 2MB
[Wed Dec 29 13:11:34 2010] [error] [client 94.132.92.237] Premature end of script headers: announce.php
[Wed Dec 29 13:11:34 2010] [error] [client 94.132.92.237] File does not exist: /home/user/public_html/500.shtml
-==-
This has occurred due to the eaccelerator module. Follow the below step to unistall this,
-------------------------
/scripts/phpextensionmgr uninstall EAccelerator
Uninstalling EAccelerator
Removing EAccelerator from /usr/local/lib/php.ini
---------------------------