While apachectl start getting open shared object file

為{幸葍}努か 提交于 2021-02-05 08:10:45

问题


I try to install apache webserver using tar file. So, I have download httpd-2.4.tar file and extract.

then, I try to install

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

but, throw, this error

 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/

so, follow this link and fix this issue1 and issue2

Then, run following command:

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


2. $ make 

3. $ make install

After that / I go to /usr/local/apache/

Start the Service:

 $  bin/apachectl -k start 

Throw below error:

    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

go to apache/modules/

*.so files not there, only *.a and *.la file are there,

Reference:

I follw this link to Search *.so files , is not there. So, I resinstalled but same issue only create *.la and *.a files instead of *.so files,

Then, I try to change /apache/conf/httpd.conf

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

after Change,

 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

Suggest me, How can i fix this issue and why, create *.a, *.la file instead of *.so.

*.so files updated to *.la files?, if latest means why cannot support?


回答1:


Where did you untar the source for httpd? Also that name "httpd-2.4.tar" certainly does not sound as an official download.

In any case, .la and .a files come with the source, they are not modules, you can view them with vim to see what they are (at least the .la files)

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


来源:https://stackoverflow.com/questions/41020050/while-apachectl-start-getting-open-shared-object-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!