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.


  1. it was really a nice article and i was really impressed by reading this
    article We are also giving Linux Course Online Training.the Linux-
    is the one of the best Online Training institute.

  2. Nicely explained. Here you described the well written article from your in-depth knowledge. Truly impressive and nice information

    Java Training in Chennai Core Java Training in Chennai Core Java Training in Chennai

    Java Online Training Java Online Training JavaEE Training in Chennai Java EE Training in Chennai

  3. Smilearrow Find best products values got thousands of online top most bought items key points, rankings, price, photos lot of cool stuff to get from

  4. In 2019, Adidas and Under Armour took most of the places in top 10. The Best Basketball Shoes doesn’t only depend on the shoe but also on the player. Be tricky enough in choosing your best fit.