1、安装apr
1
2
3
4
5
|
yum -y
install
gcc gcc-c++ openssl-devel pcre-devel
tar
xf apr-1.4.6.
tar
.bz2
cd
apr-1.4.6
.
/configure
--prefix=
/usr/local/apr
--disable-ipv6
make
&&
make
install
|
2、安装apr-util
1
2
3
4
|
tar
xf apr-util-1.4.1.
tar
.bz2
cd
apr-util-1.4.1
.
/configure
--prefix=
/usr/local/apr-util
--with-apr=
/usr/local/apr
make
&&
make
install
|
3、安装apache
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
tar
zxf httpd-2.4.17.
tar
.gz
cd
httpd-2.4.17
.
/configure
\
.
/configure
\
--prefix=
/usr/local/apache
\
--sysconfdir=
/etc/httpd
\
--
enable
-so \
--
enable
-ssl \
--
enable
-cgi \
--
enable
-rewrite \
--with-zlib \
--with-pcre \
--with-apr=
/usr/local/apr
\
--with-apr-util=
/usr/local/apr-util
\
--
enable
-modules=most \
--
enable
-mods-shared=most \
--
enable
-mpms-shared=all \
--with-mpm=event
make
&&
make
install
|
4、设置服务控制脚本
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
cp
build
/rpm/httpd
.init
/etc/init
.d
/httpd
vim
/etc/init
.d
/httpd
httpd=${HTTPD-
/usr/local/apache/bin/httpd
}
pidfile=${PIDFILE-
/usr/local/apache/logs/
${prog}.pid}
lockfile=${LOCKFILE-
/var/lock/subsys/
${prog}}
RETVAL=0
# check for 1.3 configuration
check13 () {
CONFFILE=
/etc/httpd/httpd
.conf
echo
"PATH=/usr/local/apache/bin:$PATH"
>>
/etc/profile
.d
/http
.sh
.
/etc/profile
.d
/http
.sh
ln
-s
/usr/local/apache/include/
/usr/include/httpd
vim
/etc/httpd/httpd
.conf
ServerName localhost:80
chkconfig --add httpd
chkconfig httpd on
service httpd start
|
本文转自1321385590 51CTO博客,原文链接:http://blog.51cto.com/linux10000/1717541,如需转载请自行联系原作者