- Stable, reliable, fastest web server ever.
- Support widely programming languages and scripting languages, php, and cgi etc and many in built modules provided by apache group.
- Secure, SSL (secure sockets layer) feature available.
- Virtual hosting for many websites run on single IP Address.
- Load balancing support with the help of modules. E.g. mod_jk, connectors or ports
- Java tomcat support with the help of connector modules.
- Apache’s full source code available can further develop and modify according to user’s requirement.
- Custom API available for further advance feature.
- Access control through .htaccess file and many user permission facilities.
- IP addresses restrictions.
More apache features
Compiling and Installing Apache
Apache is available in source code and binary form from apache’s website. Most of the time people use binary form for installation. We use binary form for apache installation.
Download apache from http://httpd.apache.org/download.cgi for windows apache_2.0.55-win32-x86-no_ssl.msi download this file. Or for linux download tar or RPM file. Apache installation on Linux needs a little different configuration.
First select file
Double click on executable file
Accept license agreement of apache.
Put network Domain as your website or domain name. e.g localhost and email ID of administrator.
Click on next select typical mode.
Define apache installation path where should apache install.
wait for installation to complete
Now apache is installed sucessfully.
Configuring apache is done through httpd.conf file.
“C:\Program Files\Apache Group\Apache2\conf”. Httpd.conf is main file where we can configure apache and customize our setting. We can make virtual Hosting, change apache’s default port number, Naming server, load balancing, connecting with server with the help of connector and modules.
This file looks like this
# Based upon the NCSA server configuration files originally by Rob McCool.
# This is the main Apache server configuration file. It contains the
# configuration directives that give the server its instructions.
# See <URL:http://httpd.apache.org/docs-2.0/> for detailed information about
# the directives.
# Do NOT simply read the instructions in here without understanding
# what they do. They're here only as hints or reminders. If you are unsure
# consult the online docs. You have been warned.
# The configuration directives are grouped into three basic sections:
# 1. Directives that control the operation of the Apache server process as a
# whole (the 'global environment').
# 2. Directives that define the parameters of the 'main' or 'default' server,
# which responds to requests that aren't handled by a virtual host.
# These directives also provide default values for the settings
# of all virtual hosts.
# 3. Settings for virtual hosts, which allow Web requests to be sent to
# different IP addresses or hostnames and have them handled by the
# same Apache server process.
# Configuration and logfile names: If the filenames you specify for many
# of the server's control files begin with "/" (or "drive:/" for Win32), the
# server will use that explicit path. If the filenames do *not* begin
# with "/", the value of ServerRoot is prepended -- so "logs/foo.log"
# with ServerRoot set to "E:/apache/Apache2" will be interpreted by the
# server as "E:/apache/Apache2/logs/foo.log".
# NOTE: Where filenames are specified, you must use forward slashes
# instead of backslashes (e.g., "c:/apache" instead of "c:\apache").
# If a drive letter is omitted, the drive on which Apache.exe is located
# will be used by default. It is recommended that you always supply
# an explicit drive letter in absolute paths, however, to avoid
Set default User connections, binding Addesses, install modules load module,
Add modules for php
LoadModule php5_module "C:\php\php5apache2.dll"
AddType application/x-httpd-php .php
Can change it to any other port
Can change default document root directory by changing this path
<Directory "C:\Program Files\Apache Group\Apache2\htdocs">
Set customized error file in apache
#ErrorDocument 500 "The server made a boo boo."
#ErrorDocument 404 /missing.html
#ErrorDocument 404 "/cgi-bin/missing_handler.pl"
#ErrorDocument 402 http://www.example.com/subscription_info.html
Uncommented this one and add error file.
Virtual Hosts in apache
Setting for virtual hosting
# ServerAdmin email@example.com
# DocumentRoot /www/docs/dummy-host.example.com
# ServerName dummy-host.example.com
# ErrorLog logs/dummy-host.example.com-error_log
# CustomLog logs/dummy-host.example.com-access_log common
Uncommented this block and
Put name according to your requirements.
Finally save this httpd.conf file and restart apache.
Apache can be restarted, Windows it is easy way, go to tools
this tool is placed in startup menu bar right of bottom. apache stoping starting Apache
Right click on this tool. A popup come
Go open Apache monitor option.
Now select Apache2 and Restart it. We can stop and start services from this tool.
Finally time to deploy any application or html file in apache. We need to copy any html file in
C:\Program Files\Apache Group\Apache2\htdocs directory.
Now open this file in web browser by entering this path