在编译apache(在安装httpd-2.4.3时遇到的问题;httpd-2.2.23版本无问题)时出现了apr not found、APR-util not found、pcre-config for
libpcre not found的问题,下面就这些问题的解决来实际操作一把。
http://apr.apache.org/download.cgi 下载apr-1.4.5.tar.gz、apr-util-1.3.12.tar.gz
1.解决apr not found问题——————>
[root@yahoo test]# tar -zxf apr-1.4.5.tar.gz
[root@yahoo apr-1.4.5]# ./configure --prefix=/usr/local/apr
[root@yahoo apr-1.4.5]# make
[root@yahoo apr-1.4.5]# make install
2.解决APR-util not found问题>>>>
[root@yahoo test]# tar -zxf apr-util-1.3.12.tar.gz
[root@yahoo apr-util-1.3.12]# ./configure --prefix=/usr/local/apr-util -with-apr=/usr/local/apr/bin/apr-1-config
[root@yahoo
apr-util-1.3.12]# make
[root@yahoo apr-util-1.3.12]# make install
3、解决pcre-config for
libpcre not found问题
下载pcre-8.31.zip,http://sourceforge.net/projects/pcre/files/latest/download
[root@localhost ~]# unzip pcre-8.31.zip
[root@localhost ~]# cd pcre-8.31
[root@localhost pcre-8.31]# ./configure
--prefix=/usr/local/pcre
[root@localhost pcre-8.31]# make
[root@localhost pcre-8.31]#
make install
安装apache:
进入解压后的apache目录执行下面的参数
[root@localhost httpd-2.4.3]#
./configure --prefix=/usr/local/apache2 --with-apr=/usr/local/apr
--with-apr-util=/usr/local/apr-util/ --with-pcre=/usr/local/pcre
[root@localhost httpd-2.4.3]#
Make
[root@localhost httpd-2.4.3]#
Make install
启动:/usr/local/apache2/bin/apachectl
start
重启:service httpd restart
然后把网站放在/var/www/html中
[root@localhost bin]# ls -lrt
总用量1832
-rw-r--r-- 1 root root
1073 10月31 15:00 envvars-std
-rw-r--r-- 1 root root
1073 10月31 15:00 envvars
-rwxr-xr-x 1 root root
8925 10月31 15:00 dbmmanage
-rwxr-xr-x 1 root root 23525 10月31 15:00 apxs
-rwxr-xr-x 1 root root
3437 10月31 15:00 apachectl
-rwxr-xr-x 1 root root
29886 10月31 15:01 rotatelogs
-rwxr-xr-x 1 root root
17306 10月31 15:01 logresolve
-rwxr-xr-x 1 root root
16287 10月31 15:01 httxt2dbm
-rwxr-xr-x 1 root root
25187 10月31 15:01 htpasswd
-rwxr-xr-x 1 root root
17020 10月31 15:01 htdigest
-rwxr-xr-x 1 root root
23367 10月31 15:01 htdbm
-rwxr-xr-x 1 root root
56424 10月31 15:01 htcacheclean
-rwxr-xr-x 1 root root
15682 10月31 15:01 fcgistarter
-rwxr-xr-x 1 root root
9562 10月31 15:01 checkgid
-rwxr-xr-x 1 root root
101439 10月31 15:01 ab
-rwxr-xr-x 1 root root 1480517 10月31 15:01 httpd
[root@localhost bin]# apachectl start
httpd (pid 31452) already running
[root@localhost bin]# service httpd
restart
停止httpd:[ 确定 ]
启动httpd:[ 确定 ]
[root@localhost bin]# pwd
/usr/local/apache2/bin
[root@localhost bin]#