Apache Introduction
Apache is the world's most used Web server software. It can run on almost all of the widely used computer platforms due to its cross-
Platform and security are widely used, is one of the most popular Web server-side software. Apache Software uses a modular design model, divided into dynamic modules and static modules, static modules can not be added and unloaded at any time, at compile time settings, dynamic modules may be added and deleted at any time, there is great flexibility.
Installing Apache
installation package preparation,httpd Apr apr-util
[Email protected]~]# ll
Total Dosage 8604
-rw-r--r--. 1 root root 1031613 August apr-1.5.2.tar.gz
-rw-r--r--. 1 root root 874044 August apr-util-1.5.4.tar.gz
-rw-r--r--. 1 root root 6899517 August httpd-2.4.16.tar.gz
To start the installation:
1 Installing dependent Packages
[[Email protected]~]# yum-y Install OpenSSL openssl-devel zlib zlib-devel gcc gcc-c++ pcre pcre-devel
2 Installing APR
[Email protected]~]# tar zxvf apr-1.5.2.tar.gz
[[Email protected]~]# CD apr-1.5.2
[[Email protected]~]#./configure--prefix=/usr/local/apr \
--disable-static \
--enable-shared \
--with-installbuilddir=/usr/include/apr-1
If you have the following tips:
config.status:executing Libtool Commands
Rm:cannot remove ' Libtoolt ': No such file or directory
So modify configure: rm= ' $RM ' instead: rm= ' $RM-f '
[[Email protected]~]# make && make install
3 Installing Apr-util
[Email protected]~]# tar zxvf apr-util-1.5.4.tar.gz
[[Email protected]~]# CD apr-util-1.5.4
[[Email protected]~]#./configure--prefix=/usr/local/apr-util \
--WITH-APR=/USR/LOCAL/APR \
--WITH-GDBM \
--WITH-OPENSSL \
--with-crypto
[[Email protected]~]# make && make install
4 Installing Apache
[Email protected]~]# tar zxvf httpd-2.4.16.tar.gz
[Email protected]~]# cp apr-1.5.2/apr-util-1.5.4/httpd-2.4.16/srclib/-VFR
[[Email protected]~]# CD Httpd-2.4.16/srclib
[Email protected]~]# mv apr-1.5.2 Apr
[[Email protected]~]# mv apr-util-1.5.4 Apr-util
[Email protected]~]# cd/home/soft/httpd-2.4.16 #进入目录准备下一步编译
[[Email protected]~]#./configure--prefix=/usr/local/apache \
--enable-mods-shared=all \
--enable-cache \
--enable-cache-disk \
--ENABLE-SO \
--enable-modules=most \
--enable-proxy \
--enable-proxy-connect \
--ENABLE-PROXY-FTP \
--enable-proxy-http \
--ENABLE-PROXY-AJP \
--enable-proxy-balancer \
--ENABLE-SSL \
--enable-deflate \
--enable-expires \
--WITH-APR=/USR/LOCAL/APR \
--with-apr-util=/usr/local/apr-util \
--with-mpm=prefork
[[Email protected]~]# make && make install
[[Email protected]~]# mv/etc/httpd/etc/00-httpd
[Email protected]~]# ln-s/usr/local/apache/conf//etc/httpd
5 Modifying a configuration file
# vim/usr/local/apache/conf/httpd.conf
# # Get rid of the following lines before comments # #
LoadModule Slotmem_shm_module modules/mod_slotmem_shm.so
LoadModule Slotmem_plain_module modules/mod_slotmem_plain.so
LoadModule Deflate_module modules/mod_deflate.so
LoadModule Rewrite_module modules/mod_rewrite.so
# # Modify the Log format # #
Customlog Logs/access_log combined
Logformat Notice
# # Modify ServerName # #
ServerName localhost:80
# least Pidfile. # Add a line below this line:
Pidfile/var/run/httpd/httpd.pid
# Modify the time format of the log record
Logformat "%h%l%u [%{%y-%m-%d%h:%m:%s}t] \"%r\ "%>s%b \"%{referer}i\ "\"%{user-agent}i\ "combined
Logformat "%h%l%u [%{%y-%m-%d%h:%m:%s}t] \"%r\ "%>s%b" common
6 Configuring Apache Startup and Stop scripts
# VIM/ETC/INIT.D/HTTPD
# # Modify the following content:
Apachectl=/usr/local/apache/bin/apachectl
HTTPD=${HTTPD-/USR/LOCAL/APACHE/BIN/HTTPD}
Prog=httpd
Pidfile=${pidfile-/var/run/httpd/httpd.pid}
LOCKFILE=${LOCKFILE-/VAR/LOCK/SUBSYS/HTTPD}
Retval=0
STOP_TIMEOUT=${STOP_TIMEOUT-10}
7 Launching the Apache service
[[Email protected]~]# service httpd start
[[Email protected]~]# iptables-f
[[Email protected]~]# service iptables stop
[[Email protected]~]# setenforce 0
[Email protected]~]# netstat-lnpt |grep httpd
Enter 192.168.1.6 in the browser to access the result
It works!, the installation configuration is successful.
This article is from the "Practical Linux knowledge and Skills sharing" blog, please be sure to keep this source http://superleedo.blog.51cto.com/12164670/1890046
Apache Server installation and configuration detailed