Welcome Guest | Login

Pb deploying multiple apps

Hi there,

My first domain works nicely on my account with fcgi and mongrel.
Now I want to add an addon domain. So I followed the instructions:http://www.hostingrails.com/forums/wiki_thread/6

Well, I have a problem with the first .htaccess file (domain of app1).
The error log of my server is :

/home/my_account/public_html/.htaccess: RewriteCond: bad flag delimiters

And this is my .htaccess file (app1 in public_html) :

# General Apache options
#AddHandler fastcgi-script .fcgi
AddHandler cgi-script .cgi
Options +FollowSymLinks +ExecCGI

# If you don't want Rails to look in certain directories,
# use the following rewrite rules so that Apache won't rewrite certain requests
#
# Example:
#   RewriteCond %{REQUEST_URI} ^/notrails.*
#   RewriteRule .* - [L]



# Redirect all requests not available on the filesystem to Rails
# By default the cgi dispatcher is used which is very slow
#
# For better performance replace the dispatcher with the fastcgi one
#
# Example:
#   RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
RewriteEngine On

# If your Rails application is accessed via an Alias directive,
# then you MUST also set the RewriteBase in this htaccess file.
#
# Example:
#   Alias /myrailsapp /path/to/myrailsapp/public
#   RewriteBase /myrailsapp

RewriteCond %{REQUEST_URI} ^/bournier.*
RewriteRule .* - [L]

RewriteRule ^$ index.html [QSA]
RewriteRule ^([^.]+)$ $1.html [QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]

# In case Rails experiences terminal errors
# Instead of displaying this message you can supply a file here which will be rendered instead
#
# Example:
#   ErrorDocument 500 /500.html

ErrorDocument 500 "<h2>Application error</h2>Rails application failed to start properly"
Undestanding my app2folder is "bournier".

Can you help me ?

2007-02-13 01:48 AM

Hmmm, well, the problem is in one of these two lines.

RewriteCond %{REQUEST_URI} ^/bournier.*
RewriteCond %{REQUEST_FILENAME} !-f

But that makes no sense because they look fine. Try removing the first one.

Otherwise, bring in a fresh .htaccess and give that a try.  To be honest I've never seen this error before and Googling for it doesn't tell us much...

~William



2007-02-13 04:04 AM

Also, what do you mean by "My first domain works nicely on my account with fcgi and mongrel."

An app should never use fcgi AND mongrel.  Its one or the other...Mongrel is a web server that we setup proxys to and it doesn't even look at the .htaccess file.  FastCGI is an application server that works with Apache (mod_fcgid) to serve up your app.  

Maybe this has something to do with the problem?  Did we set you up with a vhost?

Cheers,
~William

2007-02-13 04:06 AM

Hi william,

Yes, my first app worked fine yesterday with fcgi. Then I ran mongrel. It was OK too. Then you set a vhost with mongrel, and it works too (confirmation email).

After, I tried to see how it works with multiple domains. So I install a new one (bournier) and configured it. And the problem came : my first domain/app displays the page without layout, and the second domain/app displays an internal server error.

Now, if I remove the line :
RewriteCond %{REQUEST_URI} ^/bournier.*

then, my first app is OK... and the second displays : "Rails application failed to start properly"... That seems normal because I don't tell it wath is the folder of the second (bournier).

2007-02-13 04:30 AM

Hey there, - yes, remove this line
RewriteCond %{REQUEST_URI} ^/bournier.*

There is likely now just a typo or something in your second app's setup.  Check permissions, read through these. http://www.hostingrails.com/forums/wiki_thread/15http://www.hostingrails.com/forums/wiki_thread/9
etc...

If you're still having a problem please let me know.  I could be wrong and this may be another issue, but I'm pretty sure for your situation you don't need that RewriteCond.  

Cheers,
~William

2007-02-13 04:47 AM


Hello Guest! In order to post you must be an active client with us, please log in or sign up.