Before we start installing, I must tell you that on the first install attempt, you might receive errors. This is normal, and almost everyone gets them, but in order to try again you must first uninstall it through the proper Windows uninstaller, or you might not be able to run it again. The uninstaller is located in Start>Settings>Control Panel>Add/Remove Programs. To uninstall Apache or MySQL properly, you must first uninstall it through Windows, and then go to the directory in which you installed it before, and delete all files, since it’s useful to provide these programs with a fresh configuration.
Now let's begin.
Once you load the *.msi file which you downloaded, and you will come to an install page. Follow the installation instructions until you reach a page called "Server Information". There are many text boxes on this page, and a couple of options at the bottom. You should fill them as shown below:
Network Domain: localhost
Server Name: localhost
Administrator's Email Address: admin@localhost
For the area below the text fields with the radio boxes, you need to decide which to choose from. If you choose the first option, Install as a Service, Apache loads upon start-up, and out of the way so it doesn't bother your other applications. This is definitely recommended unless your computer is low on memory (RAM), in which case you should choose the second option. If you choose the second option, you will need to load up Apache every time you wish to use the web server, and it shows up as an open application like Internet Explorer. To keep Apache running in this mode, you need to keep it minimized all the time.
Note: If you install under Windows 95/98/ME, Apache will automatically install as a manual application, meaning the second option in the install.
Once you have filled in all of the text-boxes and chosen one of the install options, click Next and choose "Complete" install. On the next page, there is a button called "Change..." for the install path. Click this button and in the selected text-box, type in "c:web". After this, your all set and are ready to install the program. Just continue the install wizard and press "Install".
Now that we have it installed, its time to make sure that everything works properly. Go to "Start>Programs>Apache HTTP Server". If you see an option called "Start Apache in Console", click that (you will need to do this every time you wish to load up Apache). Otherwise, there should be a shortcut called "Control Apache Server". Click that and then click on the option titled "Start Apache Server". A DOS window should load up and disappear shortly. Now, open up your internet browser and type into the address "http://127.0.0.1/". If you see an Apache page, pat yourself on the back because you have successfully installed Apache.
Next, we need to configure Apache properly on your system. To do this, we will have to edit Apache's Server Configuration File, which controls all aspects of the server. Go to the folder "c:webApacheconf" and open the file "httpd.conf" in a text-editor.
Note: A common text-editor is Microsoft Notepad. You must be careful not to use a word processor like Microsoft Word or Microsoft WordPad because the application encodes the file differently, stopping programs like Apache from reading it.
Once opened, you will need to change a few variable statements. Since the file is quite large, it is much easier to search with the parts we need to change. In most editors, you can enable the search by pressing "ctrl+f", which brings up a prompt. Just type in what I have in here and change the information.
1. Search for: ServerName
This variable tells Apache how to access your server locally, rather than the local IP address.
If, after ServerName, there is no more text, type in localhost. Otherwise skip this step and go on.
2. Search for: DocumentRoot
This tells Apache where to look for the files to show up when you access the server. This is basically where you put your website.
First, create a new folder in the "c:web" folder called "www". Next, change the system path already given to "c:/web/www/". Make sure the path is in quotes.
Note: In Apache, the system path uses the Unix "/", of forward-slash, instead of the Windows back-slash, "".
3. Search for : <Directory "C:/web/Apache/htdocs
This is the first Directory configuration in the file, and is most likely the only one you will ever need.
Change the entire line to: <Directory "c:/web/www">
4. Search for: Options Indexes FollowSymLinks MultiViews
This tells Apache the folder options for the Server Root and subdirectories.
Go on to the PHP Install.
Change this entire line to: Options MultiViews All
5. Go to the end of the document and add a couple of extra lines. Here, we are going to add the PHP Module for Apache, so we don't have to open the Apache Configuration again.
At the bottom of the file, copy this info:
# PHP as a Module
LoadModule php4_module c:/web/php/sapi/php4apache.dll
# AddModule mod_php4.c
AddType application/x-httpd-php .php .php3 .php4 .phtml
AddType application/x-httpd-php-source .phps
And you’re done! You have completed the most difficult part of installing your server, and it gets significantly easier from here on. DO NOT restart Apache just yet, because we need to install the PHP files first. If you do restart, it will create an error for most users. Now, continue onto the PHP Installation.