Apache 服务未启动

Tar*_*run 5 server apache2

尝试使用以下方法安装 apache 2.4.4 版时:

来源:http: //zhuojun.info/?p=1121

在安装Apache 2.4.4之前,应该先安装PCRE,否则不会成功。安装 PCRE 的过程很简单。下载后,在终端中运行下一个命令:

sudo ./configure
sudo make
sudo make install
Run Code Online (Sandbox Code Playgroud)

http://apr.apache.org下载 APR 和 APR-Util ,将它们解压到 Apache 目录,/srclib/apr然后/srclib/apr-util(目录名称中没有版本号)并键入以下命令来安装 Apache:

sudo ./configure --with-included-apr
sudo make
sudo make install
Run Code Online (Sandbox Code Playgroud)

输入以下命令启动Apache:

sudo /usr/local/apache2/bin/apachectl start
Run Code Online (Sandbox Code Playgroud)

可能有一些错误,例如:

/usr/local/apache2/bin/httpd: error while loading shared libraries: libpcre.so.1: cannot open shared object file: No such file or directory
Run Code Online (Sandbox Code Playgroud)

键入以下命令以查看 httpd 的共享库依赖项:

ldd httpd
Run Code Online (Sandbox Code Playgroud)

找到“libpcre.so.1 => not found”,然后输入以下命令更新链接:

sudo ldconfig
Run Code Online (Sandbox Code Playgroud)

重新启动 Apache 并且应该可以工作。

一切似乎都很好,但是当我尝试启动 apache 服务时出现错误:

root@server1:/usr/local/apache2/bin# /etc/init.d/apache2 start
 * Starting web server apache2                                                  /usr/sbin/apache2: symbol lookup error: /usr/sbin/apache2: undefined symbol: apr_ldap_url_parse
Action 'start' failed.
The Apache error log may have more information.
                                                                         [fail]
Run Code Online (Sandbox Code Playgroud)

我尝试再次安装 apr,但似乎没有任何效果。请帮忙。

Apache 日志显示如下内容:

[Mon Jun 17 10:31:08 2013] [notice] Apache/2.2.22 (Ubuntu) PHP/5.3.10-1ubuntu3.6 with Suhosin-Patch configured -- resuming normal operations
[Mon Jun 17 11:48:20 2013] [notice] Apache/2.2.22 (Ubuntu) PHP/5.3.10-1ubuntu3.6 with Suhosin-Patch configured -- resuming normal operations
[Mon Jun 17 15:44:36 2013] [notice] Apache/2.2.22 (Ubuntu) PHP/5.3.10-1ubuntu3.6 with Suhosin-Patch configured -- resuming normal operations
Run Code Online (Sandbox Code Playgroud)

Dav*_*rds 3

根据您的评论,Apache 似乎无法启动,因为它在编译时没有找到 APR。configure这是因为运行时源文件不在正确的位置。你需要:

  • 将 APR 和 APR-Util 解压到srclib目录内的目录中httpd-2.4.4
  • cdhttpd-2.4.4目录并运行:

    sudo ./configure --with-included-apr

    sudo make

    sudo make install