Saturday, May 9, 2009

running Apache web server

The following is adapted from a sitepoint article by Craig Buckler on how to install apache on windows.

Step 1: download the file apache_2.2.11-win32-x86-no_ssl.msi from http://www.apache.org/dist/httpd/binaries/win32/.

Step 2: install but choose the custom option; shorten the installation location to just C:/Program Files/apache2.2; don't install any of the options (e.g. documentation) - you'll need to click and choose don't install for each; don't install taskbar or system tray icon.

Step 3: find services through control panel and change the configuration for the Apache service to manual startup; stop the Apache service; close services; then hold down control and drag the services icon to the start button to pin it to the start bar;

Step 4: navigate to the conf folder in C:/Program Files/apache2.2; right click, choose properties and change the permissions of your own user to full control; now you can make changes to the httpd.conf file;

Step 5: double click httpd.conf and make the following changes -

* Line 116, enable mod-rewrite by removing the # (optional, but useful):
1 LoadModule rewrite_module modules/mod_rewrite.so

* Line 224, allow .htaccess overrides:
1 AllowOverride All

* create a new folder C:/htdocs, where you will house your web project;
then at Line 179, set the root:
1 DocumentRoot "C:/htdocs"

and at line 204:
1 <Directory "C:/htdocs">

Step 6: copy your web project into C:/htdocs

Step 7: open Services, select Apache and press the green play button to start the service;

Mission accomplished!

No comments:

Post a Comment