Apache helps in the keen growth of the world
wide web.The majority of web servers using
Apache run a Unix-like operating system.As of
February 2010[update] Apache served over
54.46% of all websites and over 66% of the
Apache supports a variety of features, many
implemented as compiled modules which
extend the core functionality. These can range
from server-side programming language
support to authentication schemes. Some
common language interfaces support Perl,
Python, Tcl, and PHP
Although the main design goal of Apache is not
to be the "fastest" web server, Apache does
have performance comparable to other "high-
performance" web servers
Apache is primarily used to serve both static
content and dynamic Web pages on the World
Wide Web. Many web applications are
designed expecting the environment and
features that Apache provides
Step 1: We need to have the xampp for linux
inorder the run applications
so(as per step 1) ,download the xampp for linux
with any favourable version on to the
INSTALLING APACHE IN
Step 2: After the successful downloading,we
need to extract the 'tar' file on to the
system,select a path and just extract them using
the following commands
gunzip -d httpd-2_0_NN.tar.gz
tar xvf httpd-2_0_NN.tar
*NN -refers to the current xampp version
Inorder to configure the ,we need to locate the
xampp folder to which it is extracted.
After the location of these file we can
find the configure file in the 'etc' folder as
“httpd.config”,inside which we can find the
“configuration file main Apache HTTP server configuration .
It contains the
configuration directives that give the server its instructions”
ServerRoot: The top of the directory tree under which the
configuration, error, and log files are kept
Listen: Allows you to bind Apache to specific IP addresses
and/or ports, instead of the default.
Inside which we can fine the
various server details,they are:
User/Group: The name (or #number) of the user/group to
run httpd as it is usually good practice to create a dedicated
user and group for running httpd, as with most system
ServerAdmin: Your address, where problems with the
server should be e-mailed. This address appears on some
server-generated pages, such as error documents.
ServerName gives the name and port that the server uses
to identify itself.This can often be determined automatically,
but we recommend you specifyit explicitly to prevent
problems during startup.If your host doesn't have a
registered DNS name, enter its IP address in it.
DocumentRoot: The directory out of which you will serve
your documents. By default, all requests are taken from this
directory, but symbolic links and aliases may be used to
point to other locations.
Each directory to which Apache has access can be
configured with respect to which services and features are
allowed and/or disabled in that directory (and its
First, we configure the "default" to be a very restrictive set of
#Deny from all
DirectoryIndex sets the file that Apache will serve if a
directory is requested.
DirectoryIndex index.html index.html.var index.php
The following lines prevent .htaccess and .htpasswd files
from being viewed by Web clients.
Deny from all
ErrorLog: The location of the error log file.
# If you do not specify an ErrorLog directive within a
# container, error messages relating to that virtual host will be
# logged here. If you *do* define an error logfile for a
# container, that host's errors will be logged there and not here.
Redirect: Allows you to tell clients about documents that used to
exist in your server's namespace, but do not anymore. The client
will make a new request for the document at its new location.
Redirect permanent /foo http://www.example.com/bar
Alias: Maps web paths into filesystem paths and is used to
access content that does not live under the
Example: Alias /webpath /full/filesystem/path
ScriptAlias: This controls which directories contain server
scripts.ScriptAliases are essentially the same as Aliases,
except thatdocuments in the target directory are treated as
applications and run by the server when requested rather
than as documents sent to the client. The same rules
about trailing "/" apply to ScriptAliasdirectives as to Alias.
ScriptAlias /cgi-bin/ "/opt/lampp/cgi-bin/"
Supplemental configuration:The configuration files in the
etc/extra/ directory can be included to add extra features or
to modify the default configuration of the server, or you
may simply copy their contents here and change as
Server-pool management (MPM specific)
User home directories
Real-time info on requests and configuration
Local access to the Apache HTTP Server Manual
Distributed authoring and versioning (WebDAV)
Various default settings
Managing one site on a Web server can be tough enough, and the job is even harder if you
have to host multiple client sites on a badly configured setup. If you're running Apache,
you can make things easier by setting up virtual hosts, which let you control multiple
domains on one IP address, allowing you to specify URLs like
http://clientsdomain.com/file_name.html instead of
http://yoursite.com/hosted/clients_directory/file_name.html, and letting you forgo
setting up domain forwarding with a /srv/www/htdocs/hosted/clients_directory file.
If Apache is installed correctly, you can set up virtual hosting easily by editing Apache
configuration files. The main .conf files in /etc/apache2 include httpd.conf, error.conf,
server-tuning.conf, and a bunch more. These files are set for read-only access for
normal users; you must gain root access with the sudo or su command to change
Edit /etc/apache2/httpd.conf and find this line:
Replace it with a line that specifies a .conf file we will create and call vhost.conf:
SETTING VIRTUAL HOSTING
When you've made the change, save the file. Now, again
as root, create the vhost.conf by renaming the
vhost.template file in /vhosts.d/:
mv vhost.template vhost.conf
Now edit the file to set it to allow multiple name-based Web
sites on a single IP address. First add in the virtual host
directive with NamevirtualHost *. The asterisk is a wild card
character that allows any address to be set. Under that
directive you can add your first virtual host:
ServerAlias yourdomain.com *.yourdomain.com
The first part is the opening tag for the defined virutal host block.
ServerAdmin lets you display the administrator email address when an error
such as a 404 occurs. DocumentRoot is the root directory for the defined site;
for example, sites I have hosted in the past all had accounts set up within
/srv/www/htdocs/hosted/sitename/. Next is the ServerAlias or ServerName,
which controls what names people can use to see and access a site. You
could set this to a directory within the main NameVirtualHost or the domain of
the site so the server can display the content associated with the domain
name. The reason for the two ServerAlias entries above is that servers are
often called from more than one ServerName, so you set up a ServerAlias
with more than one address listed. The wild card allows for any domain
request with anything in front of .yourdomain.com.
A particular slide catching your eye?
Clipping is a handy way to collect important slides you want to go back to later.