简体   繁体   English

如何在Ubuntu服务器上为Ruby on Rails重启Phusion Passenger + Apache的生产模式?

[英]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.

相关问题 使用Phusion Passenger和apache的Rails 3在生产模式下不起作用 - Rails 3 using Phusion Passenger with apache doesn't work in production mode 如何使用apache,heroku或Phusion Passenger在服务器上配置和部署Ruby on Rails应用程序不了解此类术语 - How to configure and deploy Ruby on Rails Application on server using apache, heroku or Phusion Passenger dont know about such terms 带有RVM,Phusion Passenger,Apache和Nginx的Ubuntu服务器 - Ubuntu server with RVM, Phusion Passenger, Apache and Nginx Ruby on Rails上的乘客 - Ruby on Rails on phusion passenger 如何重置Phusion客户Ruby on Rails缓存? - How to reset Phusion passenger Ruby on Rails cache? 死锁后的数据丢失 - SQL Server 2008,Ruby on Rails,Apache,Phusion Passenger,Linux,FreeTDS - Data loss after deadlock - SQL Server 2008, Ruby on Rails, Apache, Phusion Passenger, Linux, FreeTDS Freebsd 10.1 / Ruby on Rails / Apache 2.4 / Phusion Passenger:客户端被服务器配置拒绝 - Freebsd 10.1 / Ruby on Rails / Apache 2.4 / Phusion Passenger : client denied by server configuration Apache + Phusion Passenger + Ruby on Rails同步 - Apache+Phusion Passenger+Ruby on Rails synchronization Ruby on Rails 3 + Apache2 + Phusion Passenger:Bundler :: GemNotFound异常 - Ruby on Rails 3 + Apache2 + Phusion Passenger: Bundler::GemNotFound exception 在生产apache乘客ubuntu中部署导轨 - Deploy rails in production apache passenger ubuntu
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM