apache server-chris

32
Presented by Lonnye Bower Fardin Khan Chris Orona APACHE WEB SERVER

Upload: goutham28

Post on 28-Sep-2015

20 views

Category:

Documents


0 download

DESCRIPTION

apache server presentation

TRANSCRIPT

  • 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 costs
  • Installing 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 file
  • Installing 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 together
  • Installing 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 installed
  • Installing 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 path
  • Setting 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 directoryconfhtdocslogs
  • Setting 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 them
  • Setting 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.com
  • Setting 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 permissions
  • Setting 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/conf
  • Setting 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 directory
  • Server 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 visitors
  • Server 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/httpd
  • Server Configuration (cont)

    Set the ServerName directive to the fully qualified domain name of your server
  • Starting 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 process
  • A Note on Starting and Stopping Apache

    Later versions of Apache include a script that does the start and stop tasks for you
  • Virtual 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 servers
  • Setting 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.xxx
  • Setting 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 hosting

    DocumentRoot /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 each
  • A 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 characteristics
  • Key Terms

    ApacheconfServer NameVirtual Hostingifconfig
  • Apache Resources

    For more information on Apache go towww.apache.org www.apacheweek.com dev.apache.org
  • Thank 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]