httpd.confで以下の項目追加
<Directory "/opt/awstats/wwwroot"> <-認証をかけたいディレクトリ AuthType Basic AuthName "Awstats Secret Zone" AuthUserFile /etc/httpd/conf/.htpasswd Require user hogehogehoge <-ユーザ名 </Directory>
以下のコマンドを実行
[root@www conf]# htpasswd -c /etc/httpd/conf/.htpasswd hogehogehoge New password: Re-type new password: Adding password for user hogehogehoge [root@www conf]#
ちなみにオプションの-cは上書きですね。上書きしないで追加の場合は何もオプションをつけなくてよいです。
この記事は
現在のアクセス:11047