Is it possible to deploy a Ruby app on a simple clean Passenger setup?

I am thinking of something very similar to what you can do with mod_php: somehow drop the application in Apache and run it with Passenger without adding anything inside httpd.conf (no vhost, nothing but the main Passenger config ). This is something very similar to Wordpress or many other frameworks: just unzip / svn check it inside the folder and run.

I know this is possible with CGI and FCGI, but I'm wondering if Passenger speed can be used as well.

I've tried messing around with the Rack instructions on the official website trying to find the specific .htaccess and config.ru config, but nothing so far.

I know this is not common, but ... is it possible?

+2


a source to share


4 answers


This is not possible without configuring a virtual host.

Rails applications are not like PHP files; files in the file system do not match urls. PHP files are put inside DocumentRoot

, while Rails / Rack applications live outside DocumentRoot

.



Therefore, the Passenger cannot find your application location. You either need to say where it is located in the first place, or , you need to point your virtual host DocumentRoot

to the application directory /public

. In this case Passenger will detect that it is a Rails / Rack application and you do not need any additional Passenger configuration, but you do need a virtual host for each application.

Update: The Passenger docs mention what is RailsBaseURI

allowed in the .htaccess file . Adding this to the document root and creating a symbolic link from a subdirectory (for example /docroot/yourapp

) to /public

your application directory might be exactly what you want.

+1


a source


It all depends on what is already in your httpd.conf



You cannot even run a PHP application without changing your apache config files in many default apache installations.

0


a source


Can I drop config.ru into some directory?

0


a source


It's almost possible. If the configuration is correct and apache + mod_rails knows where your application is, you need to change the last modified date /path/to/your/app/tmp/restart.txt

. With ssh, you can do it like this:

touch /path/to/your/app/tmp/restart.txt

      

more information can be found here: http://www.modrails.com/documentation/Users%20guide.html#_redeploying_restarting_the_ruby_on_rails_application

Update:

Or you can create /path/to/your/app/tmp/always_restart.txt

more information on this can be found here: http://www.modrails.com/documentation/Users%20guide.html#_making_the_application_restart_after_each_request

0


a source







All Articles