Monday, August 17, 2009

How to Troubleshoot Apache Server


Apache is a web hosting product that distributes web pages for companies. Apache hosts multiple platforms, but it's normally used for dynamic pages developed in PHP. Like any application, Apache has occasional problems and technical issues. Several methods are used to troubleshoot Apache, and address the typical causes for Apache errors and downtime.


  1. Step 1

    Check the .htaccess file. This file is used by Apache servers to redirect and set configurations for the host directory. If you're having problems with the way the Apache server handles web requests, the first step is checking the .htaccess configurations.

  2. Step 2

    Check the httpd.conf file for configuration issues when PHP files are not running. If your web visitors receive a pop-up to download PHP files rather than running the code, check the httpd.conf file for the following line of code. This tells Apache that PHP is an executable:
    AddType application/x-httpd-php .php

  3. Step 3

    Configure the httpd.conf file to ensure the index.php file is set as the default page. Replace an index.html file with index.php, and run it as the default when users type in mydomain.com:
    DirectoryIndex index.php

  4. Step 4

    Check the syntax of the httpd.conf file. Apache has a tool that is run from the console to validate configuration code:
    [root@localhost bin]# ./apachectl configtest
    Any errors are reported, so you can fix simple syntax errors.

  5. Step 5

    Check the Apache Wiki for more informaton if you still are unable to find a simple solution (see Resources for link).

No comments:

Post a Comment