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 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 \
–enable-mime-magic
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 admin@example.com
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

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. 10.10.10.1)
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:
namevirtualhost 10.10.10.1:80
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:
namevirtualhost 10.10.10.1:80
serveralias www.eukhost.com
serveradmin webmaster@eukhost.com
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 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