Monday 13 October 2014

Installing & Configuring Apache 2.4 (64bit) on Linux Machine

This post is divided into 3 sections: Installation, Configuration & Verification. 



So let's start the process.........

Installing Apache 2.4 (64bit) on Linux Machine :

  1. To install apache 2.4, we need the source code & than need to build it. This will generate the binaries.
  2. Download the source code from http://httpd.apache.org/download.cgi#apache24 to your Linux 64bit box.
  3. Pre-requisites:
    1. Download & configure Apache Portable Runtime Libraries.
    2. Download, Install & Configure PCRE (Perl Compatible Regular Expressions).
  4.  Download APR & APR-Util:
    1. bash$> wget http://apache.tradebit.com/pub//apr/apr-1.5.1.tar.gz
      bash$> wget http://apache.tradebit.com/pub//apr/apr-util-1.5.4.tar.gz
    1. Untar both the archives.
                  bash$> gtar -xvzf apr-1.5.1.tar.gz
         bash$> gtar -xvzf apr-util-1.5.4.tar.gz

      4.  Now we need to copy the files from apr & apr-util unzipped folder to the apache 
           downloaded source code folder under "srclib".

               bash$> mv apr-1.5.1/* /scratch/ckukreja/apache24/srclib/apr
               bash$> mv apr-util-1.5.4/* /scratch/ckukreja/apache24/srclib/apr-util

      5.  Download the PCRE from http://sourceforge.net/projects/pcre/files/pcre/8.36/ 
    1. Install the pcre. 
          bash$> wget http://sourceforge.net/projects/pcre/files/pcre/8.36/pcre-8.36.tar.gz/download

              2. Configure it.

           bash$> gtar -xvzf pcre-8.36.tar.gz
           bash$> cd pcre-8.36
           bash$> ./configure --prefix=/scratch/ckukreja/pcre

              3. Do make & make install 
            bash$> make
            bash$> make install        
          
      6.  Now we need to configure the environment for building the apache2.4 source code, for this 
           it is required to execute the 'configure' script present in the directory.

           For eg: /scratch/ckukreja/apache24/httpd2.4.10 is the directory where you have unzipped 
                       the source code
                       
                       bash$>ls -ltr configure

      7.  Execute the 'configure'  script.
./configure --with-included-apr --enable-so --with-pcre=/scratch/ckukreja/pcre/ --prefix=/scratch/ckukreja/myapache

      8. Now we need to build & install the binaries. Do the following:
    • make
    • make install
     9. Now go to the directory where you have install "myapache"
    • Move to bin folder and execute the 'file' command on httpd executable file.
                 bash$> cd /home/ckukreja/myapache/bin 
                 bash$> file httpd
httpd: ELF 64-bit LSB executable, AMD x86-64, version 1 (SYSV), for GNU/Linux 2.6.9, dynamically linked (uses shared libs), not stripped
    • 'file httpd' - It's output will show you the type of file is it. Here it should show 64bit, if not than the binaries are of 32bit. Check the steps again.
    

Configure Apache 2.4 on Linux Box:

 As you have installed the apache 2.4 on your Linux Machine. Now it is required to configure it before we start the server.
  1. Go to the "myapache" installation directory. Move to conf folder.
         bash$> cd /scratch/ckukreja/myapache/conf  
     2. Open httpd.conf file to edit it. 

          bash$> vi httpd.conf
    • Change the port from '80' to the one you want. Like we use '8880'.
    • By default username & group are configured as 'daemon'. Change them to the one you are logged in with.
    • Save the changes & close the file.
      3. Now come out of the conf folder & change your directory to bin folder.
          
         bash$>cd /scratch/ckukreja/myapache/bin

      4. Execute the apachectl executable. It will start the httpd server process.
    • ./apachectl -k  start

Verify the installation & configuration steps:


Try to access the default resource present on apache 2.4 server like index.html.
Syntax: http://<hostname>:<port>/index.html
Eg: http://slc0010:8880/index.html

It will display the "It Works!!!"


So guys you are done with the Installation & Configuration of Apache24-64bit on your Solaris Sparc Machine..........!!!!!!!!!!!!!! :-)

No comments:

Post a Comment