Created
February 5, 2016 01:51
-
-
Save eru/ca8b7b999f743c22913e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## | |
## メンテナンスモード用コンフィグ | |
## | |
## How to use: | |
## maintenance mode on | |
## $ rename .conf .conf.maintenance *.conf && rename .conf.tmp .conf *.conf.tmp && service httpd restart | |
## maintenance mode off | |
## $ rename .conf .conf.tmp *.conf && rename .conf.maintenance .conf *.conf.maintenance && service httpd restart | |
## | |
## Tips: | |
## VirtualHostの最初の項目が、デフォルト設定をして使われることを利用して、他のconfigファイルを読み込まれない状態にした上で、 | |
## このconfigファイルを有効にすることで、503のメンテナンス表示を行う。 | |
## また、デフォルト表示のため、ServerNameに指定するドメイン名はなんでもよい。 | |
NameVirtualHost *:80 | |
<VirtualHost *:80> | |
ServerName example.com | |
DocumentRoot "/etc/httpd/conf.d" | |
<Directory "/etc/httpd/conf.d"> | |
allow from all | |
Options -Indexes | |
AddHandler cgi-script htaccess | |
ErrorDocument 503 /maintenance.html | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteCond %{REQUEST_URI} !=/maintenance.html | |
RewriteRule ^.*$ - [R=503,L] | |
</IfModule> | |
</Directory> | |
</VirtualHost> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment