Download Apache httpd
# Wget http://mirrors.cnnic.cn/apache//httpd/httpd-2.4.10.tar.gz
2. Decompress Apache httpd
# Tar xzvf httpd-2.4.10.tar.gz
Compile Apache httpd
[[Email protected] #./configure
Checkingfor chosen layout... Apache
Checkingfor working mkdir-p... yes
Checkingfor grep that handles long lines and-e.../bin/grep
Checkingfor egrep.../bin/grep-e
Checkingbuild system type... i686-pc-linux-gnu
Checkinghost system type... i686-pc-linux-gnu
Checkingtarget system type... i686-pc-linux-gnu
Configure:
Configure: logging ing Apache Portable Runtime library...
Configure:
Checkingfor APR... no
Configure: Error: Apr not found. Please read thedocumentation.
It indicates that you need to install Apr, APR-util, and Prce before compiling httpd.
3. Install APR
# Wget http://mirrors.hust.edu.cn/apache//apr/apr-1.5.1.tar.gz
# Wget http://mirrors.hust.edu.cn/apache//apr/apr-util-1.5.3.tar.gz
# Tar xzvf apr-1.5.1.tar.gz
# Cd apr-1.5.1.tar.gz
#./Configure -- prefix =/usr/local/APR
# Make
# Make install
Install Apr-util
# Tar xzvf apr-util-1.5.3.tar.gz
# Cd apr-util-1.5.3
#./Configure -- prefix =/usr/local/APR-util -- With-Apr =/usr/local/APR/bin/apr-1-config
# Make
# Make install
4. Install the C ++ Compiler
#Yum-y install gcc
# Yum-y install gcc-C ++
5. Install Prce
# Wget http://downloads.sourceforge.net/project/pcre/pcre/8.35/pcre-8.35.tar.gz? R = http % 3A % 2f % 2fsourceforge.net % 2 fprojects % 2 fpcre % 2 ffiles % 2 fpcre % 2f8. 35% 2f & TS = 1407339176 & use_mirror = jaist
# Tar xzvf pcre-8.35.tar.gz
# Cd pcre-8.35
#./Configure -- prefix =/usr/local/PCRE
# Make & make install
6. Compile httpd
#. /Configure -- prefix =/usr/local/apache2 -- With-Apr =/usr/local/APR -- With-Apr-util =/usr/local/APR-util/-- -PCRE =/usr/local/PCRE
# Make & make install
7. Disable or disable port 80 on the firewall
#/Sbin/iptables-I input-P TCP -- dport 80-J accept
#/Sbin/iptables-I input-P TCP -- dport 22-J accept
#/Etc/rc. d/init. d/iptables save
After the computer is restarted, the firewall has opened ports 80 and 22 by default.
Temporarily shut down the firewall completely without restarting the machine:
#/Etc/init. d/iptables status # view the Firewall Status
#/Etc/init. d/iptable stop # disable the firewall this time
#/Etc/init. d/iptable restart # restart the Firewall
Or permanently disable the Firewall:
# Chkconfig -- level 35 iptables off# Note that there are two short-term British short-term in the middle; restart
8. Start Apache httpd
/Usr/local/apache2/bin/apachectl
9. Enter http: // 192.168.146.128/in the browser to display the it works page, indicating that the apachehttp server is successfully installed!
This article is from the "Cape technology" blog, please be sure to keep this source http://kypulo.blog.51cto.com/9227739/1536675