Apache1.ppt

817 views
770 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
817
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
43
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • 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 there’s…………………...
  • Apache1.ppt

    1. 1. <ul><li>Presented by </li></ul><ul><li>Lonnye Bower </li></ul><ul><li>Fardin Khan </li></ul><ul><li>Chris Orona </li></ul>APACHE WEB SERVER
    2. 2. Introduction Note: Images courtesy of apache.org
    3. 3. Introduction to Apache <ul><li>Apache is a web server package that works under Linux as well as under other operating systems </li></ul><ul><li>The name Apache comes from the concept of extensive patching of existing code </li></ul><ul><li>The primary advantage of Apache is that it is generally free or available at modest costs </li></ul>
    4. 4. Installing Apache
    5. 5. Installing Apache From a CD-ROM <ul><li>If your CD-ROM has Apache and you want to use RPM to install the package, issue this command </li></ul><ul><ul><li>rpm –i apache_1_3_4.rpm </li></ul></ul><ul><ul><li>(substitute the full name of the Apache package) </li></ul></ul>
    6. 6. Installing Apache From a Download <ul><li>Place the downloaded files in a location that will be dedicated to the Apache files, such as /usr/apache </li></ul><ul><li>Uncompress the files using either gzip or tar and compress </li></ul><ul><li>You must edit the configuration file </li></ul><ul><ul><li>You can find more information about this in the Readme file </li></ul></ul>
    7. 7. Installing Apache… (con’t) <ul><li>Uncomment all the Modules in the configuration file except </li></ul><ul><ul><li>cern_meta_module </li></ul></ul><ul><ul><li>msql_auth_module </li></ul></ul><ul><ul><li>dld_module </li></ul></ul><ul><li>Choose either db_auth_module or dbm_auth_module ; they should not be used together </li></ul>
    8. 8. Installing Apache… (con’t) <ul><li>Create the configuration file for Linux by issuing the command </li></ul><ul><ul><li>Configure </li></ul></ul><ul><li>Compile Apache by issuing the make command </li></ul><ul><ul><li>The most common error message encountered concerns the socket.h library, most likely because TCP/IP is not installed </li></ul></ul>
    9. 9. Installing Apache… (con’t) <ul><li>The result of the compilation will be a binary file called httpd </li></ul><ul><li>Copy this file into /bin or /usr/bin , where it will reside in the path </li></ul>
    10. 10. Setting Up the Website
    11. 11. Setting Up the Website <ul><li>Create the home directory for the website, we will use /usr/www/ganesan </li></ul><ul><li>Create 3 subdirectories under the site directory </li></ul><ul><ul><li>conf </li></ul></ul><ul><ul><li>htdocs </li></ul></ul><ul><ul><li>logs </li></ul></ul>
    12. 12. Setting Up the Website (con’t) <ul><li>You will find a subdirectory called conf under the directory where you installed Apache </li></ul><ul><ul><li>Copy 3 files ( srm.conf-didst, access.conf-dist, http.conf-dist ) from this directory into /usr/www/ganesan/conf </li></ul></ul><ul><ul><li>If you cannot find the 3 files, use the find command to find them </li></ul></ul>
    13. 13. Setting Up the Website (con’t) <ul><li>Rename the 3 files you just copied to drop the “-dist ” portion of the name </li></ul><ul><li>Edit the httpd.conf file to specify </li></ul><ul><ul><li>the port number on which your web server responds </li></ul></ul><ul><ul><li>the user running the httpd daemon, etc… </li></ul></ul><ul><li>Specify the server name </li></ul><ul><ul><li>ServerName ganesan.com </li></ul></ul>
    14. 14. Setting Up the Website (con’t) <ul><li>Add a line that specifies the root directory for your website </li></ul><ul><ul><li>DocumentRoot /usr/www/ganesan/htdocs </li></ul></ul><ul><li>Edit the srm.conf file to set up the web home directory and any special internal command usage </li></ul><ul><li>Edit the access.conf file to set a basic set of access permissions </li></ul>
    15. 15. Setting Up the Website (con’t) <ul><li>In the htdocs directory create an HTML file for the server to read when it starts </li></ul><ul><ul><li>This can be any HTML file </li></ul></ul><ul><ul><li>The filename should be default.html </li></ul></ul><ul><li>Start the httpd daemon </li></ul><ul><ul><li>httpd –f /usr/www/ganesan/conf </li></ul></ul>
    16. 16. Setting Up the Website (con’t) <ul><li>Test the web server by starting a browser and specify the URL http://127.0.0.1/ </li></ul><ul><li>If the system is working properly, you will see a screen with a list of files in the htdocs directory </li></ul>
    17. 17. Server Configuration
    18. 18. Server Configuration <ul><li>Make sure the ServerType directive is set to “ standalone ” </li></ul><ul><li>Check the Port device to make sure it is set to the TCP/IP port to which your Apache server listens </li></ul><ul><li>Set the User directive to either the user ID (UID) or the user name used for all web visitors </li></ul>
    19. 19. Server Configuration (con’t) <ul><li>Set the Group directive to either the group ID (GID) or the group name assigned to all web users </li></ul><ul><li>Modify the ServerAdmin directive to include the e-mail address of the administrator </li></ul><ul><li>Set the ServerRoot directive to the absolute path to the directory where all Apache resource and configuration files are stored </li></ul><ul><ul><li>/usr/apache/conf or /etc/httpd </li></ul></ul>
    20. 20. Server Configuration (con’t) <ul><li>Set the ServerName directive to the fully qualified domain name of your server </li></ul>
    21. 21. Starting and Stopping Apache
    22. 22. Starting and Stopping Apache <ul><li>If you are running Apache as a standalone server, you need to start and stop Apache manually </li></ul><ul><ul><li>Start with httpd –d rootdir –f configs </li></ul></ul><ul><ul><li>To stop Apache use ps to detect the httpd daemon’s PID and use the kill command to terminate the process </li></ul></ul>
    23. 23. A Note on Starting and Stopping Apache <ul><li>Later versions of Apache include a script that does the start and stop tasks for you </li></ul>
    24. 24. Virtual Hosting
    25. 25. Virtual Hosts <ul><li>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. </li></ul><ul><li>Virtual hosting saves on machinery and allows for a lot of flexibility in setting up web servers </li></ul>
    26. 26. Setting Up Virtual Hosting <ul><li>If your network uses a name server for DNS, modify it so that the domain name points to your web server for each domain you’ll host </li></ul><ul><li>Use the ifconfig command to set up the IP address for each domain on your server </li></ul><ul><ul><li>ifconfig eth0:1 xxx.xxx.xxx.xxx </li></ul></ul>
    27. 27. Setting Up Virtual Hosting (con’t) <ul><li>Add the route to the network configuration using the route command </li></ul><ul><ul><li>route add –host xxx.xxx.xxx.xxx dev eth0:1 </li></ul></ul><ul><li>Edit the Apache httpd.conf file to set up virtual hosting </li></ul><ul><ul><li><VirtualHost www.cis454.com> </li></ul></ul><ul><ul><li>DocumentRoot /usr/www/cis454/htdocs </li></ul></ul><ul><ul><li>TransferLog /usr/www/cis454/logs/access </li></ul></ul><ul><ul><li>ErrorLog /usr/www/cis454/logs/errors </li></ul></ul><ul><ul><li></VirtualHost> </li></ul></ul>
    28. 28. Setting Up Virtual Hosting (con’t) <ul><li>The previous step defines the virtual host for cis454.com and specifies its DocumentRoot , since each virtual host will have different web directories </li></ul><ul><li>If more than one virtual host is defined, the entries are to be repeated for each </li></ul>
    29. 29. A Final Note <ul><li>There are many more configuration options possible with Apache, but they are usually used for commercial sites that require authentication or special handling characteristics </li></ul>
    30. 30. Key Terms <ul><li>Apache </li></ul><ul><li>conf </li></ul><ul><li>Server Name </li></ul><ul><li>Virtual Hosting </li></ul><ul><li>ifconfig </li></ul>
    31. 31. Apache Resources <ul><li>For more information on Apache go to </li></ul><ul><ul><li>www.apache.org </li></ul></ul><ul><ul><li>www. apacheweek .com </li></ul></ul><ul><ul><li>dev.apache.org </li></ul></ul>
    32. 32. Thank You and Good Luck! <ul><li>If you have any questions regarding Apache and/or any part of this presentation, please feel free to email: </li></ul><ul><li>Lonnye Bower at [email_address] </li></ul><ul><li>Chris Orona at [email_address] edu </li></ul><ul><li>Fardin Khan at Fardin24@ aol .com </li></ul>

    ×