Apache
  Home arrow Apache arrow Page 3 - Configuring and Using the Apache HTTP Web Server on a Windows XP PC
Dev Shed Forums  
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Smartphone Development  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Mobile Linux  
App Generation ROI  
IBM® developerWorks  
Forums Sitemap  
E-Commerce Hosting  
Linux Web Hosting  
Managed Hosting  
Small Business Hosting  
VPS Hosting  
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid  
Request Media Kit
Contact Us  
Site Map  
Privacy Policy  
Support  
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
APACHE

Configuring and Using the Apache HTTP Web Server on a Windows XP PC
By: Dan Wellman
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 113
    2004-05-24


    Table of Contents:
  • Configuring and Using the Apache HTTP Web Server on a Windows XP PC
  • Get the Software and Set up a Directory Structure
  • Opening the File and Making Modifications
  • Testing

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      error-file:tidyout.log Del.ici.ous error-file:tidyout.log Digg
      error-file:tidyout.log Blink error-file:tidyout.log Simpy
      error-file:tidyout.log Google error-file:tidyout.log Spurl
      error-file:tidyout.log Y! MyWeb error-file:tidyout.log Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article

     
     
    ADVERTISEMENT


    Configuring and Using the Apache HTTP Web Server on a Windows XP PC - Opening the File and Making Modifications
    ( Page 3 of 4 )

    If, when you attempt to open the file for the first time, you receive an error message advising that you do not have an associated program with which to open this type of file (as I did), you will need to choose Notepad from the list of selected programs.  If this fails to work; browse to the location of the file - as stated above – then open a blank Notepad window and just drag the file in.

    The file itself is broken up into three distinct sections: the global environment, the ‘main’ server configuration, and the virtual hosts section.  The first section enables you to change settings that affect the overall operation of the server, and for our purposes here, can pretty much be left unchanged (although do read through some of the comments to give yourself a better overview of how the program works.) 

    The second section is where we will make most, if not all, of our modifications.  This is the section which deals with which folders the server looks in when pages or files are requested by the browser, and the settings and preferences regarding what is allowed to be executed from these folders.

    The third section is used entirely to specify any virtual hosts that you want the server to manage.  If you want to run several sites/domains from one server, this is the section that you need to modify.  Again, for the purpose of this article, you can safely ignore this section.

    So, with the httpd file open, scroll right down through the first section, and right near the top of the second section (line 210), you’ll see ServerName.  If this doesn’t say localhost:80, change it so that it does.  Next, change the DocumentRoot statement (which is the second actual statement following ServerName) to read as follows:

    DocumentRoot "C:Documents and SettingsYourusernamehereMy DocumentsMyWebsitelocalhostwww" 

    Now scroll down to the second instance of the <Directory > option.  This, as stated in the block of comments above it, should be changed to whatever you set DocumentRoot to; in this case:

    <Directory "C:Documents and SettingsYourusernamehereMy DocumentsMy Websitelocalhostwww">

    Directly below the comments that follow the above statement, you’ll see a statement that begins with Options.  Make sure that this line contains the words Includes and ExecCGI, so that it looks like this:

    Options Multiviews Indexes SymLinksifownerMatch Includes ExecCGI

    This will enable SSI and executable CGI scripts in your DocumentRoot.  If there is a # symbol at the start of this line, ensure that you remove it.

    Scroll down a bit more and you’ll see the UserDir statement, make sure it says:

    UserDir "My Documents/My Website"

    Almost directly below this, there is another <Directory > option.  You will need to remove all of the # symbols from the opening <Directory > to the closing </Directory > Tag and this will need to be set to:

    <Directory "C:/Documents and Settings/Yourusernamehere/My Documents/My Website/localhost">

    Again, I’ve found it best to add Includes and ExecCGI in the options statement below this.

    Below this closing <Directory > tag, there is the DirectoryIndex statement; simply append index.htm and index.cgi to the end of this line. 

    You’ll need to scroll down quite a way now, until you come across the line that begins with ScriptAlias /cgi-bin/.  Change this line to read:

    ScriptAlias /cgi-bin/ "C:/Documents and Settings/Yourusernamehere/My Documents/My Website/localhost/cgi" 

    There may be a comment symbol (#) at the start of the ScriptAlias statement, if so, remove it.  Four lines below this amend the <Directory > tag to:

    <Directory "C:Documents and SettingsYourusernamehereMy DocumentsMy Websitelocalhostcgi">

    Now scroll down for some time until you see the AddType application lines.  In order to use PHP, you’ll need to add the following directive:

    AddType application/x-httpd-php php

    Insert the above line directly below the AddType directives already present, and then add the following statements directly below that:

    ScriptAlias /_php/ "C:/Program Files/PHP/"

    Action application/x-httpd-php "/_php/php.exe"

    The ScriptAlias needs to match the directory you’ve installed PHP in, so amend it accordingly.

    Now a little further down you’ll find the AddHandler directive.  All you need to do here is add .bat and .pl to the end of this line. Also add AddHandler server-parsed .html to the very next line.

    Keep going down, and very soon you will see AddType text/html .shtml, which can be left as-is, but may need to delete the # from the start of the line, and will need:

    AddHandler server-parsed .shtml .html .htm

    added to the next line.  You’ll be relieved to hear that that is the end of configuring the conf file.  Save the document and then restart the Apache Server.



     
     
    >>> More Apache Articles          >>> More By Dan Wellman
     

       

    APACHE ARTICLES

    - Creating a VAMP (Vista, Apache, MySQL, PHP) ...
    - Putting Apache in Jail
    - Containing Intrusions in Apache
    - Server Limits for Apache Security
    - Setting Permissions in Apache
    - Installing Apache
    - Apache Installation and Configuration
    - Apache Tapestry and Custom Components: DateI...
    - Tapestry and AJAX: Autocompleter and InlineE...
    - PropertySelection and IPropertySelectionMode...
    - The DatePicker and Shell Components of Apach...
    - Apache Tapestry: ASO and More Components
    - Apache Tapestry and DirectLink, IoC and DI
    - Making a CelebrityCollector with Apache Tape...
    - Apache Tapestry and Listener Methods, Condit...





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
    Stay green...Green IT