源代码安装示例-----Apache服务器
1、
登录www.apache.org 网站下载linux版,文件名 httpd-version.tar.gz(version为版本号,有 tar.bz2和tar.gz两个版本)
2、
httpd-2.4.43.tar.gz http://httpd.apache.org/download.cgi#apache24
3、 apr-1.7.0.tar.gz https://apr.apache.org/download.cgi
4、apr-util-1.6.1.tar.gz http://us.mirrors.quenda.co/apache//apr/
5、 pcre-8.44.tar.gz https://ftp.pcre.org/pub/pcre/
6、安装apr:
#tar -zxvf apr-1.7.0.tar.gz
#cd apr-1.7.0
#./configure --prefix=/usr/local/apr
#make
#make install
7、安装apr-util:
#tar -zxvf apr-util-1.6.1.tar.gz
#cd apr-util-1.6.1
#./configure --with-apr=/usr/local/apr
#make
#make install
问题:
xml/apr_xml.c:35:19: fatal error: expat.h: No such file or directory
yum install expat-devel
8、安装pcre:
#tar -zxvf pcre-8.4.4.tar.gz
#cd pcre-8.4.4
#./configure --prefix=/usr/local/pcre
#make
#make install
9、安装apache2.4:
#tar -zxvf httpd-2.4.43.tar.gz
#cd httpd-2.4.43
#./configure --prefix=/usr/local/apache24 --enable-so
–with-apr=/usr/local/apr/ --with-apr-util=/usr/local/apr/
–with-pcre=/usr/local/pcre/
#make
#make install
Apache安装成功!
10、启动Apache
cd /usr/local/apache24/bin
sudo ./apachectl start
ldd httpd //查看httpd所依赖的库
sudo ldconfig
ldd httpd
sudo ./apachectl
在浏览器中输入localhost,显示如下界面:
码字不易:求一小赞
来源:oschina
链接:https://my.oschina.net/u/4406372/blog/3229246