Monday, August 17, 2009

How to Configure HTTPd


HTTPd is the web hosting daemon for Apache. The daemon is run on the web service port (normally number 80) to server web pages to your domain visitors. Apache is a popular solution for hosting PHP web pages, but it also runs on Windows computers. Apache is installed and configured on the host computer through configuration files located on the machine.


  1. Step 1

    Download the install executable at apache.org/dist/httpd/binaries/win32/. Save this file to your computer to install and archive it.

  2. Step 2

    Double-click the executable that you downloaded in Step 1. Click the "Next" button on the Welcome screen.

  3. Step 3

    Choose a path to install the files. This path is needed for Section 2 for configuration, so take note of where you install Apache. Click the "Next" button.

  4. Step 4

    Verify that the installation was run properly by navigating your browser to http://localhost. An Apache welcome screen should be shown.

  5. Configuration of HTTPd

  6. Step 1

    Navigate to the directory where you installed Apache in Section 1. For default installations, this directory is "C:\Program Files\Apache."

  7. Step 2

    Navigate to the httpd.conf to edit its content. These files are located in "\apache\htdocs." Apache uses the "/" character instead of the "\" character for folder paths. Edit the line in the httpd.conf file that sets the path for your installation. For instance, if you decided to install Apache in "C:\myapache," then edit the source line to be the following:

  8. Step 3

    Configure the access. At approximately line 347, access is set for the web service. The line is set by default from the installation to read as follows:
    Order allow,deny
    Allow from all
    The following line only allows access from a specific IP address:
    Order deny,allow
    Deny from all
    Allow from 192.168.0.2

  9. Step 4

    Close the httpd.conf file. Click the Windows "Start" button and select "Run." Type "cmd" in the textbox and press "Enter." This opens the command prompt.

  10. Step 5

    Type "net stop Apache" at the command prompt. When Apache stops, type "net start Apache." This starts the service again. Restarting Apache is needed for the changes to take effect.

2 comments: