Você está na página 1de 4

Compile and Install Apache 2.4.10 on Red Hat 6.5 And CentOS 6.

5
In this article, I will tell you how to Compile and Install Apache 2.4.10 on
Red Hat 6.5 And CentOS 6.5.
Step #1: Lets first install rpm-build and make the working folder.
$> yum -y install rpm-build

Step #2: Lets move to the SOURCES folder and download apache
$> cd ~/rpmbuild/SOURCES
$> wget http://www.us.apache.org/dist//httpd/httpd2.4.18.tar.bz2
Step #3: Check the the missing dependencies.
$> rpmbuild -tb httpd-2.4.18.tar.bz2
error: Failed build dependencies:
autoconf is needed by httpd-2.4.10-1.x86_64
zlib-devel is needed by httpd-2.4.10-1.x86_64
libselinux-devel is needed by httpd-2.4.10-1.x86_64
libuuid-devel is needed by httpd-2.4.10-1.x86_64
apr-devel >= 1.4.0 is needed by httpd-2.4.10-1.x86_64
apr-util-devel >= 1.4.0 is needed by httpd-2.2.29-1.x86_64
pcre-devel >= 5.0 is needed by httpd-2.4.10-1.x86_64
openldap-devel is needed by httpd-2.4.10-1.x86_64
lua-devel is needed by httpd-2.4.10-1.x86_64
libxml2-devel is needed by httpd-2.4.10-1.x86_64
distcache-devel is needed by httpd-2.4.10-1.x86_64
openssl-devel is needed by httpd-2.4.10-1.x86_64
Here we miss many libs. So lets go ahead and install them.

$> yum install zlib-devel autoconf libselinux-devel libuuid-devel


pcre-devel openldap-devel lua-devel libxml2-devel openssl-devel
expat-devel libuuid-devel db4-devel postgresql-devel mysql-devel
freetds-devel unixODBC-devel openldap-devel nss-devel sqlitedevel

We will have to compile arp and discache manually.


$> wget http://www.us.apache.org/dist//apr/apr-1.5.2.tar.bz2
$> wget http://www.us.apache.org/dist//apr/apr-util-1.5.4.tar.bz2
$> yum -y install libtool doxygen

Now we will build rpm file for apr:


$> rpmbuild -tb apr-1.5.2.tar.bz2

Now we will install the fresh apr.


$> rpm -ivh /root/rpmbuild/RPMS/x86_64/apr-1.5.2-1.x86_64.rpm
$> rpm -ivh /root/rpmbuild/RPMS/x86_64/apr-devel-1.5.21.x86_64.rpm

Lets compile apr-util.


If you dont see freetds-devel on your repo, you should download and
install it manually:
$> yum install gnutls.x86_64 gnutls-utils.x86_64 gnutlsdevel.x86_64
$> wget http://pkgs.repoforge.org/freetds/freetds-0.911.el6.rf.x86_64.rpm
$> wget http://pkgs.repoforge.org/freetds/freetds-devel-0.911.el6.rf.x86_64.rpm
$> rpm -ivh freetds-0.91-1.el6.rf.x86_64.rpm
$> rpm -ivh freetds-devel-0.91-1.el6.rf.x86_64.rpm
Then we will make rpm for apr-util:
$> rpmbuild -tb apr-util-1.5.4.tar.bz2

After finishing, just install the rpm files:


$> rpm -ivh ~/rpmbuild/RPMS/x86_64/apr-util-1.5.4-1.x86_64.rpm
Preparing...
###########################################
[100%]

1:apr-util
###########################################
[100%]
$> rpm -ivh ~/rpmbuild/RPMS/x86_64/apr-util-devel-1.5.41.x86_64.rpm
Preparing...
###########################################
[100%]
1:apr-util-devel
###########################################
[100%]

Compile and install distcache:


$> wget
http://archives.fedoraproject.org/pub/archive/fedora/linux/release
s/18/Fedora/source/SRPMS/d/distcache-1.4.5-23.src.rpm
$> rpmbuild --rebuild distcache-1.4.5-23.src.rpm
$> rpm -ivh ~/rpmbuild/RPMS/x86_64/distcache-1.4.523.x86_64.rpm
Preparing...
###########################################
[100%]
1:distcache
###########################################
[100%]
$> rpm -ivh ~/rpmbuild/RPMS/x86_64/distcache-devel-1.4.523.x86_64.rpm
Preparing...
###########################################
[100%]
1:distcache-devel
###########################################
[100%]

Step #4: Building and Compiling Apache 2.4.10.


$> cd ~/rpmbuild/SOURCES/
$> rpmbuild -tb httpd-2.4.18.tar.bz2

After having compiled successfully,


$> rpm -ivh ~/rpmbuild/RPMS/x86_64/httpd-2.4.18-1.x86_64.rpm

MOD_JK
download and unzip modjk connector
$> wget http://www.us.apache.org/dist/tomcat/tomcatconnectors/jk/tomcat-connectors-1.2.41-src.zip
cd /etc/httpd/connector/tomcat-connectors-1.2.41-src/native
./configure --with-apxs=/usr/bin/apxs
make
make install

disable selinux /etc/sysconfig/selinux

# Load mod_jk.so
LoadModule jk_module modules/mod_jk.so

# Config file of mod_jk


JkWorkersFile conf/workers.properties
JkLogFile logs/mod_jk.log
JkLogLevel error
JkLogStampFormat "[%a %b %d %H:%M:%S %Y]"
JkMount /* loadbalancer

Você também pode gostar