Upload
goutham28
View
21
Download
0
Tags:
Embed Size (px)
DESCRIPTION
apache server presentation
Citation preview
APACHE WEB SERVER
Presented by
Lonnye Bower
Fardin Khan
Chris Orona
As we all know, in the UNIX environment there are various flavors of this
operating system. To name a few:
IBM: AIX
SUN: SOLARIS
HP: HP-UX
SILICON GRAPHICS: IRIX
And theres...
Introduction and Installation of Apache Server
Note: Images courtesy of apache.org
Introduction to Apache
Apache is a web server package that works under Linux as well as under other operating systemsThe name Apache comes from the concept of extensive patching of existing codeThe primary advantage of Apache is that it is generally free or available at modest costsInstalling Apache
Installing Apache From a CD-ROM
If your CD-ROM has Apache and you want to use RPM to install the package, issue this commandrpm i apache_1_3_4.rpm(substitute the full name of the Apache package)
Installing Apache From a Download
Place the downloaded files in a location that will be dedicated to the Apache files, such as /usr/apacheUncompress the files using either gzip or tar and compressYou must edit the configuration fileYou can find more information about this in the Readme fileInstalling Apache (cont)
Uncomment all the Modules in the configuration file exceptcern_meta_modulemsql_auth_moduledld_moduleChoose either db_auth_module or dbm_auth_module; they should not be used togetherInstalling Apache (cont)
Create the configuration file for Linux by issuing the commandConfigureCompile Apache by issuing the make commandThe most common error message encountered concerns the socket.h library, most likely because TCP/IP is not installedInstalling Apache (cont)
The result of the compilation will be a binary file called httpdCopy this file into /bin or /usr/bin, where it will reside in the pathSetting Up the Website
Setting Up the Website
Create the home directory for the website, we will use /usr/www/ganesanCreate 3 subdirectories under the site directoryconfhtdocslogsSetting Up the Website (cont)
You will find a subdirectory called conf under the directory where you installed ApacheCopy 3 files (srm.conf-didst, access.conf-dist, http.conf-dist) from this directory into /usr/www/ganesan/confIf you cannot find the 3 files, use the find command to find themSetting Up the Website (cont)
Rename the 3 files you just copied to drop the -dist portion of the nameEdit the httpd.conf file to specify the port number on which your web server respondsthe user running the httpd daemon, etcSpecify the server nameServerName ganesan.comSetting Up the Website (cont)
Add a line that specifies the root directory for your websiteDocumentRoot /usr/www/ganesan/htdocsEdit the srm.conf file to set up the web home directory and any special internal command usageEdit the access.conf file to set a basic set of access permissionsSetting Up the Website (cont)
In the htdocs directory create an HTML file for the server to read when it startsThis can be any HTML fileThe filename should be default.htmlStart the httpd daemonhttpd f /usr/www/ganesan/confSetting Up the Website (cont)
Test the web server by starting a browser and specify the URL http://127.0.0.1/If the system is working properly, you will see a screen with a list of files in the htdocs directoryServer Configuration
Server Configuration
Make sure the ServerType directive is set to standaloneCheck the Port device to make sure it is set to the TCP/IP port to which your Apache server listensSet the User directive to either the user ID (UID) or the user name used for all web visitorsServer Configuration (cont)
Set the Group directive to either the group ID (GID) or the group name assigned to all web usersModify the ServerAdmin directive to include the e-mail address of the administratorSet the ServerRoot directive to the absolute path to the directory where all Apache resource and configuration files are stored/usr/apache/conf or /etc/httpdServer Configuration (cont)
Set the ServerName directive to the fully qualified domain name of your serverStarting and Stopping Apache
Starting and Stopping Apache
If you are running Apache as a standalone server, you need to start and stop Apache manuallyStart with httpd d rootdir f configsTo stop Apache use ps to detect the httpd daemons PID and use the kill command to terminate the processA Note on Starting and Stopping Apache
Later versions of Apache include a script that does the start and stop tasks for youVirtual Hosting
Virtual Hosts
A virtual host is a web server that resides on one domain but acts as if it was on another. For example, suppose you control ganesan.com and cis454.com. Instead of setting up 2 servers, you can set up a single machine that serves both domains.Virtual hosting saves on machinery and allows for a lot of flexibility in setting up web serversSetting Up Virtual Hosting
If your network uses a name server for DNS, modify it so that the domain name points to your web server for each domain youll hostUse the ifconfig command to set up the IP address for each domain on your serverifconfig eth0:1 xxx.xxx.xxx.xxxSetting Up Virtual Hosting (cont)
Add the route to the network configuration using the route commandroute add host xxx.xxx.xxx.xxx dev eth0:1Edit the Apache httpd.conf file to set up virtual hostingDocumentRoot /usr/www/cis454/htdocs
TransferLog /usr/www/cis454/logs/access
ErrorLog /usr/www/cis454/logs/errors
Setting Up Virtual Hosting (cont)
The previous step defines the virtual host for cis454.com and specifies its DocumentRoot, since each virtual host will have different web directoriesIf more than one virtual host is defined, the entries are to be repeated for eachA Final Note
There are many more configuration options possible with Apache, but they are usually used for commercial sites that require authentication or special handling characteristicsKey Terms
ApacheconfServer NameVirtual HostingifconfigApache Resources
For more information on Apache go towww.apache.org www.apacheweek.com dev.apache.orgThank You and Good Luck!
If you have any questions regarding Apache and/or any part of this presentation, please feel free to email:
Lonnye Bower at [email protected]
Chris Orona at [email protected]
Fardin Khan at [email protected]