Skip to content

Instantly share code, notes, and snippets.

@iyuuya
Last active May 23, 2016 11:08
Show Gist options
  • Save iyuuya/85ed433c7ecc50994d42aea880f2d2f7 to your computer and use it in GitHub Desktop.
Save iyuuya/85ed433c7ecc50994d42aea880f2d2f7 to your computer and use it in GitHub Desktop.
Apache: IP制限orBasic認証設定
<VirtualHost *:80>
ServerName hoge.example.com
DocumentRoot /var/www/path/to/app/public
ErrorLog logs/hoge_error_log
CustomLog logs/hoge_access_log combined
<Directory "/var/www/path/to/app/public">
Options FollowSymLinks IncludesNoExec
AllowOverride FileInfo Indexes Limit Options
AuthType Basic
AuthName "hoge.example.com member only"
AuthGroupFile /dev/null
AuthUserFile /etc/httpd/htpasswd/hoge.htpasswd
Require valid-user
Satisfy any # Satisfy All にすると、両方をパスしないと駄目。
Order deny,allow
Allow from 11.22.33.44
Deny from all
</Directory>
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment