SlideShare a Scribd company logo
1 of 21
APACHE HTTP SERVER
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
million busiest
INTRODUCTION:
Features
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
PERFORMANCE
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
MAIN USE
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
computer
INSTALLING APACHE IN
LINUX:
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
CONFIGURATION
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
“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
server's
configuration, error, and log files are kept
ServerRoot "/opt/lampp"
Listen: Allows you to bind Apache to specific IP addresses
and/or ports, instead of the default.
Listen 12.34.56.78:80
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
services.
User nobody
Group nogroup
ServerAdmin: Your address, where problems with the
server should be e-mailed. This address appears on some
server-generated pages, such as error documents.
e.g. admin@your-domain.com
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.
ServerName www.example.com:80
ServerName localhost
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.
DocumentRoot "/opt/lampp/htdocs"
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
subdirectories).
First, we configure the "default" to be a very restrictive set of
features.
<Directory />
Options FollowSymLinks
AllowOverride None
#XAMPP
#Order deny,allow
#Deny from all
</Directory>
DirectoryIndex sets the file that Apache will serve if a
directory is requested.
<IfModule dir_module>
#DirectoryIndex index.html
# XAMPP
DirectoryIndex index.html index.html.var index.php
index.php3 index.php4
</IfModule>
-------------------------------------------------------------------------------
The following lines prevent .htaccess and .htpasswd files
from being viewed by Web clients.
<FilesMatch "^.ht">
Order allow,deny
Deny from all
</FilesMatch>
ErrorLog: The location of the error log file.
# If you do not specify an ErrorLog directive within a
<VirtualHost>
# container, error messages relating to that virtual host will be
# logged here. If you *do* define an error logfile for a
<VirtualHost>
# container, that host's errors will be logged there and not here.
#
ErrorLog logs/error_log
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.
Example:
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
DocumentRoot.
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
necessary.
Server-pool management (MPM specific)
Include etc/extra/httpd-mpm.conf
Language settings
Include etc/extra/httpd-language
User home directories
#Include etc/extra/httpd-userdir.conf
Real-time info on requests and configuration
Include etc/extra/httpd-info.conf
Virtual hosts
Include etc/extra/httpd-vhosts.conf
Local access to the Apache HTTP Server Manual
Include etc/extra/httpd-manual.conf
Distributed authoring and versioning (WebDAV)
Include etc/extra/httpd-dav.conf
Various default settings
Include etc/extra/httpd-default.conf
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
them.
Edit /etc/apache2/httpd.conf and find this line:
Include /etc/apache2/vhosts.d/*.conf
Replace it with a line that specifies a .conf file we will create and call vhost.conf:
Include /etc/apache2/vhosts.d/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:
NamevirtualHost *
<VirtualHost *>
ServerAdmin youremail@yoursite.com
DocumentRoot /srv/www/htdocs/directory_of_your_choice/
ServerAlias yourdomain.com *.yourdomain.com
<virtualHost>
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.

More Related Content

What's hot

Web servers – features, installation and configuration
Web servers – features, installation and configurationWeb servers – features, installation and configuration
Web servers – features, installation and configuration
webhostingguy
 
PHP
PHPPHP
Web browser architecture.87 to 88
Web browser architecture.87 to 88Web browser architecture.87 to 88
Web browser architecture.87 to 88
myrajendra
 

What's hot (20)

Squid
SquidSquid
Squid
 
Web server
Web serverWeb server
Web server
 
Web servers – features, installation and configuration
Web servers – features, installation and configurationWeb servers – features, installation and configuration
Web servers – features, installation and configuration
 
Linux Administration
Linux AdministrationLinux Administration
Linux Administration
 
Application layer protocols
Application layer protocolsApplication layer protocols
Application layer protocols
 
Distributed file system
Distributed file systemDistributed file system
Distributed file system
 
Iptables the Linux Firewall
Iptables the Linux Firewall Iptables the Linux Firewall
Iptables the Linux Firewall
 
Nfs
NfsNfs
Nfs
 
Introduction to Unix
Introduction to UnixIntroduction to Unix
Introduction to Unix
 
Samba server
Samba serverSamba server
Samba server
 
Application server
Application serverApplication server
Application server
 
PHP
PHPPHP
PHP
 
IIS
IISIIS
IIS
 
2. Distributed Systems Hardware & Software concepts
2. Distributed Systems Hardware & Software concepts2. Distributed Systems Hardware & Software concepts
2. Distributed Systems Hardware & Software concepts
 
Disk and File System Management in Linux
Disk and File System Management in LinuxDisk and File System Management in Linux
Disk and File System Management in Linux
 
Memory management
Memory managementMemory management
Memory management
 
Web browser architecture.87 to 88
Web browser architecture.87 to 88Web browser architecture.87 to 88
Web browser architecture.87 to 88
 
Server configuration
Server configurationServer configuration
Server configuration
 
Memory management
Memory managementMemory management
Memory management
 
Apache ppt
Apache pptApache ppt
Apache ppt
 

Viewers also liked

Learn PHP MySQL with Project
Learn PHP MySQL with ProjectLearn PHP MySQL with Project
Learn PHP MySQL with Project
ayman diab
 
Maria db the new mysql (Colin Charles)
Maria db the new mysql (Colin Charles)Maria db the new mysql (Colin Charles)
Maria db the new mysql (Colin Charles)
Ontico
 
Spear phishing attacks-by-hari_krishna
Spear phishing attacks-by-hari_krishnaSpear phishing attacks-by-hari_krishna
Spear phishing attacks-by-hari_krishna
Raghunath G
 
Introduction to xampp
Introduction to xamppIntroduction to xampp
Introduction to xampp
Jin Castor
 
Cybercrime.ppt
Cybercrime.pptCybercrime.ppt
Cybercrime.ppt
Aeman Khan
 

Viewers also liked (15)

Rafeeq Rehman - Breaking the Phishing Attack Chain
Rafeeq Rehman - Breaking the Phishing Attack ChainRafeeq Rehman - Breaking the Phishing Attack Chain
Rafeeq Rehman - Breaking the Phishing Attack Chain
 
Mysql
MysqlMysql
Mysql
 
Learn PHP MySQL with Project
Learn PHP MySQL with ProjectLearn PHP MySQL with Project
Learn PHP MySQL with Project
 
CYBER CRIME PRESENTATION PART 2 BY KRISHNAKNT ARUNKUMAR MISHRA
CYBER CRIME PRESENTATION PART 2 BY KRISHNAKNT ARUNKUMAR MISHRACYBER CRIME PRESENTATION PART 2 BY KRISHNAKNT ARUNKUMAR MISHRA
CYBER CRIME PRESENTATION PART 2 BY KRISHNAKNT ARUNKUMAR MISHRA
 
Maria db the new mysql (Colin Charles)
Maria db the new mysql (Colin Charles)Maria db the new mysql (Colin Charles)
Maria db the new mysql (Colin Charles)
 
CFMA Cyber Crime Presentation
CFMA Cyber Crime PresentationCFMA Cyber Crime Presentation
CFMA Cyber Crime Presentation
 
MySQL Backup & Recovery
MySQL Backup & RecoveryMySQL Backup & Recovery
MySQL Backup & Recovery
 
FBI Cybercrime Presentation
FBI Cybercrime PresentationFBI Cybercrime Presentation
FBI Cybercrime Presentation
 
Xampp Ppt
Xampp PptXampp Ppt
Xampp Ppt
 
Spear phishing attacks-by-hari_krishna
Spear phishing attacks-by-hari_krishnaSpear phishing attacks-by-hari_krishna
Spear phishing attacks-by-hari_krishna
 
Introduction to xampp
Introduction to xamppIntroduction to xampp
Introduction to xampp
 
Cybercrime.ppt
Cybercrime.pptCybercrime.ppt
Cybercrime.ppt
 
2015 Upload Campaigns Calendar - SlideShare
2015 Upload Campaigns Calendar - SlideShare2015 Upload Campaigns Calendar - SlideShare
2015 Upload Campaigns Calendar - SlideShare
 
What to Upload to SlideShare
What to Upload to SlideShareWhat to Upload to SlideShare
What to Upload to SlideShare
 
Getting Started With SlideShare
Getting Started With SlideShareGetting Started With SlideShare
Getting Started With SlideShare
 

Similar to Apache

Similar to Apache (20)

Apache Ppt
Apache PptApache Ppt
Apache Ppt
 
Apache - Quick reference guide
Apache - Quick reference guideApache - Quick reference guide
Apache - Quick reference guide
 
Apache
ApacheApache
Apache
 
Http
HttpHttp
Http
 
Apache HTTP Server
Apache HTTP ServerApache HTTP Server
Apache HTTP Server
 
Apache
ApacheApache
Apache
 
Configuration of Apache Web Server On CentOS 8
Configuration of Apache Web Server On CentOS 8Configuration of Apache Web Server On CentOS 8
Configuration of Apache Web Server On CentOS 8
 
Apache server configuration & optimization
Apache server configuration & optimizationApache server configuration & optimization
Apache server configuration & optimization
 
Apache installation and configurations
Apache installation and configurationsApache installation and configurations
Apache installation and configurations
 
Utosc2007_Apache_Configuration.ppt
Utosc2007_Apache_Configuration.pptUtosc2007_Apache_Configuration.ppt
Utosc2007_Apache_Configuration.ppt
 
Utosc2007_Apache_Configuration.ppt
Utosc2007_Apache_Configuration.pptUtosc2007_Apache_Configuration.ppt
Utosc2007_Apache_Configuration.ppt
 
Utosc2007_Apache_Configuration.ppt
Utosc2007_Apache_Configuration.pptUtosc2007_Apache_Configuration.ppt
Utosc2007_Apache_Configuration.ppt
 
Babitha.4appach
Babitha.4appachBabitha.4appach
Babitha.4appach
 
Babitha.4appach
Babitha.4appachBabitha.4appach
Babitha.4appach
 
Apache ppt
Apache pptApache ppt
Apache ppt
 
Linux Webserver Installation Command and GUI.ppt
Linux Webserver Installation Command and GUI.pptLinux Webserver Installation Command and GUI.ppt
Linux Webserver Installation Command and GUI.ppt
 
Linux Webserver Installation Command and GUI.ppt
Linux Webserver Installation Command and GUI.pptLinux Webserver Installation Command and GUI.ppt
Linux Webserver Installation Command and GUI.ppt
 
Apache
ApacheApache
Apache
 
Apache ppt
Apache pptApache ppt
Apache ppt
 
Linux apache installation
Linux apache installationLinux apache installation
Linux apache installation
 

More from Rathan Raj

Photochemical smog
Photochemical smogPhotochemical smog
Photochemical smog
Rathan Raj
 

More from Rathan Raj (8)

Database Normalization
Database NormalizationDatabase Normalization
Database Normalization
 
Photochemical smog
Photochemical smogPhotochemical smog
Photochemical smog
 
Web20
Web20Web20
Web20
 
Ajax
AjaxAjax
Ajax
 
Css
CssCss
Css
 
Html
HtmlHtml
Html
 
Linux
LinuxLinux
Linux
 
Php
PhpPhp
Php
 

Recently uploaded

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Recently uploaded (20)

Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 

Apache

  • 2. 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 million busiest INTRODUCTION:
  • 3. Features 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
  • 4. PERFORMANCE 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
  • 5. MAIN USE 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
  • 6. 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 computer INSTALLING APACHE IN LINUX:
  • 7. 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
  • 9. 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 “configuration file main Apache HTTP server configuration . It contains the configuration directives that give the server its instructions”
  • 10. ServerRoot: The top of the directory tree under which the server's configuration, error, and log files are kept ServerRoot "/opt/lampp" Listen: Allows you to bind Apache to specific IP addresses and/or ports, instead of the default. Listen 12.34.56.78:80 Inside which we can fine the various server details,they are:
  • 11. 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 services. User nobody Group nogroup ServerAdmin: Your address, where problems with the server should be e-mailed. This address appears on some server-generated pages, such as error documents. e.g. admin@your-domain.com
  • 12. 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. ServerName www.example.com:80 ServerName localhost 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. DocumentRoot "/opt/lampp/htdocs"
  • 13. 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 subdirectories). First, we configure the "default" to be a very restrictive set of features. <Directory /> Options FollowSymLinks AllowOverride None #XAMPP #Order deny,allow #Deny from all </Directory>
  • 14. DirectoryIndex sets the file that Apache will serve if a directory is requested. <IfModule dir_module> #DirectoryIndex index.html # XAMPP DirectoryIndex index.html index.html.var index.php index.php3 index.php4 </IfModule> ------------------------------------------------------------------------------- The following lines prevent .htaccess and .htpasswd files from being viewed by Web clients. <FilesMatch "^.ht"> Order allow,deny Deny from all </FilesMatch>
  • 15. ErrorLog: The location of the error log file. # If you do not specify an ErrorLog directive within a <VirtualHost> # container, error messages relating to that virtual host will be # logged here. If you *do* define an error logfile for a <VirtualHost> # container, that host's errors will be logged there and not here. # ErrorLog logs/error_log 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. Example: Redirect permanent /foo http://www.example.com/bar
  • 16. Alias: Maps web paths into filesystem paths and is used to access content that does not live under the DocumentRoot. 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/"
  • 17. 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 necessary. Server-pool management (MPM specific) Include etc/extra/httpd-mpm.conf Language settings Include etc/extra/httpd-language User home directories #Include etc/extra/httpd-userdir.conf
  • 18. Real-time info on requests and configuration Include etc/extra/httpd-info.conf Virtual hosts Include etc/extra/httpd-vhosts.conf Local access to the Apache HTTP Server Manual Include etc/extra/httpd-manual.conf Distributed authoring and versioning (WebDAV) Include etc/extra/httpd-dav.conf Various default settings Include etc/extra/httpd-default.conf
  • 19. 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 them. Edit /etc/apache2/httpd.conf and find this line: Include /etc/apache2/vhosts.d/*.conf Replace it with a line that specifies a .conf file we will create and call vhost.conf: Include /etc/apache2/vhosts.d/vhost.conf SETTING VIRTUAL HOSTING
  • 20. 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:
  • 21. NamevirtualHost * <VirtualHost *> ServerAdmin youremail@yoursite.com DocumentRoot /srv/www/htdocs/directory_of_your_choice/ ServerAlias yourdomain.com *.yourdomain.com <virtualHost> 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.