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

I have an Apache + phusion passenger, I put

RailsEnv production 

in the file / etc / apache 2 / sites-available / default and restarted apache, but when I run

 rails c > Rails.env.production? 

gives fales values, where for

 > Rails.env.development? 

he gives the truth. Is there any other way to restart the passenger, since I think the default solution for RailsEnv production is default? btw i use

 sudo service apache2 restart 

How to run ruils ruils application in production mode with passenger + apache?

+4
source share
4 answers

Your application is probably already operational.

By default, rails c loads the application in development mode.

If you want the console to start in production mode, follow these steps:

RAILS_ENV=production rails c

The console and the web application are two different rails and are executed independently.

You should check your production.log file to make sure your application is running.

+3
source

just create a restart.txt file in the tmp directory of your application

eg.

  touch %RAILS_ROOT%/tmp/restart.txt 

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

+22
source

Only to run the application with specific port usage under the command:

passenger start -a 0.0.0.0 -p 3000 -d -e production

+3
source

I followed the commands listed in the PhusionPassenger docs here , and they worked right away.

 deployer@staging :~$ passenger-config restart-app Please select the application to restart. Tip: re-run this command with --help to learn how to automate it. If the menu doesn't display correctly, press '!' ‣ /home/deployer/myapp/current (staging) /home/deployer/myapp_2/current (staging) Cancel Restarting /home/deployer/myapp/current (staging) deployer@staging :~$ passenger-config restart-app Please select the application to restart. Tip: re-run this command with --help to learn how to automate it. If the menu doesn't display correctly, press '!' /home/deployer/myapp/current (staging) ‣ /home/deployer/myapp_2/current (staging) Cancel Restarting /home/deployer/myapp_2/current (staging) 
0
source

Source: https://habr.com/ru/post/1468779/


All Articles