Compile and install httpd2.4.10 in CentOS 6.6
The system installation package is CentOS-6.6-x86_64-minimal.iso
View uname Information
[Root @ localhost ~] # Uname-
Linux localhost. localdomain 2.6.32-504. el6.x86 _ 64 #1 SMP Wed Oct 15 04:27:16 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
[Root @ localhost ~] # Yum install-y vim wget lrzsz
Your installation package: httpd-2.4.10.tar.bz2?apr-1.5.1.tar.bz2 (Apache portable Run-time libraries##apr-util-1.5.4.tar.bz2.
Go to the official website of apache.org.
[Root @ localhost src] # pwd
/Usr/local/src
[Root @ localhost src] # ls
Apr-1.5.1.tar.bz2 apr-util-1.5.4.tar.bz2 httpd-2.4.10.tar.bz2
[Root @ localhost src] # tar jxvf apr-1.5.1.tar.bz2
[Root @ localhost src] # tar jxvf apr-util-1.5.4.tar.bz2
[Root @ localhost src] # tar jxf httpd-2.4.10.tar.bz2
[Root @ localhost src] # mv apr-1.5.1 httpd-2.4.10/srclib/apr
[Root @ localhost src] # mv apr-1.5.1 httpd-2.4.10/srclib/apr-util
[Root @ localhost src] # more httpd-2.4.10/INSTALL
Download the latest versions and unpack them to./srclib/apr and./srclib/apr-util (no version numbers in the directory names)
Install components before Compilation
[Root @ localhost httpd-2.4.10] # yum install-y gcc pcre-devel
Configure and compile and install
[Root @ localhost httpd-2.4.10] #./configure -- prefix =/usr/local/apache2 -- with-defined ded-apr
[Root @ localhost httpd-2.4.10] # make
[Root @ localhost httpd-2.4.10] # make install
Open Port 80 of the firewall and disable selinux by the way.
[Root @ localhost ~] # Vim/etc/sysconfig/iptables
...
-A input-m state -- state NEW-m tcp-p tcp -- dport 22-j ACCEPT
-A input-m state -- state NEW-m tcp-p tcp -- dport 80-j ACCEPT
...
[Root @ localhost ~] #/Etc/init. d/iptables reload
Iptables: Trying to reload firewall rules: [OK]
[Root @ localhost ~] # Getenforce
Enforcing
[Root @ localhost ~] # Setenforce 0
[Root @ localhost ~] # Getenforce
Permissive
Copy the Startup File
[Root @ localhost ~] # Cp/usr/local/apache2/bin/apachectl/etc/init. d/httpd
[Root @ localhost ~] # Chmod + x/etc/init. d/httpd
[Root @ localhost ~] #/Etc/init. d/httpd start
AH00558: httpd: cocould not reliably determine the server's fully qualified domain name, using localhost. localdomain. Set the 'servername' directive globally to suppress this message
It is uncomfortable to report an error, although it does not affect
[Root @ localhost ~] # Vim/usr/local/apache2/conf/httpd. conf
...
ServerName 192.168.128.152
...
[Root @ localhost ~] #/Etc/init. d/httpd graceful
Access is tested by the customer. Normal OK.
Configure Apache httpd in Linux
Install Apache httpd in Linux
LAMP (httpd-2.4.18 + mysql-5.5.47 + php-5.6.16) Environment Based on CentOS 6.7
Compile and install Apache httpd 2.4 in Linux
CentOS 6 compiled httpd-2.4.10