当前位置: 首页 >> 原创·技术 >> apache 报错解决方法 >> 正文

apache 报错解决方法

5年前 (2019-10-24)     作者:iMoke     分类:原创·技术     阅读次数:5308     评论(0)    
版本:apache 2.4.33ERROR:AH00534: httpd: Configuration error: More than one MPM loaded.解决方法:apache/conf/httpd.confmod_mpm_event.so 和 mod_mpm_prefork.so 都关掉。宝塔Linux面板,apache2.4增加ldap模块方法(默认路径/www)先使用面板编译安装apache2.4,重新编译apryum install -y ex

版本:apache 2.4.33

ERROR:

AH00534: httpd: Configuration error: More than one MPM loaded.

解决方法:apache/conf/httpd.conf

mod_mpm_event.so 和 mod_mpm_prefork.so 都关掉。



宝塔Linux面板,apache2.4增加ldap模块方法

(默认路径/www)

先使用面板编译安装apache2.4,


重新编译apr

yum install -y expat-devel openldap-devel
cd /root
wget http://d.rc.it/Server/ApachePortableRuntimeProject/apr-1.6.5.tar.gz
#wget http://mirrors.tuna.tsinghua.edu.cn/apache//apr/apr-1.6.5.tar.gz
tar zxvf apr-1.6.5.tar.gz
cd apr-1.6.5
./configure --prefix=/www/server/apache/bin/
make && make install



重新编译apr-until

yum install -y expat-devel openldap-devel
cd /root
wget http://d.rc.it/Server/ApachePortableRuntimeProject/apr-util-1.6.1.tar.gz
#wget http://mirrors.tuna.tsinghua.edu.cn/apache/apr/apr-util-1.6.1.tar.gz
tar zxvf apr-util*
cd apr-util-1.6.1
./configure --prefix=/www/server/apache/bin/ --with-ldap --with-apr=/www/server/apache/bin/apr-1-config
make && make install


然后升级系统的libtool

mv /usr/bin/libtool /usr/bin/libtool2.2.6b
cp /www/server/apache/build/libtool /usr/bin/libtool

重新编译apache

cd /root
wget http://d.rc.it/Server/Apachehttpd/httpd-2.4.43.tar.gz
#wget http://dg2.bt.cn/src/httpd-2.4.43.tar.gz
tar zxvf httpd-2.4.*.tar.gz 
cd httpd-2.4.*
#make clean all
./configure --prefix=/www/server/apache --enable-mods-shared=most --enable-headers --enable-mime-magic --enable-proxy --enable-so --enable-rewrite --with-ssl=/usr/local/openssl111 --with-nghttp2=/usr/local/nghttp2 --enable-ssl --enable-deflate --with-pcre --with-apr=/www/server/apache/bin/ --with-apr-util=/www/server/apache/bin/ --enable-mpms-shared=all --enable-nonportable-atomics=yes --enable-remoteip --enable-http2 --enable-lua CFLAGS=-I/usr/local/openssl111/include LIBS=-L/usr/local/openssl111/lib --enable-ldap --enable-authnz-ldap --with-ldap
make && make install

修改httpd.conf文件(/www/server/apache/conf/httpd.conf)

增加
#imoke_start
LoadModule ldap_module modules/mod_ldap.so
LoadModule authnz_ldap_module modules/mod_authnz_ldap.so
#imoke_end

修改对应虚拟主机的配置文件

    #PATH
    <Directory "/www/wwwroot/who.mmoke.com">
        SetOutputFilter DEFLATE
        Options FollowSymLinks
        AllowOverride All
        Require all granted
        DirectoryIndex index.php
    </Directory>

改成

    #PATH
    <Directory "/www/wwwroot/who.mmoke.com">
AuthType basic
AuthName "LDAP Authentication "
AuthBasicProvider ldap
AuthLDAPURL ldap://<yourserver>:389/OU=people,DC=<yourdomain>,DC=<yourdomainroot>?sAMAccountName
AuthLDAPBindDN CN=<yourusername>,OU=people,DC=<yourdomain>,DC=<yourdomainroot>
AuthLDAPBindPassword <yourpassword>
Require valid-user
LDAPReferrals Off
DirectoryIndex index.php
    </Directory>

搞定


宝塔Linux面板,PHP增加LDAP模块

(默认路径/www)

先使用面板编译安装php(这里以php7.3为例)

然后,找到php源码包,如果系统中没有,可以重新下载

cd /root
#wget https://www.php.net/distributions/php-7.3.10.tar.gz
wget http://d.rc.it/Server/php/php-7.3.10.tar.gz

tar zxvf php-7.3.10.tar.gz
cd php-7.3.10/ext/ldap


使用phpize编译php_ldap模块

#检查phpize(必须)
/www/server/php/73/bin/phpize
#复制lib文件
cp -frp /usr/lib64/libldap* /usr/lib
./configure --with-php-config=/www/server/php/73/bin/php-config --with-ldap
make && make instal

最后修改php.ini文件

vi /www/server/php/73/etc/php.ini
#增加
extension=ldap








除非注明,发表在“傲孤漠客”的文章『apache 报错解决方法』版权归iMoke所有。 转载请注明出处为“本文转载于『傲孤漠客』原地址https://www.imoke.org/post/20180731470.html

评论

发表评论   

昵称*

E-mail*(建议输入,以便收到博主回复的提示邮件)

网站