Welcome Guest | Login

Deploying multiple apps but not sure which app is my APP1 to edit .htaccess

In the tuturial to deploy multiple apps at the bottom it says to add these lines to APP1's htaccess file, but I do not know which application is app1. I took this over from a previous employee.

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

Is there a way to tell which app is APP1?

Thanks

2007-06-13 10:23 AM

Hi there -

issue a 'ls -l' in your root (~) and see what app is symlinked to public_html

That will be app1.  Something like ~/app1/public --> ~/public_html

2007-06-13 10:36 AM

Wow, ok so I did that and it shows

www --> ~/public_html

now I am really confused.

2007-06-13 10:52 AM

If a rails app is a main app - then there should be another folder that public_html is symlinked to.  

In any event - APP1's htaccess file is always equal to ~/public_html/.htaccess  - so you can change that file.  

2007-06-13 10:56 AM

Hi,

I appreciate your help with this,

The ~/public_html/.htaccess is 0 bytes

I guess this is a weird situation or maybe something was not set up correctly originally. Right now we have have 5 subdomains of our site all running different ruby/rails apps. Those 5 subdomains work correctly, but I am still having trouble deploying this new application.

Thanks for your help.

2007-06-13 11:04 AM

ahh ok - then the account was probably setup to not run a main account - which isn't such a bad idea.  If this is the case then you don't need to worry about the main .htaccess change.

What problems are you having, exactly?   Perhaps we can help.

2007-06-13 12:24 PM

well I am running into new problems now. Long story short:
1. was hosting an application on a different server. Decided to move it here with our other ruby/rails applications.
2. got it all set up as above and was running into issues getting it to be displayed while following the tutorial could not figure out where app1 was ...
3. With your help I was able to determine the initial problem and get to the welcome to ruby page.
4. uploaded my content, renamed the index.html file and am now getting a different error, which I am guessing has something to do with something being misconfigured from the upload or missing.
SyntaxError 
../app/helpers/application_helper.rb:92: parse error, unexpected kEND, expecting $
RAILS_ROOT: ../config/..

Application Trace | Framework Trace | Full Trace
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:140:in `load'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:140:in `load'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:56:in `require_or_load'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:30:in `depend_on'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:85:in `require_dependency'
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/helpers.rb:114:in `default_helper_module!'
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/helpers.rb:127:in `send'
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/helpers.rb:127:in `inherited_without_api'
/usr/local/lib/ruby/gems/1.8/gems/actionwebservice-1.1.6/lib/action_web_service/container/action_controller_container.rb:86:in `inherited_without_action_controller'
/usr/local/lib/ruby/gems/1.8/gems/actionwebservice-1.1.6/lib/action_web_service/dispatcher/action_controller_dispatcher.rb:34:in `inherited'
#{RAILS_ROOT}/app/controllers/application.rb:3
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:140:in `load'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:140:in `load'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:56:in `require_or_load'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:30:in `depend_on'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:85:in `require_dependency'
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/helpers.rb:114:in `default_helper_module!'
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/helpers.rb:127:in `send'
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/helpers.rb:127:in `inherited_without_api'
/usr/local/lib/ruby/gems/1.8/gems/actionwebservice-1.1.6/lib/action_web_service/container/action_controller_container.rb:86:in `inherited_without_action_controller'
/usr/local/lib/ruby/gems/1.8/gems/actionwebservice-1.1.6/lib/action_web_service/dispatcher/action_controller_dispatcher.rb:34:in `inherited'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:140:in `load'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:140:in `load'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:56:in `require_or_load'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:30:in `depend_on'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:85:in `require_dependency'
/usr/local/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/dispatcher.rb:69:in `prepare_application'
/usr/local/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/dispatcher.rb:37:in `dispatch'
dispatch.cgi:10
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:140:in `load'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:140:in `load'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:56:in `require_or_load'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:30:in `depend_on'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:85:in `require_dependency'
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/helpers.rb:114:in `default_helper_module!'
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/helpers.rb:127:in `send'
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/helpers.rb:127:in `inherited_without_api'
/usr/local/lib/ruby/gems/1.8/gems/actionwebservice-1.1.6/lib/action_web_service/container/action_controller_container.rb:86:in `inherited_without_action_controller'
/usr/local/lib/ruby/gems/1.8/gems/actionwebservice-1.1.6/lib/action_web_service/dispatcher/action_controller_dispatcher.rb:34:in `inherited'
#{RAILS_ROOT}/app/controllers/application.rb:3
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:140:in `load'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:140:in `load'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:56:in `require_or_load'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:30:in `depend_on'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:85:in `require_dependency'
/usr/local/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/dispatcher.rb:69:in `prepare_application'
/usr/local/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/dispatcher.rb:37:in `dispatch'
dispatch.cgi:10
This error occured while loading the following files:
  application.rb
  application_helper.rb

2007-06-13 12:36 PM

Ahh ok - first of all, you shouldn't run in cgi mode -- always stay in production mode with fastcgi (or mongrel)

Second, yes - application_helper.rb - there is a syntax error in this file - one too many or too little 'end' statements is usually when I see it -- but I think mismatched quotes can also do it.  

2007-06-13 12:48 PM

ok switched it over to fastcgi, now it looks like it is actually displaying the dispatch.fcgi page on screen.

#!/usr/bin/ruby
#
# You may specify the path to the FastCGI crash log (a log of unhandled
# exceptions which forced the FastCGI instance to exit, great for debugging)
# and the number of requests to process before running garbage collection.
#
# By default, the FastCGI crash log is RAILS_ROOT/log/fastcgi.crash.log
# and the GC period is nil (turned off).  A reasonable number of requests
# could range from 10-100 depending on the memory footprint of your app.
#
# Example:
#   # Default log path, normal GC behavior.
#   RailsFCGIHandler.process!
#
#   # Default log path, 50 requests between GC.
#   RailsFCGIHandler.process! nil, 50
#
#   # Custom log path, normal GC behavior.
#   RailsFCGIHandler.process! '/var/log/myapp_fcgi_crash.log'
#
require File.dirname(__FILE__) + "/../config/environment"
require 'fcgi_handler'

RailsFCGIHandler.process!


I am really confused by this. I never thought it would be this difficult to move an app from one server to the next, but again I have very little experience with Ruby/Rails.

2007-06-13 01:47 PM

Needs to be #!/usr/local/bin/ruby

Also - you need to comment out the AddHandler fcgi line in your .htaccess

and you need to make sure the dispatch.fcgi file is chmod 755

do a

chmod 755 disp*

within your public_html

2007-06-13 01:57 PM

Thanks that resolved that issue. Now it just says Application Error (Rails)

Thank you again for your help.

2007-06-13 02:21 PM

Ok, well as a last resort I went out and did a killall -usr1 dispatch.fcgi and it is now running.

Thank you so much for your help!

2007-06-13 02:42 PM


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