目次

apache設定ファイル

Sample Code

#
# WordPress
#
<Directory "/var/www/vhosts/wordpress/">
  SSLRequireSSL
  Options None
  AllowOverride All
  Order Deny,Allow
#  Allow from all
#  Allow from 127.0.0.1
#  Allow from 123.123.123.123 124.124.124.124
  AuthName "WordPress Access"
  AuthType Basic
  AuthUserFile /var/www/vhosts/wordpress/htpasswd.users
  Require valid-user
</Directory>

Alias /wordpress/var/www/vhosts/wordpress

解説

パスワードファイル生成

# htpasswd -cm /var/www/vhosts/wordpress/htpasswd.users editor
New password: *****
Re-type new password: *****
Adding password for user editor
# less /var/www/vhosts/wordpress/htpasswd.users
editor:$apr1$qwst8xCo$dmavjxuPRDsKc6785yINR/