The Joyent Community

A place where the Joyent community can gather, help each other out, and stay informed.

You are not logged in.

#1 2007-02-23 16:34:21

Loophole
Lime Green
From: Isle of Wight (UK)
Registered: 2006-04-26
Posts: 69
Website  Expertise

client denied by server configuration: /system/maintenance.html

Hi peeps

i have had my rails app running fine and using mongrel clusters

today i wanted to add a maintenance page so when the domains re point from business host to new on-domand it would show up but i am getting this error

client denied by server configuration: /system/maintenance.html

any one come across this or know what i done wrong

Code:

ServerName www.host.com
DocumentRoot /var/rails/host/current/public

<Directory /var/rails/host/current/public>

Options FollowSymLinks AllowOverride All Order allow,deny Allow from all
</Directory>

ProxyPass / balancer://mongrel_cluster/
ProxyPassReverse / balancer://mongrel_cluster/

RewriteEngine On

#Check for maintenance file and redirect all requests
RewriteCond %{DOCUMENT_ROOT}/system/maintenance.html -f
RewriteCond %{SCRIPT_FILENAME} !maintenance.html
RewriteRule ^.*$ /system/maintenance.html [L]

#Make sure people go to www.host.com, not host.com

#RewriteCond %{HTTP_HOST} ^host.com$ [NC]

#RewriteRule ^(.*)$ http://www.host.com$1 [R=301,L]

  1. Rewrite index to check for static

RewriteRule ^/$ /index.html [QSA]
  1. Rewrite to check for Rails cached page

RewriteRule ([.]+)$ $1.html [QSA]
  1. Redirect all non-static requests to cluster
    RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
    RewriteRule ^/(.*)$ balancer://mongrel_cluster%{REQUEST_URI} [P,QSA,L]
  2. Deflate
    AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml application/xhtml+xml text/javascript text/css
    BrowserMatch ^Mozilla/4 gzip-only-text/html
    BrowserMatch ^Mozilla/4.0678 no-gzip
    BrowserMatch bMSIE !no-gzip !gzip-only-text/html


Thanks

Nick

Last edited by Loophole (2007-02-23 16:35:36)

Offline

 

#2 2007-02-23 20:41:05

Garth
New member
Registered: 2005-11-14
Posts: 7
Expertise

Re: client denied by server configuration: /system/maintenance.html

I work with Nick, I'll try and expand on the problem.

We're using capistrano to deploy to our container, we're using Apache along mongrel etc. and that is working well. We want to take advantage of the enable/disable_web stuff, placing a maintenance.html in public/system/ etc.

When we place the maintenance.html file in the system directory, we get a 403 (You don't have permission to access / on this server) from the browser, removing it everything seems to work fine. It seems to be a problem with the rewrite rule in apache or a permissions problem. Can anyone suggest where to look first?

Cheers,

Garth

Offline

 

#3 2007-02-28 12:25:20

Loophole
Lime Green
From: Isle of Wight (UK)
Registered: 2006-04-26
Posts: 69
Website  Expertise

Re: client denied by server configuration: /system/maintenance.html

More info on this

Current setup

My rails apps runs from

/var/rails/fantasyfestivals/current/

Current has a symbolic to

/var/rails/fantasyfestivals/releases/20070222144425/

The rewrtie in my conf file is

RewriteCond %{DOCUMENT_ROOT}/system/maintenance.html -f
RewriteCond %{SCRIPT_FILENAME} !maintenance.html
RewriteRule ^.*$ /system/maintenance.html [L]

/var/rails/fantasyfestivals/releases/20070222144425/public/system

System has a symbolic to

/var/rails/fantasyfestivals/shared/system/

Where the maintenance.html file lives

With this setup we get a 403 (You don't have permission to access / on this server) from the browser

Now I moved the maintenance.html to the public folder and changed the rewrite excluding the system

And this works fine now

Can any one explain why this would not work from /var/rails/fantasyfestivals/shared/system/ but would work from /var/rails/fantasyfestivals/releases/20070222144425/public/

Regards

Nick

Offline

 

#4 2007-12-06 19:39:44

jdewey2
New member
Registered: 2007-12-06
Posts: 2
Expertise

Re: client denied by server configuration: /system/maintenance.html

This was a fun one. So it appears it has to do with /system existing on your webserver.
I had this problem on my Mac and my Joyent accelerator.

The following is on a system that contains /system/. For some reason it stats outside it's
doc root, and finds /system thus upsetting apache and throwing the 403.

9544/0xa4aff20: stat("/system", 0xBFFFEFE0, 0x1F40) = 0 0
9544/0xa4aff20: stat("/system/maintenance.html", 0xBFFFEFB0, 0x1F40) = -1 Err#2
9544/0xa4aff20: lstat("/system", 0xBFFFEFB0, 0x1F40) = 0 0
9544/0xa4aff20: lstat("/system/maintenance.html", 0xBFFFEFB0, 0x1F40) = -1 Err#2
9544/0xa4aff20: write(0x9, "[Thu Dec 06 10:57:42 2007] [error] [client 127.0.0.1] client denied by server configuration: /system/maintenance.htmln377377377377377377377377377377377377377377377377377377377377377377377377377377377377377377377377377377377377377377", 0x76) = 118 0

Changing the maintenance rewrite rule from system to my_system appears to work. Apache stats
for /my_system which is not found then stats back into doc_root.

9556/0xa4aff20: stat("/my_system", 0xBFFFEFE0, 0x1F40) = -1 Err#2
9556/0xa4aff20: stat("/Users/john/svn/topics/public/my_system/maintenance.html", 0xBFFFEDB0, 0x1F40) = 0 0
9556/0xa4aff20: stat("/my_system", 0xBFFFEFE0, 0x1F40) = -1 Err#2
9556/0xa4aff20: stat("/Users/john/svn/topics/public/my_system/maintenance.html", 0xBFFFEFB0, 0x1F40) = 0 0
9556/0xa4aff20: open("/Users/john/svn/topics/public/my_system/maintenance.html", 0x0, 0x0) = 16 0

Looks like this can be fixed by changing the rewrite rules to:

RewriteCond %{DOCUMENT_ROOT}/system/maintenance.html -f
RewriteCond %{SCRIPT_FILENAME} !maintenance.html
RewriteRule ^.*$ %{DOCUMENT_ROOT}/system/maintenance.html [L]

Last edited by jdewey2 (2007-12-06 22:33:27)

Offline

 

#5 2007-12-07 08:38:42

roger
Member
From: Oslo, Norway
Registered: 2007-03-06
Posts: 187
Website  Expertise

Re: client denied by server configuration: /system/maintenance.html

Thanks for the writeup. I was struggling with this and made the same conclusions about what was going on but wasn't able to find a fix. I ended up making a copy of system with a different name to get around it but have now applied your fix which works perfectly!

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson