2016-12-07 76 views
0

我尝试使用tar文件安装apache webserver。所以,我已经下载了httpd-2.4.tar文件并解压。虽然apachectl开始获取打开共享对象文件

然后,我尝试安装

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 /本地/ 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/

* .so文件不存在,只有* u和* .la文件都在那里,

参考:

enter image description here

我follw这个link搜索* .so文件,是不在那里。所以,我resinstalled但同样的问题,只是创建* .la和* .a文件,而不是* .so文件,

于是,我试图改变/apache/conf/httpd.conf

的LoadModule authn_core_module模块/ mod_authn_core.so的LoadModule authn_core_module模块/ 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。

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

回答

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 
相关问题