而apachectl开始获取打开的共享对象文件

时间:2016-12-07 14:30:10

标签: apache server webserver httpd.conf .so

我尝试使用tar文件安装apache webserver。所以,我已经下载了httpd-2.4.tar文件并解压缩。

然后,我尝试安装

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

但是,抛出,这个错误

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

 configure: error: pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/

所以,请点击此链接并修复此issue1issue2

然后,运行以下命令:

1.  $./configure \
--with-included-apr \
--with-pcre=/usr/local/pcre/bin/pcre-config \
--prefix=/usr/local/apache


2. $ make 

3. $ make install

之后/我转到/ usr / local / apache /

启动服务

 $  bin/apachectl -k start 

抛出以下错误:

    httpd: Syntax error on line 66 of /usr/local/apache/conf/httpd.conf: Cannot load modules/mod_authn_file.so into server: /usr/local/apache/modules/mod_authn_file.so: cannot open shared object file: No such file or directory

转到 apache / modules /

*。所以不存在文件,只有* .a和* .la文件,

参考:

enter image description here

我将此link发送到搜索* .so文件,不存在。所以,我安装了但同样的问题只有创建* .la和* .a文件而不是* .so文件,

然后,我尝试更改 /apache/conf/httpd.conf

LoadModule authn_core_module modules / mod_authn_core.so LoadModule authn_core_module modules / mod_authn_core.la

更改后,

 httpd: Syntax error on line 66 of /usr/local/apache/conf/httpd.conf: Cannot load modules/mod_authn_file.la into server: /usr/local/apache/modules/mod_authn_file.la: invalid ELF header

建议我,我如何解决这个问题及其原因,创建* .a,* .la文件而不是* .so。

*。所以文件更新为* .la文件?,如果最新意味着为什么不能支持?

1 个答案:

答案 0 :(得分:0)

你在哪里解开httpd的来源?还有那个名字" httpd-2.4.tar"当然不是官方下载。

在任何情况下,.la和.a文件都附带源代码,它们不是模块,您可以使用vim查看它们以查看它们是什么(至少是.la文件)

Follow these steps:

* Download from the original source: http://httpd.apache.org/download.cgi
* Untar onto ~/source-httpd/
* cd ~/source-httpd/
* rm -Rf /usr/local/apache (or whatever you had there)
* ./configure --prefix=/usr/local/apache --enable-mpms-shared=all --with-mpm=event --enable-mods-shared=all (.... and any other options)
* Review the ouput for missing libs and functionality you may need, install necessary lips and run "configure" again with the same parameters or adjusted to your needs
* make && make install
* ls -l /usr/local/apache/modules to check the .so files are really there.
* Configure and run httpd accordingly