Top Banner
APACHE INSTALLATION,CONFIGERATION AND SETUP BY, NIRMAL FELIX.K.
20
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Apache

APACHE INSTALLATION,CONFIGERATION AND SETUP

BY,

NIRMAL FELIX.K.

Page 2: Apache

INTRODUCTION:

Apache is one of the most popular Web servers on the Web right now, and part of its charm is that it's free. It also has a lot of features that make it very extensible and useful for many different types of Web sites. It is a server that is used for personal Web pages up to enterprise level sites.

This article will discuss how to install Apache on a Linux system. Before we start you should be at least comfortable working in Linux - changing directories, using tar and gunzip, and compiling with make (I'll discuss where to get binaries if you don't want to mess with compiling your own). You should also have access to the root account on the server machine.

Page 3: Apache

Download Apache

I recommend downloading the latest stable release. At the time of this writing, that was Apache 2.0. The best place to get Apache is from the Apache HTTP Server download site. Download the sources appropriate to your system. Binary releases are available as well.

Extract the Files

Once you've downloaded the files you need to uncompress them and untarring: gunzip -d httpd-2_0_NN.tar.gz tar xvf httpd-2_0_NN.tarThis creates a new directory under the current directory with the source files.

Page 4: Apache

Configuring

Once you've got the files, you need to tell your machine where to find everything by configuring the source files. The easiest way is to accept all the defaults and just type: ./configure

Of course, most people don't want to accept just the default choices. The most important option is the prefix= option. This specifies the directory where the Apache files will be installed. You can also set specific environment variables and modules. Some of the modules I like to have installed are:

* mod_alias - to map different parts of the URL tree * mod_include - to parse Server Side Includes * mod_mime - to associate file extensions with its MIME-type * mod_rewrite - to rewrite URLs on the fly * mod_speling (sic) - to help your readers who might misspell URLs * mod_ssl - to allow for strong cryptography using SSL * mod_userdir - to allow system users to have their own Web page directories

Page 5: Apache

Build

As with any source installation, you'll then need to build the installation: make make install

Customize

Assuming that there were no problems, you are ready to customize your Apache configuration. This really just amounts to editing the httpd.conf file. This file is located in the PREFIX/conf directory. I generally edit it with vi: vi PREFIX/conf/httpd.confNote: you'll need to be root to edit this file.

Follow the instructions in this file to edit your configuration the way you want it. More help is available on the Apache Web site.Test Your Server

Open a Web browser on the same machine and type http://localhost/ in the address box. You should see a page similar to the one in the partial screen shot above. Specifically, it will say in big letters "Seeing this instead of the website you expected?" This is good news, as it means your server installed correctly.

Page 6: Apache

1.AcceptFilter directive

Syntax: AcceptFilter on|off

Default: AcceptFilter on

Context: server config

Status: core

Compatibility: AcceptFilter is available in Apache 1.3.22 and later

AcceptFilter controls a BSD specific filter optimization

Page 7: Apache

2.AcceptMutex directive

AcceptMutex directive

Syntax: AcceptMutex uslock|pthread|sysvsem|fcntl|flock|os2sem|tpfcore|none|default

Default: AcceptMutex default

Context: server config

Status: core

Compatibility: AcceptMutex is available in Apache 1.3.21 and later.

AcceptMutex controls which accept() mutex method Apache will us

Page 8: Apache

3.AccessConfig directiveSyntax: AccessConfig file-path|directory-path|wildcard-path

Default: AccessConfig conf/access.conf

Context: server config, virtual host

Status: core

Compatibility: The ability to specify a directory, rather than a file name, is only available in Apache 1.3.13 and later. This directive will be eliminated in version 2.0.

This feature can be disabled using: AccessConfig /dev/null Or, on Win32 servers,

Page 9: Apache

4.AddDefaultCharset directiveSyntax: AddDefaultCharset On|Off|charset

Context: allStatus: core

Default: AddDefaultCharset OffCompatibility: AddDefaultCharset is only available in Apache 1.3.12 and later

AddDefaultCharset On enables Apache's internal default charset of iso-8859-1 as required by the directive. You can also specify an alternate charset to be used.

For example: AddDefaultCharset utf-8

Page 10: Apache

5.AddModule directive

Syntax: AddModule module [module] ...Context: server config

Status: coreCompatibility: AddModule is only available in Apache 1.2 and later

For example: AddModule mod_include.c

Page 11: Apache

6.AllowOverride directive

Syntax: AllowOverride All|None|directive-type [directive-type] ...Default: AllowOverride All

Context: directoryStatus: core

AllowOverride is only valid in <Directory> sections, not in <Location> or <Files> sections, as implied by the Context section above

Page 12: Apache

7.AuthName directiveAuthName directive

Syntax: AuthName auth-domainContext: directory, .htaccess

Override: AuthConfigStatus: cor

sets the name of the authorization realm for a directory

It must be accompanied by AuthType and Require directives, and directives such as AuthUserFile and AuthGroupFile to work.

For example:

AuthName "Top Secret"

The string provided for the AuthName is what will appear in the password dialog provided by most browsers.

Page 13: Apache

8.AuthDigestRealmSeed directive

Syntax: AuthDigestRealmSeed secret-real-stringContext: directory, .htaccess

Override: AuthConfigStatus: core

sets a per realm secret nonce prefix which is used to ensure that a captured username, password and realm string during a Digest

exchange cannot be replayed at other places.

Page 14: Apache

9.AuthType directive

Syntax: AuthType Basic|DigestContext: directory, .htaccess

Override: AuthConfigStatus: core

This directive selects the type of user authentication for a directory. Only Basic and Digest are currently implemented. It must be

accompanied by AuthName and Require directives, and directives such as AuthUserFile and AuthGroupFile to work.

Page 15: Apache

10.CGICommandArgs directive

Syntax: CGICommandArgs On|Off

Default: CGICommandArgs On

Context: directory, .htaccess

Override: Options

Status: core

Compatibility: Available in Apache 1.3.24 and later.

Page 16: Apache

11.ClearModuleList directive

Syntax: ClearModuleList

Context: server config

Status: core

Compatibility: ClearModuleList is only available in Apache 1.2 and later.

This directive clears the list. It is assumed that the list will then be re-populated using the AddModule directive.

Page 17: Apache

12.ContentDigest directive

Syntax: ContentDigest on|off

Default: ContentDigest off

Context: server config, virtual host, directory, .htaccess

Override: Options

Status: experimental

Compatibility: ContentDigest is only available in Apache 1.1 and later

This directive enables the generation of Content-MD5 headers as defined in RFC1864 respectively RFC2068

Page 18: Apache

13.CoreDumpDirectory directive

Syntax: CoreDumpDirectory directory-path

Default: the same location as ServerRoot

Context: server config

Status: core

This controls the directory to which Apache attempts to switch before dumping core.

Page 19: Apache

14.DefaultType directive

Syntax: DefaultType MIME-type

Default: DefaultType text/plain

Context: server config, virtual host, directory, .htaccess

Override: FileInfo

Status: core

There will be times when the server is asked to provide a document whose type cannot be determined by its MIME types mappings.

The server must inform the client of the content-type of the document, so in the event of an unknown type it uses the DefaultType. For example:

DefaultType image/gif

Page 20: Apache

15.DirectoryMatch

<DirectoryMatch>

Syntax: <DirectoryMatch regex> ... </DirectoryMatch>

Context: server config, virtual host

Status: Core.

Compatibility: Available in Apache 1.3 and late

<DirectoryMatch> and </DirectoryMatch> are used to enclose a group of directives which will apply only to the named directory and sub-directories of that directory, the same as <Directory>. However, it takes as an argument a regular expression.

For example:

<DirectoryMatch "^/www/.*/[0-9]{3}">