Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to restart Phusion Passenger + Apache in Production mode on Ubuntu server for Ruby on Rails?

I am having Apache + phusion passenger, I have put

RailsEnv production

in /etc/apache2/sites-available/default file and have restarted apache but when I am running

rails c
> Rails.env.production?

it gives fales where as for

> Rails.env.development?

it gives true. Is there any other way to restart passenger as I do think putting "RailsEnv production" in default is the right way ? btw I am using

sudo service apache2 restart

How to start my ruby on rails app in Production mode with passenger + apache ?

like image 677
iCyborg Avatar asked Mar 12 '13 17:03

iCyborg


People also ask

How do I restart Phusion Passenger?

Another method to restart an application is by touching the file restart. txt in the application directory's tmp subdirectory. Once Passenger has noticed that the file's timestamp has changed, it will restart the application.

What does Phusion Passenger do?

Phusion Passenger® is an open source web application server. It handles HTTP requests, manages processes and resources, and enables administration, monitoring and problem diagnosis. Passenger is very easy to use, makes deploying in production much easier and is scalable.


2 Answers

just create a restart.txt in tmp dir of your app

e.g.

  touch %RAILS_ROOT%/tmp/restart.txt

look here http://www.modrails.com/documentation/Users%20guide%20Apache.html section 3.3

like image 130
Pavel S Avatar answered Nov 15 '22 09:11

Pavel S


Your app is probably in production mode already.

By default, rails c loads the app in dvelopment mode.

If you want your console to be launched in production mode, do the following :

RAILS_ENV=production rails c

The console and the web app are two different rails proccess and run independently.

You should check your production.log file to be sure that your app runs in production.

like image 34
Intrepidd Avatar answered Nov 15 '22 09:11

Intrepidd