linux mint 安装apache2.4

这是官网上给的操作步骤:

Download $ lynx http://httpd.apache.org/download.cgi
Extract $ gzip -d httpd-NN.tar.gz
$ tar xvf httpd-NN.tar
$ cd httpd-NN
Configure $ ./configure --prefix=PREFIX
Compile $ make
Install $ make install
Customize $ vi PREFIX/conf/httpd.conf
Test PREFIX/bin/apachectl -k start
安装时可能会遇到的一些问题:

1.在configure时,会提示需要APR and APR-Util

官方网站说:
Make sure you have APR and APR-Util already installed on your system. If you don't, or prefer to not use the system-provided versions, download the latest versions of both APR and APR-Util from Apache APR, unpack them into ./srclib/apr and ./srclib/apr-util (be sure the directory names do not have version numbers; for example, the APR distribution must be under ./srclib/apr/) 

也就是到apr.apache.org下载,解压后放到/srclib/下,并把版本号去掉。

2.在configure时,会提示需要pcre

到这里下载:http://www.pcre.org,

下载后编译安装:

./configure

make

make install

pcre在configure时提示需要c++编译器:sudo apt-get install build-essential

3.在启动apache时,提示找不到libpcre.so.1

先查看httpd的依赖库信息:

ldd httpd

然后搜索libpcre.so.1文件,发现该文件在/usr/local/lib目录下。

那么就在/etc/ld.so.conf.d目录下新建文件libc.conf,将/usr/local/lib目录加到该文件:
/usr/local/lib


接下来执行ldconfig命令:
sudo ldconfig


最后使用ldd命令确认libpcre.so.1是否已找到:


4.配置ServerName,在conf/httpd.conf里。


这时应该可以正常启动了。


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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值