Tuesday, November 24, 2009

Trouble shooting 503 Access Forbidden error for Drupal

Forbidden You don't have permission to access /drupal/index.php on this server. Server at localhost Port 80

The above is a common error encountered on most Apache installations. You can confirm that you do have read/write permissions to the file by using the below command to check file permissions in a directory(Linux)
#ls -l /path/to/directory containing file

You can change permissions by giving the apache group ownership and read write permissions as shown below:

Adding Apache Group Ownership
#chgrp apache /path/to/directory containing file

changing Group permissions
#chmod g+rw /path/to/directory containing file

If the permissions are in order, then it is time to check the Apache Error Logs

Most of the times, the error is output by the apache server when you try to start it. This can also be checked by checking the httpd error log.
/var/log/httpd/error_log


From the error log, you can tell which module is causing the error. You can temporarily disable the module by editing it out from the Apache config file.

/etc/httpd/conf/httpd.conf

Comment out the the module by adding a '#' before the 'LoadModule ....' line so it becomes

LoadModule log_config_module modules/mod_log_config.so
#LoadModule offendingmodule
LoadModule mime_magic_module modules/mod_mime_magic.so

Restart Apache and see if it works
#apachectl restart

Webmin


Load webmin by typing http://localhost.localdomain:10000/ into your browser
log in with your root username and password.
Then Proceed to system->System Logs->Httpd error log







This helps identify the error.
To Edit out modules causing errors, proceed to Server->Apache Server->Global Configuration->Edit Config Files-> and Edit Directive File in /etc/httpd/conf/httpd.conf.d







comment out the offending module with a "#" as described above, then save and try to start Apache.

No comments:

Post a Comment