Home arrow Apache arrow Page 2 - Configuring and Using the Apache HTTP Web Server on a Windows XP PC

Get the Software and Set up a Directory Structure - Apache

Author Dan Wellman explains what the Apache HTTP web server is and how it acts as a local server so you can test PHP code or CGI scripts you've written to see how they will look live. Wellman concentrates on using it on your desktop PC purely for testing code.

TABLE OF CONTENTS:
  1. Configuring and Using the Apache HTTP Web Server on a Windows XP PC
  2. Get the Software and Set up a Directory Structure
  3. Opening the File and Making Modifications
  4. Testing
By: Dan Wellman
Rating: starstarstarstarstar / 122
May 24, 2004

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement

To get the software, go to the following page:

http://httpd.apache.org/download.cgi#verify

The site will select a mirror for you. Now scroll down to the first section past the mirror section, and click:

Win32 Binary (MSI Installer): apache_2.0.49-win32-x86-no_ssl.msi

Answer the prompts in your usual manner. The installation file is 5.81Mb, so go and make a cup of tea or something, and when you come back, it should be done. To install the server; run the executable youíve just downloaded and accept the terms.  Enter localhost in the domain and servername text fields, and just enter yourname@localhost in the bottom one.  Leave the target directory and hit install.  Once the program has installed successfully, youíll see an Apache icon with a green play symbol on it in your system tray (right there, next to the clock).  This means the server is running.  To stop or restart the server (to pick up changes made in the configuration file for example), just left-click this icon and select Apache2 / Stop or Restart.  When the server has stopped, the same icon, but with a red stop symbol on it will be in your system tray.  You may at this point also wish to install PHP.  If so, go to www.php.net and download the exe file and the zip file.  Run the exe file; you can leave most of the defaults as they are, but change the target directory from C:php to C:program filesphp. 

And itís as easy as that?  Not quite; you could of course, leave the Apache configuration file exactly as it is and host all of your test pages and scripts out of the default folder, which happens to be C:Program FilesApache GroupApache2htdocs.  Lovely. 

Ideally though, you want to set up a directory structure that is easy to remember the file path of, and at least vaguely reflects the directory structure that is used on web servers.  Additionally, you need to at least make some minor changes to the configuration file in order to enable SSI includes and CGI, which of course, you want to do (donít you?)

But first a little groundwork; in the My Documents folder, create a folder called My Website, and within that, create a folder called localhost. Now create two folders in the localhost folder; one called www and one called cgi. Thatís your directory structure set up.  Now, what happens if you make some changes in the configuration file only to find that the server doesnít function correctly? Or worse still, the server won't even start?  Fortunately, this release of Apache has a backup configuration file called httpd.default (youíll notice that all of the files in the conf folder are backed up in this way.) So if you want to return to the original configuration file, just copy and paste the entire contents of the .default file into the httpd file, which is the main configuration file. This is a lot quicker, easier and less frustrating in general than uninstalling and then reinstalling the program repeatedly, until you get it right. Both of these files are kept in the C:Program FilesApache GroupApache2conf folder, but another great thing about Apache is that you donít have to browse through your filing system to find the main configuration file, you just launch it using the ĎEdit the Apache httpd.conf Configuration fileí shortcut, which can be found under:

Start / Apache HTTP Server 2.0.49 / Configure Apache Server.



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

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort
   

APACHE ARTICLES

- Apache Unveils Cassandra 1.2
- Apache on ARM Chips? Dell and Calxeda Help M...
- The Down Side of Open Source Software
- VMware Unveils Serengeti for Apache Hadoop
- SAP Takes Steps to Improve Hadoop Integration
- Looking to Hone Apache Hadoop Skills?
- How to Install Joomla on WAMPP
- Working with XAMPP and Wordpress
- GUI Available for Apache Camel
- Reduce Server Load for Apache and PHP Websit...
- Creating a VAMP (Vista, Apache, MySQL, PHP) ...
- Putting Apache in Jail
- Containing Intrusions in Apache
- Server Limits for Apache Security
- Setting Permissions in Apache

Developer Shed Affiliates

 


Dev Shed Tutorial Topics: