lnmp环境搭建:ldap自助密码修改程序self-service-password

基础环境安装:
php7、php-fpm、nginx、sendmail

直接yum安装即可:

 yum install https://ltb-project.org/rpm/6Server/noarch/self-service-password-1.1-1.el6.noarch.rpm -y

修改配置文件:

vim /usr/share/self-service-password/conf/config.inc.php

LDAP配置相关修改

$ldap_url = “ldap://127.0.0.1:389”;
$ldap_starttls = false;
$ldap_binddn = “cn=admin,dc=test,dc=tech”;
$ldap_bindpw = “PASSWD”;
$ldap_base = “dc=test,dc=tech”;
$ldap_login_attribute = “uid”;
$ldap_fullname_attribute = “sn”;
KaTeX parse error: Expected 'EOF', got '&' at position 17: …dap_filter = "(&̲(objectClass=pe…ldap_login_attribute={login}))";

通过邮件修改相关配置

$mail_attribute = “mail”;
$mail_address_use_ldap = false;
$mail_from = “[email protected]”;
$mail_from_name = “企业账号密码重置”;
$mail_signature = “”;
$notify_on_change = true;
$mail_sendmailpath = ‘/usr/sbin/sendmail’;
$mail_protocol = ‘smtp’;
$mail_smtp_debug = 0;
$mail_debug_format = ‘html’;
$mail_smtp_host = ‘smtp.exmail.qq.com’;
$mail_smtp_auth = true;
$mail_smtp_user = ‘[email protected]’;
$mail_smtp_pass = ‘PASSWROD’;
$mail_smtp_port = 25;
$mail_smtp_timeout = 30;
$mail_smtp_keepalive = false;
$mail_smtp_secure = ‘tls’;
$mail_contenttype = ‘text/plain’;
$mail_wordwrap = 0;
$mail_charset = ‘utf-8’;
$mail_priority = 3;
$mail_newline = PHP_EOL;

nginx配置文件创建
ldap.conf

server {
    listen       80;
    root  /usr/share/self-service-password;
    index index.php;
    server_name  ldap.test.com;

    location / {
        root /usr/share/self-service-password;
        index index.html index.htm index.php;
    }
		
    error_page  404              /404.html;
    location = /404.html {
        root   /usr/share/nginx/html;
    }

    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /usr/share/nginx/html;
    }


	location ~ \.php$ {
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        include        fastcgi_params;

    }


}

以上完成后重启php-fpm+nginx

systemctl restart nginx
systemctl restart php-fpm.service

访问域名: ldap.test.com 完成!!!

你可能感兴趣的:(linux)