Jump to content
Froxlor Forum
  • 0

FCGID Enable errordocuments


frontline

Question

Hello.

 

I'm using Apache2 + FCGID, on Debian Lenny (PHP 5.3.5-0.dotdeb.1 with Suhosin-Patch (cgi-fcgi)).

 

In Settings -> Webserver settings -> Enable default errordocuments for all customers is Enabled.

 

Clients have /var/www/vhosts as root, and I have created /var/www/default/error_docs/404_not_found.php.

 

When I try to use /var/www/default/error_docs/404_not_found.php as File/URL for error 404, Froxlor will create: /etc/apache2/sites-enabled/05_froxlor_default_errorhandler.conf with:

ErrorDocument 404 /var/www/default/error_docs/404_not_found.php

 

For any domain, this will display in browser:

Not Found
The requested URL /11 was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
Apache/2.2.16 (Debian) Server at www.domain.tld Port 80

 

Any hints ?

 

Regards,

/Sorin

Link to comment
Share on other sites

9 answers to this question

Recommended Posts

Hello.

 

Had this subject left unresolved for some time, but now I had a working solution.

 

I have disabled global error documents settings in Froxlor (Settings -> Webserver settings -> Enable default errordocuments for all customers) and create:

 

/etc/apache2/sites-enabled/11_global_error_docs.conf

Alias /error_docs "/var/www/default/error_docs/"
ErrorDocument 400 /error_docs/400.shtml
ErrorDocument 401 /error_docs/401.shtml
ErrorDocument 403 /error_docs/403.shtml
ErrorDocument 404 /error_docs/404.shtml
ErrorDocument 405 /error_docs/405.shtml
ErrorDocument 406 /error_docs/406.shtml
ErrorDocument 407 /error_docs/407.shtml
ErrorDocument 412 /error_docs/412.shtml
ErrorDocument 414 /error_docs/414.shtml
ErrorDocument 415 /error_docs/415.shtml
ErrorDocument 500 /error_docs/500.shtml
ErrorDocument 501 /error_docs/501.shtml

 

I'm using .shtml because I needed Apache2 SSI to get the hostname (HTTP_HOST), to be displayed in every page.

Using .php for files would create some problems in suspended pages (no fcgid-starter for the suspended pages), so I opted for a Apache SSI for all default, suspended and error pages.

 

Now I have working error pages for all domains hosted on the same server.

 

Hope this info will be useful for anyone :)

 

Regards,

/Sorin

Link to comment
Share on other sites

Yep, but "Enable default errordocuments for all customers" should be a global setting, for every customer, right ?

 

Using an URL it's not good because the user is redirected to another host/domain.

 

There is something special related to FCGID ?

 

Regards,

/Sorin

Link to comment
Share on other sites

Made some testing about this.

 

It is possible using a general alias (like /awstats-icon), in 05_froxlor_default_errorhandler.conf:

Alias /error_docs "/var/www/default/error_docs/"
ErrorDocument 404 /error_docs/404.html
ErrorDocument 500 /error_docs/500.html

 

Should be possible to set up by Froxlor (it needs to add Settings -> Webserver settings -> Webserver default errors location), but it seems to have a problem with php files (html files are working just fine).

 

If I'm using a .php file (eg, to get current (sub)domain name), then the Firefox is displaying a "File not found" page and Internet Explorer tries to download a file, which doesn't exist.

 

Maybe because FCGID and files outside of the DocumentRoot ?

 

Regards,

/Sorin

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.



×
×
  • Create New...