# chmod a+x /var/www/html/DirectoryName
# chnod -Rt http_user_content_t /var/www/html/DirectoryName
#vi /etc/httpd/conf/httpd.conf
<Directory "/var/www/html/DirectoryName">
Options Indexes
allow,deny
AuthType Basic
AuthName "Protected Web"
AuthUserFile /etc/httpd/protectedpass
Require valid-user
Order allow,deny
Allow from 192.168.100
AllowOverride All
satisfy any
</Directory>
NameVirtualHost *:80
<VirtualHost *:80>
ServerAdmin AnyUserName@www.virtualservername.com
DocumentRoot /var/www/html/DirectoryName
ServerName www.virtualservername.com
ErrorLog logs/error_log
CustomLog logs/access_log combined
DirectoryIndex index.php deault.php
</VirtualHost>
# htpasswd -c /etc/httpdprotectedpass UserName
# htpasswd /etc/httpdprotectedpass NextUser
# service httpd restart
# iptables -I INPUT -p tcp --dport 80 -j ACCEPT
# service iptables save
沒有留言:
張貼留言