Neobux

Friday, June 13, 2008

Part 5 - Editing httpd.conf

5.0 Editing httpd.conf

  1. You can open httpd.conf in two ways.
    • Start Menu --> Programs --> Apache HTTP Server --> Configure Apache Server --> Edit the Apache httpd.conf
    • Open folder [Drive]:\server\Apache\conf\httpd.conf

Running PHP 5 as an Apache Module

  1. Add following line in the file (can copy and paste to the end of httpd.conf):
    LoadModule php5_module "e:/server/php/php5apache2_2.dll"
    AddType application/x-httpd-php .php
    AddType application/x-httpd-php-source .phps

Configuring the Default Index Page

  1. Find DirectoryIndex. And add index.php.
    From -->DirectoryIndex index.html index.html.var
    To -->DirectoryIndex index.html index.html.var index.php
    This line tells Apache which file names to use when it looks for the default page for a given directory.
  2. Save your file and restart Apache by click Start --> All Programs -- > Apache HTTP Server 2.2 --> Control Apache Server --> Restart or by right-click the icon in the system tray and select restart.
  3. If all is well, Apache will start up again without any error.
  4. If Apache cannot start, try Start Menu--> Apache HTTP Server --> Configure Apache Server --> Review Error Log and see what are the problem.

Configuring Document Root

  1. I prefer to set my Directory Root other than default htdocs in Apache folder.
  2. Find DocumentRoot "E:/server/Apache/htdocs" and change to other folder. I pick e:\server\www\.
    From --> DocumentRoot "E:/server/Apache/htdocs"
    To --> DocumentRoot "E:/server/www"
  3. Do the same for,

Testing the PHP.

  1. Make a new file named phpinfo.php by using any text editor.
  2. Type this in the file.
  3. Put the file in the E:\server\www\ (--> because previously we had assigned this directory as default).
  4. Open your favorite web browser and type http://localhost/phpinfo.php.

.

Note : This guide is only a strip down version (no picture). For a complete guide please download this file. Only for personal webserver.

How to install Apache, MySQL PHP (Windows XP)

No comments:

Post a Comment