Apahce的虚拟用户认证及server-status页
一、Apache虚拟用户认证配置
编辑配置文件加入如下内容:
<Directory "/www/htdoc/fin">
Options None
AllowOverride AuthConfig
AuthType Basic
AuthName "private Area"
# AuthbasicProvider file
AuthUserFile /etc/httpd/conf/.htpasswd
Require valid-user
</Directory>
重启服务
添加虚拟用户和密码:
# htpasswd -c -m /etc/httpd/conf/.htpasswd fansik
再添加用户的时候就不用添加-c了
二、开启Apache的server-status页
<Location /server-status>
SetHandler server-status
AuthType Basic
AuthName "Server Status"
AuthUserFile "/etc/httpd/conf/.htpasswd"
Require valid-user
Order deny,allow
allow from all
</Location>
重启httpd通过http://ServerIP/URL/server-status访问