User Tools

Site Tools


apache:create_a_maintenance_page

Apache - Create a maintenance page

Sometimes you need to place a site into maintenance mode for some reason. This is the easy way to do it.

1. Create a directory named err/ in the root directory. Lets say the site is called example.com.

cd /var/www/html/example.com
mkdir err

2. Create a file named 503.html in the err directory.

cd /var/www/html/example.com/err
touch 503.html

3. Put a maintenance message into 503.html.

echo "<html><b>This site is currently under maintenance. Thank you</b></html>" > 503.html

4. Add below lines to your virtual host setting for example.com.

ErrorDocument 503 /err/503.html
## uncomment below to enter maintenance mode
RedirectMatch 503 ^/(?!err/)

5. Restart Apache.

httpd -k graceful

6. Test the website.

apache/create_a_maintenance_page.txt · Last modified: 2020/07/15 10:30 by 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki