1 / 107

Chapter

Chapter. Apache Installation on Linux. Acknowledgement. The contribution made by Darrin Morison is acknowledged. Chapter Objectives. Demonstrate a basic installation and setup of an Apache Web Server on a PC running the Linux OS. Chapter Modules. Apache Web Server installation.

Télécharger la présentation

Chapter

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Chapter Apache Installation on Linux

  2. Acknowledgement • The contribution made by Darrin Morison is acknowledged

  3. Chapter Objectives • Demonstrate a basic installation and setup of an Apache Web Server on a PC running the Linux OS.

  4. Chapter Modules • Apache Web Server installation

  5. Introduction to Apache • Apache is a web server package that works under Linux as well as under other operating systems • The name Apache comes from the concept of extensive patching of existing code • The primary advantage of Apache is that it is generally free or available at modest costs

  6. Apache Server Installation • Download newest version of Apache • May be installed from a CD-ROM as well • Unzip downloaded file • Untar the tar file • Create the MAKE files • Make Install • Edit httpd.conf file • Start Apache Server

  7. Installing Apache From a CD-ROM • If your CD-ROM has Apache and you want to use RPM to install the package, issue this command • rpm –i apache_1_3_4.rpm (substitute the full name of the Apache package)

  8. Downloading the newest Apache • First, in Linux, create a folder to hold the Apache file you will download. • The newest version of Apache Server and Documentation can be found at The Apache Software Foundation http://www.apache.org/ • To download the newest version of Apache go to http://www.apache.org/dist/ and click on apache_1.3.12.tar.gz. • Download this file into your newly created directory. • NOTE: apache 1.3.12 is the latest version at the time of this writing. You may want to check for newer releases.

  9. Unzipping Downloaded File • After you have downloaded your Apache file go into the folder you have downloaded it into by typing cd /path to folder/name of folder/. • Next, to unzip the .gz file at the prompt type: gunzip apache_1.3.12 and press the enter key. • This will unzip the file into the current directory.

  10. Untarring the TAR file • After unzipping the .gz file the resulting file will be a .tar file. (Which stands for tape archival) • You will need to untar this file by typing at the prompt: tar –xvf apache_1.3.12 and press the enter key. • This will untar the file to a new directory named apache_1.3.12

  11. Creating the Make Files • Go into the folder that now contains the untarred apache files. To change into that folder, at the prompt type: cd /<path to folder>/apache_1.3.12. • Once you are in the apache_1.3.12 folder you will need to create the apache make files. • To do this, at the prompt type: • ./configure --prefix=/usr/local/apache and press the enter key. This will install apache in the folder /usr/local/apache. • You may chose to install in another directory.

  12. Compiling Make Files • After running the configure command you will need to compile the make files. • To compile the make file, from inside in the apache_1.3.12 directory, at the prompt, simply type: make and press the enter key.

  13. Running the Make Install • Next you must run the make install. • While still in the directory apache_1.3.12, at the prompt, type: make install and then press enter. • This will install the apache server to the directory defined in the configure command.

  14. Editing the httpd.conf File • In order to get the apache server started you must edit the httpd.conf file. The file is located in whatever directory you installed apache in. • Once in your apache install directory find the folder named conf. • Change into the conf folder and locate the file named httpd.conf. • Open the httpd.conf file with any file editor. • Next locate the line # ServerName <Name> and uncomment out this line by deleting the # symbol preceding ServerName. • Save the file and close it.

  15. Starting, Stopping and Restarting Your Apache Server • To start your Apache server you must either put the location of the directory, where your Apache server is installed, in you PATH environment variable or you must change into your Apache directory and at the prompt type: apachectl start and press return • If the path to your Apache install directory is already in your PATH environment variable, then you can type: apachectl start to start your apache Server from anywhere within your environment.

  16. Starting, Stopping and Restarting Your Apache Server (cont.) • To stop your Apache Server, from inside the directory where your Apache is installed, type: apachectl stop and press enter. • To restart your Apache Server, from the directory where your Apache is installed, type: apachectl restart and press enter.

  17. Testing Your Apache Installation • After you have installed and started your Apache server you can test to if everything is running OK by doing the following… • Start a browser application. • If you installed Apache as root, type in the address bar of your browser the name of your computer and press enter. • If you installed Apache as a user, type in the address bar the name of the computer followed by a colon and then 8080. For example…. your_computer_name:8080. • 8080 is the default port for user and 80 is the default port for root.

  18. Testing Your Installation (cont.) • If everything has gone as it should have you should see a page with the apache logo at the top explaining why you are seeing this page. This page gives you links to all the apache documentation which you should read. • If you would like to customize this index page it is called index.html.en in the htdocs directory located in the directory your Apache server is installed. (source: http:// www.apache.org/)

  19. Apache Installation is Finished! • The basic installation of the Apache server is finished. • There is much more to an Apache server customization. You should then read the documentation provided with your release to become more familiar with your Apache setup.

  20. Setting Up the Website • Create the home directory for the website, we will use /usr/www/ganesan • Create 3 subdirectories under the site directory • conf • htdocs • logs

  21. Setting Up the Website (con’t) • You will find a subdirectory called conf under the directory where you installed Apache • Copy 3 files (srm.conf-didst, access.conf-dist, http.conf-dist) from this directory into /usr/www/ganesan/conf • If you cannot find the 3 files, use the find command to find them

  22. Setting Up the Website (con’t) • Rename the 3 files you just copied to drop the “-dist” portion of the name • Edit the httpd.conf file to specify • the port number on which your web server responds • the user running the httpd daemon, etc… • Specify the server name • ServerName ganesan.com

  23. Setting Up the Website (con’t) • Add a line that specifies the root directory for your website • DocumentRoot /usr/www/ganesan/htdocs • Edit the srm.conf file to set up the web home directory and any special internal command usage • Edit the access.conf file to set a basic set of access permissions

  24. Setting Up the Website (con’t) • In the htdocs directory create an HTML file for the server to read when it starts • This can be any HTML file • The filename should be default.html • Start the httpd daemon • httpd –f /usr/www/ganesan/conf

  25. Setting Up the Website (con’t) • 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

  26. Server Configuration

  27. Server Configuration • Make sure the ServerType directive is set to “standalone” • Check the Port device to make sure it is set to the TCP/IP port to which your Apache server listens • Set the User directive to either the user ID (UID) or the user name used for all web visitors

  28. Server Configuration (con’t) • Set the Group directive to either the group ID (GID) or the group name assigned to all web users • Modify the ServerAdmin directive to include the e-mail address of the administrator • Set 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

  29. Server Configuration (con’t) • Set the ServerName directive to the fully qualified domain name of your server

  30. Starting and Stopping Apache

  31. Starting and Stopping Apache • If you are running Apache as a standalone server, you need to start and stop Apache manually • Start with httpd –d rootdir –f configs • To stop Apache use ps to detect the httpd daemon’s PID and use the kill command to terminate the process

  32. A Note on Starting and Stopping Apache • Later versions of Apache include a script that does the start and stop tasks for you

  33. Chapter Apache Installation in Linux-Mandrake

  34. Acknowledgment • The following information has been obtained directly from www.mandrake.com • All credit it due to the above

  35. Linux Unix Windows GUI based approach to Apache installation. Linux: Where Unix meets Windows

  36. Apache Configuration Using KDE • In this section, Apache will be configured using the available tools and utilities of the KDE desktop. This is not necessarily a recommended way to run a web server, but it does offer a convenient environment to begin learning the first steps of running a web server in the safety of an internal LAN.

  37. Checking for Already Installed Apache

  38. Using ktail to Monitor Installation • Alt-F2will open a mini-command line in KDE, andkdesu -c ktailwill launch ktail as the root user.Ktail will be used throughout the following pages to monitor Apache's log files during configuration

  39. Launching ktail to Monitor the Installation Alt F2 opens a mini command line

  40. Providing root Password

  41. Accessing the Service Activity

  42. Activating the httpd Service

  43. Starting Stopping and Restarting Apache

  44. Monitoring Start, Stop and Restart

  45. Accessing the Web

  46. Accessing the Web Server Using Localhost

  47. Gain Access as Super User to root

  48. Root Folder(File)

  49. Location of Apache Files

  50. Bookmark the Location

More Related