• No results found

Installing Apache Web Server on Windows

In document Hack Proofing Your E Commerce Site pdf (Page 180-191)

Like the source code files on Apache’s Web site, binary executables are also available for download. After downloading these files, you begin the installation process by double-clicking on the executable.This will unpack the installation files and start the Setup Wizard.

1. The first screen of the wizard welcomes you to the setup pro- cess. It warns that you should exit any other applications.To

quit the installation, you can click the Cancel button from this

or any other screen in the wizard. Click the Nextbutton to

continue.

2. The screen that follows provides a licensing agreement, which you must agree with to continue through the installation pro-

cess. If you click the No button, the installation process stops

here, and the Setup Wizard shuts down. Clicking the Yesbutton

allows you to continue.

3. The next screen is the Choose Destination Location screen, which allows you to specify where the Web server will be

installed.You can accept the default location and click Next to

continue, or you can use the Browsebutton to specify another

location. If you click the Browsebutton, a window appears

allowing you to browse your hard disk and select a folder in

which to install Apache. Clicking OKreturns you to the previous

screen, where you can click Next to move to the next screen.

4. The Setup Type screen follows, allowing you to select how Apache is to be installed.You have three options on this screen:

Typical,Compact, and Custom.Typicalinstalls Apache Web server with the most common components, and should be used

by most users of the software.Compactinstalls the minimum

components required by Apache Web server to run.This should

be used if you have limited hard disk space. Finally,Custom

allows you to choose what options will be installed.You select

which Setup Type to use by clicking on the radio button beside

the option. Clicking Next begins this method of installation.

5. If you choose Custom and click Next, then a screen appears

allowing you to select which components will be installed (see Figure 3.1).There are five components that can be installed:

Web Server Application Files, which are the basic files

Web Server Source Code, which are source code files for

the Apache Web server and its support tools. If you don’t require these for development purposes, you can deselect this component.

Web Server Manual, which is documentation for the

Apache Web server.This is useful for administration of the server.

Web Server Additional Modules, which are additional

modules that can be used to extend the server’s functionality.

Web Server Icons, which are icons used for Web server

directory indexes.

After you’ve selected the components you want installed, click Next to proceed to the next screen.

6. The Select Program Folder screen is what you see next.This allows you to select the folder in which the icons will be placed, which will be used to launch Apache Web server and other utilities. By default, this is named Apache, but you can

enter a different name for the folder if you prefer. Click Next

to begin installing the selected components and for the wizard to perform basic configuration of your system.

Figure 3.1Select Components Screen for the Apache Web

7. After the configuration is completed, you see the Setup Complete screen.This screen has a checkbox offering the chance to view a Readme file. If you don’t want to read this

file, click on the checkbox to uncheck it and then click Finish.

After you’ve completed the installation, a new folder appears under the Programs folder of your Start menu.This folder is called Apache Web Server, and it contains folders and icons for using Apache.

8. After installation is complete, you then need to configure Apache Web Server for use. Configuration files for this are found in the CONF directory of where the server was installed.

Here there is a file called httpd.conf, where you configure

directives used by the server.The http.conf file is the main

configuration file for Apache server, and it contains directives that instruct Apache how to perform.The directives in this file are broken into three sections:

Global Environment, which controls the Apache’s envi-

ronment and determines how it will run.

‘Main’ Server Configuration, which sets the parameters

for the default server and provides default values for virtual servers.

Virtual Hosts, which determines the setting for virtual

servers.

These directives are shown in Table 3.5 and are used to con- figure Apache Server.

Table 3.5Listing of Directives Used to Configure Apache Web Server

Directive Section of HTTP.CONF Description

ServerType Global Environment Determines whether the server is standalone or inetd. The Inetd mode is only available for servers running on a UNIX platform.

ServerRoot Global Environment This is the root of the “<pathname>” directory tree. Under

this root directory, the configuration, error and log files are kept. By default, it is the directory in which Apache was installed. PidFile Global Environment Used to specify the file

in which Apache records its process identification number at startup. ScoreBoardFile Global Environment Used to specify the file

used to store internal process information. ResourceConfig Global Environment Used to specify the

processing of the resource configuration file. By default, this option is commented out and has the value of conf/srm.conf.

AccessConfig Global Environment Used to specify the pro- cessing of the access configuration file. By default, this option is commented out and has the value of

conf/access.conf.

Timeout Global Environment Specifies the number of seconds before a request times out. By default, it is set to 300. KeepAlive Global Environment Specifies whether more

than one request per connection is allowed. By default, it is set as “On.”

Table 3.5Continued

Directive Section of HTTP.CONF Description

MaxKeepAliveRequests Global Environment Specifies the maximum number of requests to allow in a persistent connection. By default, it is set to 100. To allow unlimited requests, it should be set to 0. KeepAliveTimeout Global Environment Specifies the number of

seconds to wait for a client to send the next request. By default, it is set to 15.

MaxRequestsPerChild Global Environment This specifies the number of requests a child process can pro- cess before it dies. By default, it is set to 0 for unlimited.

ThreadsPerChild Global Environment Specifies the number of concurrent requests the server will allow. By default, it is set to 50. Listen Global Environment Used to bind Apache to

other IP addresses and/or ports. By default, this option is com- mented out.

BindAddress Global Environment Used to specify the IP address to listen to. By default, this option is commented out.

ExtendedStatus Global Environment Specifies whether full or basic status information will be generated. By default, it is set to OFF to generate basic information.

Table 3.5Continued

Directive Section of HTTP.CONF Description

Port ‘Main’ server Specifies the port that a configuration standalone server will

listen to. By default, it is set to 80.

ServerAdmin ‘Main’ server Specifies the e-mail configuration address that will appear

on error documents and other server-generated pages.

ServerName ‘Main’ server Specifies the registered configuration DNS name that will

be returned to clients (such as

www.microsolved.com). DocumentRoot ‘Main’ server Specifies the directory

<pathname> configuration that will store docu- ments provided to users of your server.

AllowOverride ‘Main’ server Specifies options the configuration .htaccess files in Apache

can override. This can be set to NONE, ALL, or a combination of dif- ferent options. By default, it is set that none of the options can be overridden.

Order allow,deny ‘Main’ server Specifies who can Allow from all configuration access the server. </Directory>

UserDir ‘Main’ server Specifies the directory configuration that is appended to a

user’s home directory. This option is applied only if a ~user request is received by Apache. By default, it is set to the USERS directory in which Apache was installed.

Table 3.5Continued

DirectoryIndex ‘Main’ server Specifies the default configuration HTML document that is

served when a user accesses a directory on the site. By default, it is set to index.html.

AccessFileName ‘Main’ server Specifies the file used by configuration Apache to retrieve

access control informa- tion for each directory. By default, it is

.htaccess.

CacheNegotiatedDocs ‘Main’ server Specifies whether configuration Apache will request

documents to be cached by proxy servers. By default, documents are not cached.

UseCanonicalName ‘Main’ server Specifies whether configuration Apache will use a client-

supplied port or a URL that refers back to the server that a response came from. By default, it is set to use the ServerName and Port to form the canonical name.

TypesConfig ‘Main’ server Specifies where the configuration mime.types file resides

on the server. By default, it is set to the mime.types file located in the CONF directory in which Apache was installed.

Table 3.5Continued

Directive Section of HTTP.CONF Description

DefaultType ‘Main’ server Specifies the default configuration MIME type used for

documents. By default, it is set to text/plain (for textual or HTML docu- ments). If applications or images are com- monly sent, then set this to application/ octet-stream.

MIMEMagicFile ‘Main’ server Specifies the file that configuration Apache uses to gather

information on file types. By default, it is located in the magic file in the CONF directory in which Apache was installed.

HostnameLookups ‘Main’ server Specifies whether the configuration names of clients or just

their IP addresses are logged. By default, it is set to OFF to specify that only IP addresses are logged.

ErrorLog ‘Main’ server Specifies the location of configuration the error log file. By

default, errors will be logged to the error.log file located in the LOGS directory in which Apache was installed. LogLevel ‘Main’ server Specifies the number of

configuration messages that will be logged to the error.log file.

Table 3.5Continued

Directive Section of HTTP.CONF Description

CustomLog ‘Main’ server Specifies the location configuration and format of the

access log. By default, it is the access.log found in the LOGS directory in which Apache was installed.

ServerSignature ‘Main’ server Specifies whether the configuration version of the server

and name of the virtual host should be added to any server-generated pages. By default, it is set to ON. Other options can be OFF or EMAIL (to also add the e-mail address specified in the ServerAdmin directive).

ScriptInterpreterSource ‘Main’ server Enables Windows- configuration specific behavior. By

default, it is commented out to have Unix-specific behavior enabled.

Alias ‘Main’ server Specifies aliases. configuration

ScriptAlias ‘Main’ server Specifies the directories configuration containing scripts.

ScriptAliases ‘Main’ server Specifies aliases of items configuration to be treated as

applications.

DefaultIcon ‘Main’ server Specifies the icon to dis- configuration play when a file doesn’t

have an icon explicitly set for it.

AddDescription ‘Main’ server Specifies a short

configuration description after a file in server-generated

indexes.

Table 3.5Continued

Directive Section of HTTP.CONF Description

IndexIgnore ‘Main’ server Specifies filenames that configuration directory indexing

should ignore and not include in a listing. AddEncoding ‘Main’ server Used to allow browsers

configuration to uncompress informa- tion automatically. AddLanguage ‘Main’ server Specifies the language

configuration of a document.

LanguagePriority ‘Main’ server Used to set priorities of configuration some languages over

others.

Action ‘Main’ server Specifies the media type configuration that will execute a script when a matching file is called.

MetaDir ‘Main’ server Specifies the directory configuration containing meta infor-

mation files.

MetaSuffix ‘Main’ server Specifies the name configuration suffix for files con-

taining meta information.

VirtualHost Virtual Hosts Specifies VirtualHost containers for sites containing multiple domains or hostnames.

For example, search for the ServerAdmin directive and change the value beside it to the e-mail address that belongs to the administrator of the Web server. Search for the ServerName directive and change the value beside it to the registered DNS name for your Web site. Search for the HostNameLookups directive and change the value beside it to ON.This enables logging of client names as well as their IP addresses. Search for

Table 3.5Continued

the ServerSignature directive and change the value beside it to EMAIL.This adds the e-mail address you specified in

ServerAdmin to server-generated pages.

9. Save the httpd.conffile and exit the text editor.

In document Hack Proofing Your E Commerce Site pdf (Page 180-191)