[英]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 我有Apache + phusion乘客,我已经把
RailsEnv production
in /etc/apache2/sites-available/default file and have restarted apache but when I am running 在/ etc / apache2 / sites-available / default文件中并重新启动了apache但是当我运行时
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 ? 还有其他方法可以重新启动乘客,因为我认为将“RailsEnv生产”置于默认状态是正确的方法吗? btw I am using 顺便说一句,我正在使用
sudo service apache2 restart
How to start my ruby on rails app in Production mode with passenger + apache ? 如何使用passenger + apache在生产模式下在rails应用程序上启动我的ruby?
just create a restart.txt in tmp dir of your app 只需在你的应用程序的tmp目录中创建一个restart.txt
eg 例如
touch %RAILS_ROOT%/tmp/restart.txt
look here http://www.modrails.com/documentation/Users%20guide%20Apache.html section 3.3 请看这里http://www.modrails.com/documentation/Users%20guide%20Apache.html第3.3节
Your app is probably in production mode already. 您的应用可能已处于生产模式。
By default, rails c
loads the app in dvelopment mode. 默认情况下, rails c
以开发模式加载应用程序。
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. 控制台和Web应用程序是两个不同的rails进程并独立运行。
You should check your production.log file to be sure that your app runs in production. 您应该检查您的production.log文件,以确保您的应用程序在生产中运行。
Just for starting app with particular port use below command: 只是为了使用以下命令启动特定端口的app:
passenger start -a 0.0.0.0 -p 3000 -d -e production 乘客开始-a 0.0.0.0 -p 3000 -d -e生产
I followed the commands listed in PhusionPassenger docs here and they worked straight-away. 我跟着PhusionPassenger文档中列出的命令在这里和他们的工作直掉。
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)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.