Apache Installation

Apache Installation

Apache is one of the most popular web server. Due to its unique features it is very extensible and useful for many different types of Web sites. Also called as Apache httpd it is a powerful & flexible web server.

This unique article will discuss Apache installation on a Linux system. The installation is easy. It just needs some basic knowledge of Linux. You at least comfortable working in Linux – changing directories, using tar and gunzip, and compiling with make You should also have access to the root account on the web hosting server.

Here we are installing Apache version 1.3.37

1) SSH to your server as root & download Apache 1.3.37 source from Apache httpd server website, http://httpd.apache.org/

# cd /usr/local/src
# wget http://httpd.apache.org/download.cgi

2) Extract the tar file.

# tar -zxvf apache1.3.tar.gz
# cd apache1.3

3) Now configure the source tree. We are installing apache at /usr/local/apache. Following will create a make file.

# ./configure –prefix=/usr/local/apache \
–enable-so \
–enable-cgi \
–enable-info \
–enable-rewrite \
–enable-speling \
–enable-usertrack \
–enable-deflate \
–enable-ssl \

You may only enable ‘-so‘. More information regarding the other options, you can try ./configure –help

4) Now make Apache from the above make file.

# make

5) If make is successfull & goes without any error , install Apache

# make install

Setting up Apache server.

1) With the above installation of apache the apache conf file is created at /usr/local/apache/conf/httpd.conf

1) If you want to run Apache on a different port to the default (80) then then change the number on line 280. Ports less than 1023 will require Apache to be started as root. Port 80 is probably the easiest to use since all other ports have to be specified explicitly in the web browser, eg: http://localhost:81.

Port 80

2) You may want to change the server admin email address on line 313:

ServerAdmin [email protected]

3) Specify your machine name on line 331, you may just have to remove the # comment marker. If you configure virtual hosts as outlined below then Apache will use the virtual server you name here as the default documents for the site.

ServerName www.example.com

4) You should set the document root on line 338:

DocumentRoot /usr/local/apache/htdocs

5) And on line 363:


This should be changed to whatever you set DocumentRoot to.

6) The default file to serve in directories is index.html. You can change this or add new file names (in order or importance) on line 414.

DirectoryIndex index.html index.htm index.php

7) If you don’t get a large number of hits and you want to know where your visitors are from then turn host name look ups on at line 511. Turning this on does place extra load on your server as it has to look up the host name corresponding to the IP address of all your visitors.

HostnameLookups On

8) Apache Errorlog on line 520:

ErrorLog /usr/local/apache/logs/error_log

Setting Up Virtual Hosts:

1) Virtual Hosts in Apache enables the single Apache server to serve different web pages for different domains. Through Virtual Hosts we can configure how Apache should handle requests to each domain.

When any site or domain is browsed in a web browser, the browser sends the hostname of the server that it is connecting to, to the web server. All the HTTP request that come to the server (on the ports it was told to listen to) are caught by Apache. It checks the host name included in the request and uses that to determine the virtual host configuration it should utilize.

2) Whena request is received by Apache, it get following details:

Hostname: The domain name (eg. eukhost.com)
IP address: (eg.
Port: (eg. 80)

During Apache configuration, we should mention each IP address and port combination for which we will be specifying virtual host domains, in the configuration file. So we should add the NameVirtualHost entry in the httpd.conf file:


Please make sure the ipaddress that you use is configured on your machine.

3) Each virtual host will have its own directory for the web pages to be stored. This can be anywhere that the Apache web server has permission to read. For example, on a cPanel server the web pages are located at /home/username/public_html.
Now If we set a domain eukhost.com on the, its VirtualHost entry will be:


ServerAlias www.eukhost.com
ServerAdmin [email protected]
DocumentRoot /home/euk/public_html/
ServerName tmcnetwork.bayker.com
BytesLog domlogs/eukhost.com-bytes_log
CustomLog /usr/local/apache/domlogs/tmcnetwork.bayker.com combined

Running Apache:

1) apachectl is the easiest way to start and stop your web hosting server manually.

# cd /usr/local/apache/bin
# ./apachectl start

2) You can also copy the file /usr/local/apache/bin/httpd to /etc/init.d/ from where your can stop & start apache.

# /etc/init.d/httpd stop
# /etc/init.d/httpd start

Related Articles on Apache :-
Apache Main Server Configuration
Features of Apache HTTP Server 2.0
Apache Global Environment Configuration
Apache Virtual Hosts Configuration
Securing Apache / http server
Apache Installation

Latest posts by Sam (see all)



  1. Arunkumar

    i am final year studend of mca.i am install php5 and apache1.3 web server.first copy php.ini into windows folder and php5ts.dll copy into system32 folder
    set my doc root and extension dir root in ini file.
    next configure the httpd.conf file like doc root and etc..
    upend addmodule statement from install.txt to httpd.conf file
    after i restart my system
    but apache does not run .just blink the apache screen.
    i check all the path.but i can’t do .
    please give a solution


Leave your comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.