Wednesday, September 19, 2012

Apache 2 installation

cd /usr/local/src

 Download the latest version of http and run the below commands

wget http://apache.techartifact.com/mirror//httpd/httpd-2.4.3.tar.gz

tar -zxvf httpd-2.4.3.tar.gz

cd httpd-2.4.3

./configure --prefix=/usr/local/apache2 --with-php=/usr/bin/php --with-mysql=/usr/bin/mysql  --
enable-mods-shared=all --with-included-apr

 You may get the below errors,  you can fix it by following the below steps

configure: error: Bundled APR requested but not found at ./srclib/. Download and unpack the corresponding apr and apr-util packages to ./srclib/.


cd  /usr/local/src/
wget http://apache.techartifact.com/mirror//apr/apr-1.4.6.tar.gz
tar -zxvf apr-1.4.6.tar.gz
cd apr-1.4.6
./configure
make
make install

cp -r /usr/local/src/apr-1.4.6 /usr/local/src/httpd-2.4.3/srclib/

cd ../httpd-2.4.3/

./configure --prefix=/usr/local/apache2 --with-php=/usr/bin/php --with-mysql=/usr/bin/mysql --enable-mods-shared=all --with-apr=/usr/local/src/httpd-2.4.3/srclib/apr-1.4.6 --with-apr-util=/usr/local/src/apr-util-1.5.1

configure: error: pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/


cd ..

wget pcre

./configure
make
make install

 cd ../httpd-2.4.3/

./configure
configure: error: Did not find pcre-config script at /usr/local/src/pcre-8.31/

yum install pcre-devel

apr-util not found.configure: error: APR-util version 1.3.0 or later is required

wget apr-util1.5.0

./configure --with-apr=/usr/local/src/apr-1.4.6

make
make install

cd httpd

./configure --prefix=/usr/local/apache2 --with-php=/usr/bin/php --with-mysql=/usr/bin/mysql --enable-mods-shared=all --with-apr=/usr/local/src/httpd-2.4.3/srclib/apr-1.4.6 --with-apr-util=/usr/local/src/apr-util-1.5.1

make
make install

 ps -ef | grep httpd

killall -9 httpd

 cd /usr/local/apache2/bin/

./apachectl start

It should work...

No comments: