1. Downloading an Apache package |
1.1 Where to search |
An Apache package in available in either source or binary form.
You download the source form and compile it, if you wish to thouroughly understand the product, and possibly contribute to its development.
The average user would download a readily compiled binary package. This guide is intended for this category of users.
1.2 Downloading a binary package |
- | a package complete with an installer called MSI (Microsoft System Installer) -- this is a file with an .exe extension. Example: apache_2.0.50-win32-x86-no_ssl.exe |
- | a package without the accompanying installer, the latter being already in your Windows system (recent Windows systems such as XP all have this installer)-- this is a file with the .msi extension. Example: apache_2.0.50-win32-x86-no_ssl.msi |
You can put the downloaded package anywhere. For neatness sake, you can create a folder were you would put software related downloads. For example: C:\SoftwareDownloads
The .exe version is bigger by 3 Mo (the accompanying Microsoft System Installer size), but it is quicker to run.
2. Running the installation package |
- | select the file by clicking on it; depending on the setting of your Windows system, this may have opened the file |
- | if the file was not opened, click on the "File" menu, and select "Open"; alternatively, you can open the file by a double click. |
Running the package starts the Installation Wizard which will ask you simple questions and do the installation. This done, Apache is in working order. Most often, it is even running and ready to accept requests.
2.1 Filling in the requested information |
Network domain: Enter the actual or intended domain name of your server. Example: hatayservices.com -- if you are setting up Apache just for locally testing scripts running under Apache such as developped in PHP, PERL, JSP, etc. just any name will do.
Server name: Enter your server Internet name, which is a subdomain name of the Network domain. Example: server.hatayservices.com -- as for the Network domain name, if you are installing Apache just for the purpose of locally testing scripts, any name will do.
System Administrator e-mail address: enter the e-mail address where you wish notifications from Apache to be sent.
The informations you fill in will be reflected in the configuration file (httpd.conf) that the Wizard will generate for Apache
2.2 Choosing the setup mode |
2.3 Changing to your preferred folder |
With UNIX, there is no such problem. You can just accept the proposed path.
2.4 Terminating |
3. Reinstalling |
In case of error, you can try a new installation run.
The easiest to do is:
- | stop Apache |
- | uninstall Apache, using the Add/Delete function from the Configuration Panel |
- | delete the directories created by the installation run, that the uninstall process did not delete |
- | run the installation package again. |
An error when reinstalling can result from the Apache Monitor being still on. In this case, just stop the Apache Monitor, for example, using the CTRL+ALT+DEL key combination (simultaneously press the three keys, then select the Apache Monitor and click the Cancel key), and do the installation procedure again:
- uninstall Apache from the Configuration Panel,
- delete remaining Apache related directories
- run the installation package
4. Customizing |
Alias /appl "C:/MyAppl/Scripts" |
As the C:/MyAppl/Scripts directory is outside the document root directory, you can use the <Directory> directive to allow execution of the scripts contained in it:
<Directory C:/MyAppl/Scripts> Order Allow,Deny Allow from all </Directory> |
5. Readying Apache for PHP |
The LoadModule directive indicates where the PHP module is to be loaded from. With PHP 5, this module is php5apache2.dll. If PHP is installed in c:/SoftwareSystems/PHP, the directive is:
LoadModule php5_module c:/SoftwareSystems/PHP/php5apache2.dll |
The AddType directive defines the extension of the files that Apache will process as PHP scripts. Example:
AddType application/x-httpd-php .php |
This directive will cause all files with the .php extension to be process as PHP scripts.
These additions to the configuration file can be made only after PHP is installed because upon starting, Apache will attempt to load the php5apache2.dll. If it is not there, the starting will fail.
Just after php5apache2.dll, Apache attempts to load the php5ts.dll module. The latter must be in a directory where Apache can find it. In PHP 5, it is readily in the same directory as php5apache2.dll where Apache will first look for it, so you do not have anything to do.
Remarks
You may want to install a 1.x version of Apache instead of version 2, and PHP 4 or PHP 3 instead of PHP 5. In this case, in the replace php5_module php and php5apache2.dll with phpx_module and phpxapache.dll, where:
- x is the PHP version number
- apache is used instead of apache2
With these version of PHP you have to check where phpxts.dll is, and move or copy it to the directory that contains phpxapache.dll.
The .php suffix defined in the AddType directive is the usual extension for PHP scripts, but it is not mandatory. You can use another suffix to hide PHP scripts from unwanted intruders. Also, more than one suffix can be defined. For example:
AddType application/x-httpd-php .php .pph .xxx |