之前的环境是Apache 2.2.3 + SVN1.6.12 + PHP5.2.8 + MySQL5.1.51 + SVNManager1.0.5 , 因为有安全漏洞,要求升级Apache和PHP到最新版本。
1.首先备份配置库
2.停止正在运行的Apache和SVN服务
[root@huadi-160219095359 opt]# service apache stop
[root@huadi-160219095359 opt]# ps -ef|grep svn
svn 2179 1 0 Mar30 ? 00:00:00 svnserve -d --listen-port 9999 -r /opt/svndata
root 18825 18484 0 10:08 pts/0 00:00:00 grep svn
[root@huadi-160219095359 opt]# kill -9 2179
3.升级Apache,等同于重新安装
因为Apache下载的是最新版本2.4.16,所以APR,Apr-util和PCRE下载的都是最新版本。
PCRE8.3.7
ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/
APR1.5.2和Apr-util1.5.4
http://apr.apache.org/download.cgi
进入APR解压目录
[root@huadi-160219095359 apr-1.5.2]# ./configure --prefix=/usr/local/apr
[root@huadi-160219095359 apr-1.5.2]# make && make install
进入APR-util解压目录
[root@huadi-160219095359 apr-util-1.5.4]# ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
[root@huadi-160219095359 apr-util-1.5.4]# make && make install
进入pcre解压目录
[root@huadi-160219095359 pcre-8.37]# ./configure --prefix=/usr/local/pcre
[root@huadi-160219095359 pcre-8.37]# make && make install
进入Apache解压目录
[root@huadi-160219095359 httpd-2.4.16]# cp -rf /usr/local/apr-1.5.2 srclib/apr
[root@huadi-160219095359 httpd-2.4.16]# cp -rf /usr/local/apr-util-1.5.4 srclib/apr-util
[root@huadi-160219095359 httpd-2.4.16]# ./configure --prefix=/usr/local/apache --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --with-pcre=/usr/local/pcre --enable-module=so --with-included-apr --enable-dav --enable-dav-fs --enable-so
[root@huadi-160219095359 httpd-2.4.16]# make && make install
4. 配置Apache
[root@localhost]# cd /usr/local/apache/conf/
[root@localhost conf]# vi httpd.conf
修改 Listen 80 ==》 Listen 8000
(把端口号80改成8000)
ServerName www.example.com:80 ==》ServerName localhost:8000
5.启动 Apache
[root@huadi-160219095359 conf]# service apache start
需要说明的是,红色字体部分是必须要做的,如果不做的话,启动Apache服务时会出现如下错误:
httpd: Syntax error on line 140 of /usr/local/apache/conf/httpd.conf: Cannot load /usr/local/apache/modules/mod_dir.so into server: /usr/local/apache/modules/mod_dir.so: undefined symbol: apr_array_clear
转载:https://blog.csdn.net/w171066/article/details/51093319