Linux学习笔记 10(搭建apache服务器(一))

1. mkdir soft(创建一个software安装文件夹(不是重要步骤))

2.cd soft

3.下载appache,我下载的是httpd-2.4.9,貌似2.4版本后开始是个大坑,安装各种报错,排坑ing

wget http://archive.apache.org/dist/httpd/httpd-2.4.9.tar.g

4.解压

tar zxf httpd-2.4.9.tar.gz

5. cd httpd-2.4.9

6. 开始第一次失败尝试安装!!!!

yum install apr apr-util apr-util-devel    (httpd 2.4版本后貌似这个无效了!!!后续还是还是要继续安装....等等库)

7.  ./configure --prefix=/usr/local/apache

configure: error: APR not found.  Please read the documentation.

报错!!!我明明装了APR呀!!!(绝望ing)

8. ./configure -help | grep apr     查看文档,其实没看出好歹来(气呀),继续baidu

9.貌似重新下载安装apr,apr-util ,pcre (为啥是pcre啊啊啊??)

APR

cd ..

wget http://archive.apache.org/dist/apr/apr-1.7.0.tar.g

tar zxf apr-1.7.0.tar.gz

cd apr-1.7.0

./configure --prefix=/usr/local/apr

make

make install 

10.apr-util

cd ..

wget http://archive.apache.org/dist/apr/apr-util-1.6.1.tar.gz

tar zxf apr-util-1.6.1.tar.gz

cd apr-util-1.6.1

./configure --prefix=/usr/local/apr-util

报错configure: error: APR could not be located. Please use the --with-apr option.

又报APR错误,方的呀,还好问题不大,主要是却少了apr的配置路径,加上去就好

./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr

make

又报错~吐血三升

xml/apr_xml.c:35:19: 错误:expat.h:没有那个文件或目录

缺少expat.h库

yum install expat-devel

make

make install 

剩下最后一个啊啊啊啊啊,prec,希望不要在出错了,我已经没有血可以吐了

11.pcre

cd..

wget http://ftp.pcre.org/pub/pcre/pcre-8.43.tar.gz

tar zxf pcre-8.43.tar.gz

cd pcre-8.43

./configure --prefix=/usr/local/prce

make

make install

12.最后最后了,结果还是崩溃了

cd..

cd httpd-2.4.9

./configure --prefix=/usr/local/apache --with-apr-util=/usr/local/apr-util --with-pcre=/usr/local/pcre

make&&make install

报错

make[2]: [htpasswd] 错误 1
make[2]: 离开目录“/usr/local/src/httpd-2.4.27/support”
make[1]: [all-recursive] 错误 1
make[1]: 离开目录“/usr/local/src/httpd-2.4.27/support”
make: *** [all-recursive] 错误 

make install

参考:https://blog.csdn.net/qq_41772936/article/details/80878635

cd /soft/
cp -r apr-1.7.0  /soft/httpd-2.4.9/srclib/apr
cd apr-1.7.0
./configure --prefix=/usr/local/apr
make && make install

cd..
cp -r apr-util-1.6.1  /soft/httpd-2.4.9/srclib/apr-util
cd apr-util-1.6.1
./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
make && make install

cd..
cp -r pcre-8.43  /soft/httpd-2.4.9/srclib/pcre
cd /usr/pcre-8.43 
./configure --prefix=/usr/local/pcre
make && make install

cd..
cd httpd.2.4.9
./configure --prefix=/usr/local/apache --with-apr-util=/usr/local/apr-util --with-pcre=/usr/local/pcre
make && make install

----------------------------------------------------------------------------------------------------------------------------------------------------------------

待续.......

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值