2016-12-07 48 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 
相關問題