
Apache is the Web Server most frequently used on the Internet today. This tutorial covers its installation and and configuration in Windows NT. You should download Apache for free and then install and configure it. There is another tutorial for Apache in Linux.
Go to the Apache Win32 download directory. You will need to download two pieces of software in a temporary directory. The first is the new Microsoft MSI package installer (MSIEXEC) instmsi.exe, standard in Windows Me and 2000, recently made available by Microsoft for Windows NT and 95/98. The second is the file apache 1.3.x.x-win32-xxxx.msi file with the apache server packaged to be installed with MSIEXEC. Run the instmsi.exe file to install MSIEXEC. Once MSIEXEC is installed then double-click on the 1.3.x.x-win32-xxxx.msi file. Install apache in C:\Apache instead of the default in Program Files. During the installation you will be asked for a server name (you can enter localhost, or an IP number, or yet a FQDN), and a domain name -- use the domain of your provider. Note: be sure you have Perl downloaded and installed before you install Apache, if you intend to use Perl to write CGI scripts.
The package will automatically create all the directories for you besides installing the software. The document root will be in c:/Apache/Apache/htdocs. The server root will be located in c:/Apache/Apache. The path to the apache program is C:/Apache/Apache/Apache.exe, but in NT it runs as a service, which is also automatically installed.
In addition a variety of directories are created: cgi-bin, htdocs, icons, include, lib, libexec, etc. In the htdocs directory you will store the Web pages for your server. In the cgi-bin directory you will store your CGI programs.
In the server root three directories are created: conf, logs and modules. In the conf directory you will find the three basic Apache configuration files: httpd.conf, access.conf and srm.conf. In the logs directory you will find the access and error logs. The modules directory is where the Apache modules are resident.
You need to configure (change) the C:/Apache/Apache/conf/httpd.conf file. The other two configuration files are considered obsolete and should not be changed.
Find first the line #BindAddress * and delete the # (uncomment it) to make it active. Find the line ServerAdmin and enter your e-mail address, and look for the line ServerName and enter the FQDN, or IP number of your machine, or yet localhost. The server comes configured to run in standalone mode, to listen in port 80, and you don't need to change these options. If you installed Apache in C:/Apache the document root directory is written by default in the line
DocumentRoot "c:/Apache/Apache/htdocs"
Look for the section that starts with <Directory "c:/Apache/Apache/htdocs"> and look for the Options line and change it to allow Server Side Includes, but disabling scripts to be run from a Web page, as follows: Options Indexes Includes FollowSymLinks IncludesNOEXEC. This will allow the dynamic dating of your changes, the dynamic display of time and date in your pages, but will prevent scripts to be run outside of your cgi-bin directory. For example, the HTML code <!--#config timefmt="%A %B %d, %Y -- %I:%M %p " --><!--#echo var="DATE_LOCAL"-->
You may want to change the order of your index files, making index.shtml (the SSI version) to be the first to be displayed by the browsers. In order to do so, look for the line DirectoryIndex and change it to DirectoryIndex index.shtml index.html index.htm
Look for the line #ScriptInterpreterSource registry and remove the # (uncomment it). This will allow scripts written in different languages to use their extention associations in Windows. For example, hello.pl would be associated with Perl. In case you wish to keep it commented -- do not use associations, then the first line of a script would be like in Linux/Unix -- a shebang line as follows:
#!c:/Perl/bin/Perl.exe
Check that your cgi-bin directory is properly identified as follows: ScriptAlias /cgi-bin/ "C:/Apache/Apache/cgi-bin/" . If you moved your document root path change this line accordingly.
Look for the line starting with # AddHandler. If you want your CGI script files to be identified with .cgi be sure that the line AddHandler cgi-script .cgi is not commented out (marked with in # in front). To complete the installation of server side includes be sure that the following two lines are present and uncommented (without the # in front):
Finally, to make your Web server support image maps be sure that the following line exists: AddHandler imap-file map
Apache runs as a service in Windows NT, therefore you can start, stop and restart the Apache Web server using the Services applet in the Windows NT Control Panel.