GIT – Apache 2.4.2 is the latest stable version available on section. Since it is the latest version so it may have plenty of dependencies issues. In my case, i am installing it from source(httpd-2.4.2.tar.bz2).

Currently i am logged in using SSH on Plain  6.x server and it has very basic packages installed.

Downloading and compiling Apache 2.4.2

cd /usr/local/src/
tar -jxf httpd-2.4.2.tar.bz2
cd httpd-2.4.2
./configure --prefix=/usr/local/apache --enable-so --enable-deflate --enable-expires --enable-headers --enable-rewrite

Note : Here i required deflate,expires,headers and other modules so i included that.

Ops, failed to dependencies.. because we don’t have gcc compiler and other devel packages foraprapr-utils, openssl and so on.

yum apr-devel apr-util-devel gcc pcre-devel.x86_64 zlib-devel openssl-devel

Great. Here we go;


again ERROR :

rotatelogs.c:298: warning: implicit declaration of function ‘apr_file_link’
/usr/lib64/apr-1/build/libtool --silent --mode=link gcc -std=gnu99 -pthread
-o rotatelogs  rotatelogs.lo      /usr/lib64/ -ldb-4.7 -lexpat
-ldb-4.7 /usr/lib64/ -lpthread
rotatelogs.o: In function `post_rotate':
rotatelogs.c:(.text+0x5ed): undefined reference to `apr_file_link'
collect2: ld returned 1 exit status
make[2]: *** [rotatelogs] Error 1
make[2]: Leaving directory `/usr/local/src/httpd-2.4.1/support'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/local/src/httpd-2.4.1/support'
make: *** [all-recursive] Error 1

Current apr and apr-util version is older while Apache 2.4.2 requires latest APR and APR-utils e.g1.4.x is the latest available version.
Lets include the latest apr and apr-util into apache srlib/ so it can also be compiled along with Apache.

cd /usr/local/src/httpd-2.4.2/srclib/

Installing APR & APR-Utils dependencies :


Note : If this mirror doesn’t work, chose other mirrors

tar -jxf apr-1.4.6.tar.bz2
tar -jxf apr-util-1.4.1.tar.bz2
mv apr-1.4.6 apr
mv apr-util-1.4.1 apr-util

Lets configure it now :

./configure --prefix=/usr/local/apache --enable-so --enable-deflate --enable-expires --enable-headers --enable-rewrite --with-included-apr --with-included-apr-util
make install

Following this tutorial i was able to install Apache 2.4.2 successfully on CentOS 6.x . If you are unable to install or having difficulty you can leave a comment and i will try to respond you quickly as much possible.

Print Friendly, PDF & Email



Bài viết liên quan