Tuesday, December 13, 2011

Changing the Apache Installation directory in Linux

I am sure there are numerous posts online on how to install Apache in Linux Systems. Almost every post has the detailed steps listed out on how to go about. The basic steps are ./configure, make and make install. But what if there is already a different version of Apache installed in the default location. Then your installation goes for a Toss. Next the question arises "How to install Apache in a different location?". I was in a similar situation sometime ago. I searched online for answers. Almost all posts were inclined towards installation of Apache on Linux but none of them were concentrated on how one can change default installation directory of Apache. I opened the Apache Documentation and then found the solution. So I thought I will write a simple post on how to change the default installation directory so that it will save the user's time which is required to hunt down the solution in Apache documentation.

Well.. this is extremely simple. After downloading the tar.gz file from http://httpd.apache.org/download.cgi#apache22 location, unzip the file using tar -xvf <filename>.tar.gz command. Go inside the unzipped directory and type ./configure --prefix=<directory where apache should be installed>. For example, if you want to install Apache in the etc folder then the command will be ./configure --prefix=/etc/apache2 where Apache will be installed in the above location instead of the usual one. The remaining steps are the same. More details can be found by using the help command ie: ./configure --help.

Hope this post was helpful for some newbies who have started playing around with Apache.










9 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. Trade FX At Home On Your PC: roboforex login Is A Forex Trading Company. The Company States That You Can Make On Average 80 – 300 Pips Per Trade. roboforex login States That It Is Simple And Easy To Get Started.

    ReplyDelete
  3. This blog is an awesome and information. Keep sharing more blogs with us. Thank you.
    Data Science Institute in Hyderabad

    ReplyDelete