認証設定
htpasswd -c /opt/alminium.htpasswd yamada
- /opt/alminium.htpasswd に yamada ユーザと、暗号化されたパスワードが格納される。
/etc/httpd/conf.d/redmine.conf
<VirtualHost *:80>
ServerName localhost
DocumentRoot /opt/alminium/public
ExpiresActive On
ExpiresByType application/x-javascript A259200
ExpiresByType application/javascript A259200
ExpiresByType image/png A2592000
ExpiresByType image/jpeg A2592000
ExpiresByType image/gif A2592000
ExpiresByType text/css A2592000
#RewriteEngine On
#RewriteCond %{SERVER_PORT} 80
#RewriteCond %{SERVER_NAME} !localhost
#RewriteRule ^(.*)?$ https://%{HTTP_HOST}$1 [R,L]
+ # Basic Auth
+ <Directory /opt/alminium/public/>
+ AuthUserFile /opt/alminium.htpasswd
+ AuthGroupFile /dev/null
+ AuthName "Please enter ID and password"
+ AuthType Basic
+ require valid-user
+ order deny,allow
+ </Directory>
</VirtualHost>
設定適用
/etc/init.d/httpd restart