[1] RPM安裝
[2] Check
more /etc/httpd/conf.d/auth_pam.conf
LoadModule auth_pam_module modules/mod_auth_pam.so
LoadModule auth_sys_group_module modules/mod_auth_sys_group.so
more /etc/pam.d/httpd
#%PAM-1.0
auth required pam_stack.so service=system-auth
account required pam_stack.so service=system-auth
[3] 權限
groupadd -r shadow
vi /etc/group
shadow:x:102:root,apache
chgrp shadow /etc/shadow
chmod g+r /etc/shadow
vi /etc/httpd/conf/httpd.conf
Group shadow
[4]
vi /etc/httpd/conf/httpd.conf
<Directory /var/www/html/PATH>
AllowOverride All
</Directory>
vi /var/www/html/PATH/.htaccess
AuthPAM_Enabled on
AuthName "Linux PAM Auth"
AuthType Basic
require valid-user
apachectl graceful
ref: http://www.arch.nctu.edu.tw/blog/archives/4/20041009
官網: http://pam.sourceforge.net/mod_auth_pam/index.html
留言