SlideShare a Scribd company logo
APACHE INSTALLATION,CONFIGERATION AND SETUP BY, NIRMAL FELIX.K.
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.
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.tar This creates a new directory under the current directory with the source files.
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
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.conf Note: 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.
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
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
3.AccessConfig directive Syntax: 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,
4.AddDefaultCharset directive Syntax: AddDefaultCharset On|Off|charset Context: all Status: core Default: AddDefaultCharset Off Compatibility: 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
5.AddModule directive Syntax: AddModule module [module] ... Context: server config Status: core Compatibility: AddModule is only available in Apache 1.2 and later For example: AddModule mod_include.c
6.AllowOverride directive Syntax: AllowOverride All|None|directive-type [directive-type] ... Default: AllowOverride All Context: directory Status: core AllowOverride is only valid in <Directory> sections, not in <Location> or <Files> sections, as implied by the Context  section above
7.AuthName directive AuthName directive Syntax: AuthName auth-domain Context: directory, .htaccess Override: AuthConfig Status: 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 &quot;Top Secret&quot; The string provided for the AuthName is what will appear in the password  dialog provided by most browsers.
8.AuthDigestRealmSeed directive Syntax: AuthDigestRealmSeed secret-real-string Context: directory, .htaccess Override: AuthConfig Status: 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.
9.AuthType directive Syntax: AuthType Basic|Digest Context: directory, .htaccess Override: AuthConfig Status: 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.
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.
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.
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
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.
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
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 &quot;^/www/.*/[0-9]{3}&quot;>

More Related Content

Apache

  • 1. APACHE INSTALLATION,CONFIGERATION AND SETUP BY, NIRMAL FELIX.K.
  • 2. 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.
  • 3. 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.tar This creates a new directory under the current directory with the source files.
  • 4. 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
  • 5. 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.conf Note: 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 &quot;Seeing this instead of the website you expected?&quot; This is good news, as it means your server installed correctly.
  • 6. 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
  • 7. 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
  • 8. 3.AccessConfig directive Syntax: 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,
  • 9. 4.AddDefaultCharset directive Syntax: AddDefaultCharset On|Off|charset Context: all Status: core Default: AddDefaultCharset Off Compatibility: 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
  • 10. 5.AddModule directive Syntax: AddModule module [module] ... Context: server config Status: core Compatibility: AddModule is only available in Apache 1.2 and later For example: AddModule mod_include.c
  • 11. 6.AllowOverride directive Syntax: AllowOverride All|None|directive-type [directive-type] ... Default: AllowOverride All Context: directory Status: core AllowOverride is only valid in <Directory> sections, not in <Location> or <Files> sections, as implied by the Context section above
  • 12. 7.AuthName directive AuthName directive Syntax: AuthName auth-domain Context: directory, .htaccess Override: AuthConfig Status: 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 &quot;Top Secret&quot; The string provided for the AuthName is what will appear in the password dialog provided by most browsers.
  • 13. 8.AuthDigestRealmSeed directive Syntax: AuthDigestRealmSeed secret-real-string Context: directory, .htaccess Override: AuthConfig Status: 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.
  • 14. 9.AuthType directive Syntax: AuthType Basic|Digest Context: directory, .htaccess Override: AuthConfig Status: 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.
  • 15. 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.
  • 16. 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.
  • 17. 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
  • 18. 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.
  • 19. 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
  • 20. 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 &quot;^/www/.*/[0-9]{3}&quot;>