appache.ppt

Download Appache.ppt

If you can't read please download the document

Upload: magna-college-of-engineering

Post on 16-Apr-2017

1.617 views

Category:

Technology


0 download

TRANSCRIPT

APACHE INSTALL,CONFIGURE AND SETUP

BY R.RAJAVEL (MAGNA COLLEGE OF ENGINEERING)

INTRODUCTION

he Apache project started out to build a commercial grade, open source web server. As open source projects go, this one has done fantastically well, powering over 61% of the web servers on the Internet with Microsoft's IIS a distant second at 19%. Why would you want to choose Apache? This article will try to answer that and also take you through the installationand basic configuration of this great web server.

It was a cold morning in New York City, early 1996 when I entered the officeand rushed to the kitchen for that hot mug of coffee to warm myself. I metwith my boss to discuss the tasks for the day, one of which was, "Install andconfigure Apache".Hmmm, I thought to myself. What is this Apache? I had heard about the NativeAmerican tribe, the Indian who sings ragamuffin reggae and the 1957 Chevroletclassic truck but I did not know that it was something that could be installedand configured on my Solaris 2.5.1 box.I then embarked on a trip that took me through history, technology,philosophy, and statistics. In this article I will share stories of my tripwith you and hope that it inspires you to take a journey to meet the ruler ofthe web, Apache.

What is Apache?Apache is a web server. In fact Apache is the worlds most popular anddominating web server with over 61% of all Internet web servers runningApache. A far second is Microsoft IIS, with a measly 19% of market share. Thisis a true testament to Apache's popularity. (Statistics courtesy ofhttp://www.netcraft.com)Apache actually stands for "A patchy server". Since the original Apache wasbuilt from "patching" the original NCSA HTTP daemon in early 1995.Apache is not owned by a single commercial entity (like IIS is owned byMicrosoft, iPlanet is owned by Sun/Netscape Alliance) but rather, is developedby a loose knit team of voluntary programmers scattered across the globe,collaborating through the Internet. Today, development of Apache iscoordinated by a non-profit organization called the Apache Foundation.

But where can I get Apache if I don't have it?Apache is available for download on the Internet, free of charge and isbundled with all (??) Linux distributions. In fact, most (or maybe all) Linuxdistributions install and configure Apache for you by default. In other wordswhen you install Linux, you are also installing Apache.So to obtain Apache you have two choices, either just get it off the Linuxdistribution or download the latest and greatest from www.apache.org

Now that I have it, how do I install it?Apache distributions come in various forms. Each of these are described below:1. Source distribution: This consists of the source code and no pre-builtbinaries. Once you download a source distribution, you must compile it and runthe scripts bundled with the distribution to install it. This gives the usermaximum flexibility to custom configure and install Apache. The user even hasthe liberty of extending or modifying the source code and installing otherfunctional modules as well. The install procedure is built directly into theMakefile to build the source and simply issuing the command 'make install'will install Apache with it's defaults on your system.

2. Binary distribution: This consists of pre-built binaries for the varioussupported operating environments and platforms. These distributions come withinstallation scripts that allow you to install Apache on your system.3. Packaged distributions: These distributions come in packaged formats likeRPM (for RedHat and derivative systems). These distributions are installed viathe standard installation management program called rpm. This allows thesoftware installation of Apache to be tracked by the Operating System.At the end of this article there is a more detailed explanation of how toactually compile and install an Apache source distribution.

Ok, now it's all installed, but how do I configure it?An Apache use a single configuration file called httpd.conf to manage its operating characteristics. In this file, you can configure Apache server characteristics like Server name, port on which to run the server, the threading and process spawn limits, the modules that it loads, the handlers for various types of files, virtual directories and hosts, mime-types, access control etc. etc. phew! For default installations you need not touch this file. Only when you need non-standard options for configuring Apache you will have to open this file. This file is well commented and pretty muchself-explanatory, so editing it is a breeze.

Well it works, but what are its features?Apache is a full-featured web server that offers a full suite of functionalityfrom basic web serving to highly advanced server configurations. Since Apacheis open source, developers can even extend it beyond the basics, therebymaking Apache's feature set infinite.Apache is secure.The Apache security controls are very flexible and very powerful. You canspecify access control on a particular directory or a particular file, for aparticular user, for a group of users, for a particular IP address or a groupof IP addresses. All of these settings can be made in the Apache configurationfile httpd.conf. In other words you can restrict access of a particular fileto a particular user coming from a particular IP address, at the lowest level.

Well it works, but what are its features?Apache is a full-featured web server that offers a full suite of functionalityfrom basic web serving to highly advanced server configurations. Since Apache is open source, developers can even extend it beyond the basics, thereby making Apache's feature set infinite.Apache is secure.The Apache security controls are very flexible and very powerful. You canspecify access control on a particular directory or a particular file, for aparticular user, for a group of users, for a particular IP address or a groupof IP addresses. All of these settings can be made in the Apache configuration file httpd.conf. In other words you can restrict access of a particular fileto a particular user coming from a particular IP address, at the lowest level.

Quick start guideIf you are now anxious to get started with Apache, here is how you go aboutcompiling the Apache source code and configuring your installation.1. Download the latest Apache source distribution from www.apache.org2. Unpack the source distribution.The source distribution comes as a compressed archive. Let's say that we areinstalling Apache 1.3.12 (apache_1.3.12.tar.gz). Uncompress and untar thearchive with the following command:$ tar -zxvf apache_1.3.12.tar.gzThis will create a directory named apache_1.3.12 in your current workingdirectory. We'll call this the Apache source directory.

3. RTFM. RTFM. RTFM. Please read the README file in the Apache sourcedirectory.4. Configuring your environment to compile Apache.The source distribution comes with a script called configure, which checksyour environment for the necessary support files (like headers, sharedlibraries and utility programs) that are required to successfully compileApache. To configure, change directory to the Apache source directory and type$ ./configure --prefix=/usr/local/apacheThe prefix argument indicates where we wish to install Apache. This commandwill output several lines on the screen. Essentially this command creates theMakefiles for the build according to your system configuration. If there areerrors in configure, you may be missing some header files or utility programswhich you must install before proceeding.

5. Compile Apache.Once configure runs successfully you can compile Apache using the make command$ makeThis will output several lines on the screen indicating that it is compilingand linking Apache. This should normally conclude with no errors, however ifany errors occur, they will usually be caused due to missing utility programsor libraries. The Apache FAQ has some pointers if you get stuck(http://www.apache.org/docs/misc/FAQ.html)6. Install ApacheApache installs itself in /usr/local/apache by issuing the command$ make installIf this concludes successfully your system now has Apache installed. Youshould see Apache's installation files in /usr/local/apache and the mainconfiguration file in /usr/local/apache/conf called httpd.conf

8. Starting ApacheApache comes with a script named apachectl that facilitates starting,stopping, restarting apache.$ /usr/local/apache/bin/apachectl start/usr/local/apache/bin/apachectl start: httpd startedTo stop apache use /usr/local/apache/bin/apachectl stop9. Test your installationOnce Apache is running, fire up your web browser and access http://localhost/.If your installation was successful and Apache is running, you should see atest page saying something like "If you can see this, it means that theinstallation of the Apache web server software on this system was successful".CONGRATULATIONS! You now have a successful installation of Apache running on your system!