0

I install directadmin with CB2 + Apache + MariaDB 10.1.31 + PHP 5.6.34. When I upload OpenCart and enable maintenance mode, Apache shows the 503 error page instead of maintenance.tpl.

I checked the catalog/controller/common/maintenance.php and found the following code:

if ($this->request->server['SERVER_PROTOCOL'] == 'HTTP/1.1') {
    $this->response->addHeader('HTTP/1.1 503 Service Unavailable');
} else {
    $this->response->addHeader('HTTP/1.0 503 Service Unavailable');
}

$this->response->addHeader('Retry-After: 3600');

I think the problem is that Apache does not handle the 503 Header correctly. When I change the web server to LiteSpeed, it is ok.

To check you can compare these two versions of the site. Both of them have the maintenance mode enabled, but:

The first is OK - http://takjens.com/

The second is not - http://server3.lammer.ir/

Please let me know how to fix this problem.

plamut
  • 3,085
  • 10
  • 29
  • 40
Rasul Sh
  • 1
  • 2

1 Answers1

0

Here LiteSpeed has custom error page configured, while Apache shows default 503 error page, as defined in the response header.

To make Apache display the custom error page, do the following:

  1. Add the custom error page directive to the Apache configuration or into the .htaccess file for the domain. Specify the path to the maintenance.tpl file relatively to the configured ServerRoot:

    ErrorDocument 503 /path/to/maintenance.tpl

  2. .tpl file extension is not something that Apache can serve by default. I order to process it properly, the correct file type should be specified for this extension either in Apache configuration or via .htaccess file:

    AddType text/html tpl

Elvis Plesky
  • 3,190
  • 1
  • 12
  • 21
  • this is not problem. please check header of these sites with Curl then open in browsers. http://takjens.com/ http://server3.lammer.ir/ – Rasul Sh Mar 04 '18 at 09:26