Bug 45726 - Build in a maintenance functionallity
Build in a maintenance functionallity
Status: NEW
Product: Apache httpd-2
Classification: Unclassified
Component: Core
2.2.8
All All
: P2 enhancement (vote)
: ---
Assigned To: Apache HTTPD Bugs Mailing List
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2008-09-02 03:45 UTC by Maik Igloffstein
Modified: 2008-09-02 05:37 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Maik Igloffstein 2008-09-02 03:45:23 UTC
Feature Request
===============

Hello,

if a user types in (debian)
"/etc/init.d/apache2 maintenance"

the apache2 should direct every http/https access to a default, changeable "maintenance.html" file.

Why user should need this?:
- no changes in the sites-available section is needed
- fast way to set up a maintenance page quickly, secure and clean, without touching everything, to update something


friendly regards
Maik
Comment 1 rahul 2008-09-02 05:37:34 UTC
You can do this by asking apache to run with a different configu file.
see

see http://www.dotcomunderground.com/blogs/2006/08/31/return-503-status-with-apache-webserver/


e.g
|cat maintenance.conf 
Listen 8080
ServerName agneyam
ScriptAlias / 503.sh/

|cat 503.sh
#!/bin/sh
cat <<EOF
status: 503
Content-Type: text/html


<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>503 - Service temporary unavailable</title>
</head>
<body>
<h1>503 - Service temporary unavailable</h1>
<p>Sorry, this website is currently down for maintenance please
retry in a few minutes</p>
</body>
</html>
EOF

|./bin/httpd -f ./maintenance.conf                
|echo "GET / HTTP/1.0\r\n\r\n" | nc 0 8080
HTTP/1.1 503 Service Temporarily Unavailable
Date: Tue, 02 Sep 2008 12:21:52 GMT
Server: Apache/2.2.9 (Unix)
Connection: close
Content-Type: text/html


<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>503 - Service temporary unavailable</title>
</head>
<body>
<h1>503 - Service temporary unavailable</h1>
<p>Sorry, this website is currently down for maintenance please
retry in a few minutes</p>
</body>
</html>
|echo "GET /abc?def HTTP/1.0\r\n\r\n" | nc 0 8080
HTTP/1.1 503 Service Temporarily Unavailable
Date: Tue, 02 Sep 2008 12:21:57 GMT
Server: Apache/2.2.9 (Unix)
Content-Length: 284
Connection: close
Content-Type: text/html


<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>503 - Service temporary unavailable</title>
</head>
<body>
<h1>503 - Service temporary unavailable</h1>
<p>Sorry, this website is currently down for maintenance please
retry in a few minutes</p>
</body>
</html>