已经安装过mysql
从官网下载了httpd-2.4.2.tar.gz
地址:http://httpd.apache.org/download.cgi#apache24
将该文件从下载文件夹 cp到 /usr/src下面
cp httpd-2.4.2.tar.gz /usr/src
cd /usr/src
gunzip -c httpd-2.4.2.tar.gz | tar xvf -
cd httpd-2.4.2
.configure --prefix=/usr/local/apache2
出现如下错误:
checking for chosen layout... Apache
checking for working mkdir -p... yes
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-linux-gnu
Configuring Apache Portable Runtime library ...
checking for APR... no
configure: error: APR not found. Please read the documentation.
APR找不到???
http://code.sh/linux/apache%E9%81%87%E5%88%B0%E7%9A%84%E9%97%AE%E9%A2%98%EF%BC%9Aapr-not-found/
下载:http://apr.apache.org/download.cgi
#cd /usr/src (源码存放位置)
#gunzip -c apr-1.4.2.tar.gz | tar xvf -
#cd apr-1.4.2
#./configure
#make
#make install
这样,在/usr/local/下出现了apr文件夹
再次检查编译环境出现
checking for APR-util... no
configure: error: APR-util not found . Please read the documentation.
也就是没有apr-util这个文件 ,继续从官网上下载,解压,配置,make,make install
下载:http://apr.apache.org/download.cgi
root@xxl-pc:/home/xxl/下载# cd /usr/src
root@xxl-pc:/usr/src# gunzip -c apr-util-1.4.1.tar.gz | tar xvf -
#cd apr-1.4.2
root@xxl-pc:/usr/src# cd apr-util-1.4.1
root@xxl-pc:/usr/src/apr-util-1.4.1# ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
#make
#make install
这样,在在/usr/local/下出现了apr-util文件夹。
重新进入httpd文件夹
root@xxl-pc:/usr/src/apr-util-1.4.1# cd ..
root@xxl-pc:/usr/src# cd httpd-2.4.2
进行预配置:
root@xxl-pc:/usr/src/httpd-2.4.2# ./configure --prefix=/usr/local/apache2 --with-apr-util=/usr/local/apr-util --with-apr=/usr/local/apr
又出现错误:
error: pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/
PCRE又没有,去网站下载
下载:http://sourceforge.net/projects/pcre
root@xxl-pc:/usr/src# gunzip -c pcre-8.30.tar.gz | tar xvf -
#./configure --prefix=/usr/local/pcre
#cd pcre-8.30
#make
#make install
继续安装Apache/httpd,./configure 时加上参数 --with-apr=/usr/local/apr/ --with-apr-util=/usr/local/apr-util/ --with-pcre=/usr/local/pcre,这个问题就解决了
注意:Apache在安装时不会检查参数是否正确,错误的参数会直接被丢弃,不会报告给用户。但可以使用echo $?命令检查是否有错误,当输出结果为0时表示没有错误。
#echo $?
0
#make
#make install
#cp apachectl /sbin/
启动Apache
#apachectl start
添加对MySQL,Apache、PDFLib和gd的支持