Home > Cpanel Basics > apache manually installation

apache manually installation

April 13th, 2009

Hi,

Manually installation:

1. Download the latest Apache source distribution from www.apache.org

2. Unpack the source distribution.
The source distribution comes as a compressed archive. Let’s say that we are
installing Apache 1.3.12 (apache_1.3.12.tar.gz). Uncompress and untar the
archive with the following command:

$ tar -zxvf apache_1.3.12.tar.gz

This will create a directory named apache_1.3.12 in your current working
directory. We’ll call this the Apache source directory.

3. RTFM. RTFM. RTFM. Please read the README file in the Apache source
directory.

4. Configuring your environment to compile Apache.

The source distribution comes with a script called configure, which checks
your environment for the necessary support files (like headers, shared
libraries and utility programs) that are required to successfully compile
Apache. To configure, change directory to the Apache source directory and type

$ ./configure –prefix=/usr/local/apache

The prefix argument indicates where we wish to install Apache. This command
will output several lines on the screen. Essentially this command creates the
Makefiles for the build according to your system configuration. If there are
errors in configure, you may be missing some header files or utility programs
which you must install before proceeding.

5. Compile Apache.
Once configure runs successfully you can compile Apache using the make command

$ make

This will output several lines on the screen indicating that it is compiling
and linking Apache. This should normally conclude with no errors, however if
any errors occur, they will usually be caused due to missing utility programs
or libraries. The Apache FAQ has some pointers if you get stuck
(http://www.apache.org/docs/misc/FAQ.html)

6. Install Apache
Apache installs itself in /usr/local/apache by issuing the command

$ make install

If this concludes successfully your system now has Apache installed. You
should see Apache’s installation files in /usr/local/apache and the main
configuration file in /usr/local/apache/conf called httpd.conf

7. Configure Apache
Apache is configured through a single file /usr/local/apache/conf/httpd.conf.
This file consists of a number of Apache Directives, which determine the
various operating parameters of the Apache server. For purposes of a simple
installation, you will need to modify only a few directives described below

DocumentRoot - This is the location of the directory from which HTML files are
served. You can replace the default by any directory. The directive,

DocumentRoot “/usr/local/apache/htdocs”

instructs Apache to serve files from /usr/local/apache/htdocs. In other words,
when you try and access http://servername/somepage.html in a browser, Apache
will serve the file /usr/local/apache/htdocs/somepage.html.

Directory options - Once the DocumentRoot is defined, you must instruct Apache
how to serve and handle various files found in that directory. This is
achieved by modifying the Directory directive. The Directory directive has
various options such as execution of server side includes, whether to follow
symbolic links from the directory, access control to the directory etc. In our
configuration file, we need not change anything.

Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all

That’s about it. Apache is now configured for default behavior and web
serving. If there are any other parameters that you need to set, the
configuration file is well commented and pretty much self-explanatory.

8. Starting Apache
Apache 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 started

To stop apache use /usr/local/apache/bin/apachectl stop

9. Test your installation
Once Apache is running, fire up your web browser and access http://localhost/.
If your installation was successful and Apache is running, you should see a
test page saying something like “If you can see this, it means that the
installation of the Apache web server software on this system was successful”.

CONGRATULATIONS! You now have a successful installation of Apache running on your system!

Cpanel Basics

  1. No comments yet.
  1. No trackbacks yet.