1. 程式人生 > >apache源碼安裝

apache源碼安裝

org 下載 -i libtool con bz2 nload amp rmi

1.apr和apr-util,下載地址: http://apr.apache.org/download.cgi

yum install gcc
yum install libtool
yum install expat-devel
yum install pcre-devel

cd apr-1.6.3/
./configure --prefix=/opt/apr

出現以下錯誤

rm: cannot remove libtoolT: No such file or directory

include/arch/unix/apr_private.h is unchange
cp configure ./configure.bak
vi configure #$RM “$cfgfile” #註釋掉這行
:wq

!./configure --prefix #重新執行上一次相同的命令
make -j 4 #四核運行
make install

tar -zxvf apr-util-1.6.1.tar.bz2 #註意不要下載apr-util-1.6.1.tar.gz這個gz文件會出現安裝錯誤
cd apr-util-1.6.1
./configure --prefix=/opt/apr-util --with-apr=/opt/apr
make && make instal

2. 下載安裝pcre【如果以及yum安裝則跳過此步】

wget
https://ftp.pcre.org/pub/pcre/pcre2-10.30.tar.gz tar -zxvf pcre2-10.30.tar.gz cd pcre2-10.30 ./configure --prefix=/opt/pcre make && make installyum -y install pcre-devel

3.安裝apache

./configure --prefix=/opt/apache --with-apr=/opt/apr --with-apr-util=/opt/apr-util --with-include-apr --enable-so
make && make
install

4.你會發現apache stop|restart|start都不成功

Could not reliably determine the servers fully qualified domain name

解決辦法

vi httpd.conf
#ServerName www.example.com:80 
#修改為
ServerName localhost:80

apache源碼安裝