Apache 2.4.x Manual install on CentOS – 6.4
1. First Download Apache which you have to install
[root@localhost src]# cd /usr/src [root@localhost src]# wget http://mirror.tcpdiag.net/apache/httpd/httpd-2.4.16.tar.gz [root@localhost src]# tar xvf httpd-2.4.16.tar.gz
2. Now Download APR and APR-Util
These needed to compile apache module
[root@localhost src]# wget http://mirror.tcpdiag.net/apache/apr/apr-util-1.5.4.tar.gz [root@localhost src]# wget http://mirror.tcpdiag.net/apache/apr/apr-1.5.2.tar.gz
Extract them
[root@localhost src]# tar -xvf apr-1.5.2.tar.gz [root@localhost src]# tar -xvf apr-util-1.5.4.tar.gz
Now you have to put the APR and APR-Util which you recently downloaded into your apache source files. like as below
[root@localhost src]# mv apr-1.5.2 /usr/src/httpd-2.4.16/srclib/apr [root@localhost src]# mv apr-util-1.5.4 /usr/src/httpd-2.4.16/srclib/apr-util
 3.Finally you have to Compile apache for installation
go to downloaded directory
[root@localhost httpd-2.4.16]# cd /usr/src/httpd-2.4.16
now run below
[root@localhost httpd-2.4.16]# ./configure --enable-so --enable-ssl --with-mpm=prefork --with-included-apr
in case got error of pcre then download from below link and compile with it.
http://pcre.org/
download and extract then install
[root@localhost pcre-8.37]# cd pcre-8.37 [root@localhost pcre-8.37]# ./configure --prefix=/usr/local/pcre
if again at the time of installation pcre you got below error (mostly in case of fresh installation of centos)
configure: error: You need a C++ compiler for C++ support.
then install compile library or utilities which required for apache configuration
yum install gcc gcc-c++ autoconf automake
if you didn’t got any error then escape above step and run directly as below to install pcre utility
make make install
now use below to configure installation of apache with pcre
[root@localhost httpd-2.4.16]# ./configure --enable-so --enable-ssl --with-mpm=prefork --with-included-apr --with-pcre=/usr/local/pcre
If you got below error of open ssl ( in case of old module of openssl or ssl module not already on your machine)
“configure: WARNING: OpenSSL version is too old
checking whether to enable mod_ssl… configure: error: mod_ssl has been requested but can not be built due to prerequisite failures”
then you can install it as below
[root@localhost httpd-2.4.16]# yum install openssl-develmake
now finally run again httpd configuration for installation as above explained
After few process finally you got command prompt again then use below command one by one for final installation
make make install
 4.Now Enable SSL in httpd.conf
Apache configuration file httpd.conf is located under /usr/local/apache2/conf. You can edit by
nano /usr/local/apache2/conf/httpd.conf
Uncomment the httpd-ssl.conf Include line and the LoadModule ssl_module line in the /usr/local/apache2/conf/httpd.conf file : which something like as below
# Secure (SSL/TLS) connections Include conf/extra/httpd-ssl.conf
View the httpd-ssl.conf to review all the default SSL configurations. For most cases, you donât need to modify anything in this file.
nano /usr/local/apache2/conf/extra/httpd-ssl.conf
The SSL certificate and key are required before we start the Apache. The server.crt and server.key file mentioned in the httpd-ssl.conf needs to be created before we move forward.
[root@localhost httpd-2.4.16]# cd /usr/local/apache2/conf/extra/ [root@localhost extra]# egrep 'server.crt|server.key' httpd-ssl.conf SSLCertificateFile "/usr/local/apache2/conf/server.crt" SSLCertificateKeyFile "/usr/local/apache2/conf/server.key"
 5. Generate server.crt and server.key file
First, Generate the server.key using openssl.
cd /usr/src openssl genrsa -des3 -out server.key 1024
The above command will ask for the password. Make sure to remember this password. You need this while starting your Apache later.
Next, generate a certificate request file (server.csr) using the above server.key file.
openssl req -new -key server.key -out server.csr
Finally, generate a self signed ssl certificate (server.crt) using the above server.key and server.csr file.
openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
Copy the server.key and server.crt file to appropriate Apache configuration directory location.
cp server.key /usr/local/apache2/conf/ cp server.crt /usr/local/apache2/conf/
 6. Start Apache
you have done with all basic installation now let’s start apache service
/usr/local/apache2/bin/apachectl start
If you are getting the below error message :
AH00526: Syntax error on line 52 of /usr/local/apache2/conf/extra/httpd-ssl.conf: Invalid command 'SSLCipherSuite', perhaps misspelled or defined by a module not included in the server configuration
Make sure to uncomment the line shown below in httpd.conf :
[root@localhost src]# nano /usr/local/apache2/conf/httpd.conf # LoadModule socache_shmcb_module modules/mod_socache_shmcb.so # LoadModule ssl_module modules/mod_ssl.so
Finally, this will prompt you to enter the password for your private key before starting up the apache. Verify that the Apache httpd process is running in the background.
ps -ef | grep http
You should see something like that :
[root@localhost src]# ps -ef | grep http root 16882 1 0 13:32 ? 00:00:00 /usr/local/apache2/bin/httpd -k start daemon 16883 16882 0 13:32 ? 00:00:00 /usr/local/apache2/bin/httpd -k start daemon 16884 16882 0 13:32 ? 00:00:00 /usr/local/apache2/bin/httpd -k start daemon 16885 16882 0 13:32 ? 00:00:00 /usr/local/apache2/bin/httpd -k start daemon 16886 16882 0 13:32 ? 00:00:00 /usr/local/apache2/bin/httpd -k start daemon 16887 16882 0 13:32 ? 00:00:00 /usr/local/apache2/bin/httpd -k start root 16891 2338 0 13:32 pts/0 00:00:00 grep http
By default Apache SSL runs on 443 port. Open a web browser and verify that you can access your Apache using https://{your-ip-address}
To stop apache, use apachectl stop.
# /usr/local/apache2/bin/apachectl stop
Use httpd -l to view all the modules that are compiled inside the Apache httpd daemon.
[root@localhost src]# /usr/local/apache2/bin/httpd -l Compiled in modules: core.c mod_so.c http_core.c prefork.c
I hope this help, else I advise you to go see :Â http://jasonpowell42.wordpress.com/2013/04/05/install-apache-2-4-4-on-centos-6-4/
- Jquery webcam plugin - June 19, 2016
- How To Add and Delete Users on a CentOSServer - June 5, 2016
- How To Set Up vsftpd on CentOS 6 - June 5, 2016