ACFS–網站工具目錄設定及.htaccess加密
第一步:vim /etc/apache2/sites-enabled/acfs_sfs.conf
加入
#– 網站根目錄設定
<Directory /var/www/html/>
Options FollowSymLinks
AllowOverride none
Require all granted
</Directory>
#– 網站工具目錄設定
<Directory “/var/www/html/tool/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Require ip 127.0.0.1 1XX.XX.88 192.168.1
</Directory>
#– 網站根目錄設定
<Directory /home/stuweb/>
Options FollowSymLinks
AllowOverride none
Require all granted
</Directory>
#– 教師課表
<Directory “/home/classtable/">
AllowOverride All
</Directory>
啟用 #a2ensite acfs_sfs
禁用 #a2dissite acfs_sfs
第二步:加入.htaccess .htpasswd
在/home/classtable/public_html
#vi .htaccess 檔案的範例如下:(使用vi編輯器)
AuthName “學校課表"
AuthType Basic
AuthUserFile “/home/classtable/public_html/.htpasswd"
require valid-user
#htpasswd -c .htpasswd 帳號 (會被要求輸入帳密2次)
如果還要增加其他管理者帳號,則不要在用 -c 這個參數,-c 只用在第一次產生的時候
第三步:重啟apache
#service httpd restart
沒有留言:
張貼留言
注意:只有此網誌的成員可以留言。