top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Want to replace 503 Maintenance page with custom page on Apache 2.2.23

+1 vote
371 views

Need some help here, want to replace the standard 503 page of Apache with my custom maintenance page. Read some blogs which gives direction of replacing the page with my html page and just do some rewrite of URL to display it.with help of .htaccess.

I am not able to find the .htaccess file on the server, could some one please help me on that, where is htaccess file by default on the server.

Could some body also suggest if there is any other solution to achieve maintenance page.

posted Jun 17, 2013 by anonymous

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

The .htaccess files are in the content directories, e.g. DocumentRoot and its subdirectories. You would normally create these file by hand on a per directory basis.

You can create custom error messages by following this doc:

https://httpd.apache.org/docs/current/custom-error.html

In the past, I have found a good maintenance mode solution to be starting Apache with an alternative config that changes the document root to a maintenance directory. This directory has no index files, but instead serves custom error documents.

The method I have used for starting Apache with an alternative config, is to add a new option to the init.d script like "maint". One could simply specify the -f argument as $OPTIONS in the environment before running # service httpd restart, but I have found it this way for simple apache configs. The maint option in /etc/init.d/httpd might look like:

# See how were called.
 case "$1" in
  start)
          start
          ;;
  maint)
           stop
          OPTIONS="$OPTIONS -f $MAINTCONFIG
          start
          ;;

Where $MAINTCONFIG is either coded into the init script (preferred) or set in the environment. Then to go into maintenance, simply:

# service httpd maint

Which would stop apache, then start apache with the maintenance config. Perhaps not the most elegant, but it served its purpose and is expandable to handle maintenance for individual virtual hosts by devising additional config files for each vhost that maintenance mode should apply.

answer Jun 17, 2013 by anonymous
Similar Questions
0 votes

I am using CentOS 6.0 with Apache 2.2.15, and set up Apache with virtual host. The SSI works fine on the first VH, but ssi on the other virtual hosts does not work. I got the following message in the error log:

mod_include: Options +Includes (or IncludesNoExec) wasnt set, INCLUDES filter removed

Does anyone know how to resolve this problem?

+1 vote

We have a set up like Apahce (80,443) redirects the request to Tomcat (8080) using mod_jk.

The new requirement is to route the request from the same apache to another tomcat (8090). Hence I made the different config file for apache with different ports (86,4444) and different worker for mod_jk which routes the request to tomcat.

Now the issue is when I hit the url http://:86 and after providing the credentials, it is redirecting to https://:86 and throwing the below error.

Error in browser:

Secure Connection Failed

An error occurred during a connection to x.x.x.x:86. SSL received a record that exceeded the maximum permissible length. (Error code: ssl_error_rx_record_too_long)

Error in logs:

"x16x03x01" 501

[Thu Jan 08 08:22:46 2015] [debug] ssl_engine_io.c(1523): OpenSSL: I/O error, 11 bytes expected to read on BIO#1bf568 [mem: 1f3930]
[Thu Jan 08 08:22:46 2015] [debug] ssl_engine_kernel.c(1806): OpenSSL: Exit: error in SSLv2/v3 read client hello A
[Thu Jan 08 08:22:46 2015] [info] (70014)End of file found: SSL handshake interrupted by system [Hint: Stop button pressed in browser?!]
[Thu Jan 08 08:22:46 2015] [info] Connection to child 3 closed with abortive shutdown(server pritoolvca1.sw.ericsson.se:443 [2], client 153.88.164.216)
[Thu Jan 08 08:23:53 2015] [error] [client 172.17.136.153] Invalid method in request x16x03x01

Could you please suggest where it might went wrong and the way forward..

+1 vote

My custom openssl engine works fine, tested it many times. I wanted to test it using mod_ssl, but needed a patch to enable dynamic engine support.
Now the problem is, I get a segmentation fault, whenever rsa methods in my custom openssl engine is called. I am using apache 2.4, and openssl 0.9.8e. Has anyone experienced it before?

+2 votes

Is it possible to use PHP 5.2.5 with Apache/2.4.6?

I have an application that was written in WAMP5 using PHP 5.2.5, and I am trying to get the application onto a CentOS server and I can't get it to work with 5.4.16.

Are there any good tutorials on using an older version of PHP with Apache?

+1 vote

Is it possible to configure Apache 2.4 to accept only one connection at time on port 443? is this something I can configure for my Virtual Hosts?

...