获取Rails的生产到端口80上运行 [英] Getting Rails production to run on port 80
问题描述
我试图让我的Rails应用在生产模式下运行,但我已经有一点难度。
I'm trying to get my rails app to run in production mode but I've been having a bit of difficulty.
我使用的是与Apache客运和正在运行Ubuntu 12.04。我已经配置我的生产数据库和创建的,乘客成立。情况如下:
I'm using passenger with apache and am running Ubuntu 12.04. I have my production database configured and created, and passenger set up. Status is as follows:
$ rvmsudo passenger-status
Version : 4.0.56
Date : 2014-12-25 01:54:20 +0000
Instance: 7264
----------- General information -----------
Max pool size : 6
Processes : 0
Requests in top-level queue : 0
----------- Application groups -----------
然而,当我运行护栏服务器-e生产
,它仍然监听3000端口见下图:
However when I run rails server -e production
, it still listens on port 3000 see below:
$ rails server -e production
=> Booting WEBrick
=> Rails 4.2.0 application starting in production on http://localhost:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
[2014-12-25 01:54:49] INFO WEBrick 1.3.1
[2014-12-25 01:54:49] INFO ruby 2.1.5 (2014-11-13) [i686-linux]
[2014-12-25 01:54:49] INFO WEBrick::HTTPServer#start: pid=7459 port=3000
什么可能我会丢失让它在生产模式上的80端口监听?
What might I be missing to get it to listens on port 80 in production mode?
提前非常感谢。
推荐答案
我不认为这是你必须使用Apache启动服务器在生产中。你安装apache-paassenger模块?并提出了Apache的conf文件的变化?
I don't think this is how you have to start the server in production using Apache. Did you install apache-paassenger modules? and made changes in apache conf file?
首先,创业板需要在系统上安装:
First, the gem needs to be installed on the system:
gem install passenger
在Apache模块编译之前,两个依赖包需要安装,以及:
Before the Apache module is compiled, two dependency packages need to be installed as well:
apt-get install curl-devel httpd-devel
使用此命令来启动Apache的安装:这将需要一些时间
Use this command to start the apache installation: It will take some time
passenger-install-apache2-module
乘客将显示一些内容的Apache
安装后:
Passenger will display some content after Apache
installs:
跟进,并在修改的(在/ etc / httpd的/ conf目录/ httpd.conf文件)
您将有指向应用程序公用文件夹并重新启动Apache服务器遵循这些资源紧密结合。
You will have to point to application public folder and restart the apache server follow with these sources closely.
<一个href=\"https://www.digitalocean.com/community/tutorials/how-to-install-rails-apache-and-mysql-on-ubuntu-with-passenger\" rel=\"nofollow\">https://www.digitalocean.com/community/tutorials/how-to-install-rails-apache-and-mysql-on-ubuntu-with-passenger
<一个href=\"https://www.digitalocean.com/community/tutorials/how-to-setup-a-rails-4-app-with-apache-and-passenger-on-centos-6\" rel=\"nofollow\">https://www.digitalocean.com/community/tutorials/how-to-setup-a-rails-4-app-with-apache-and-passenger-on-centos-6
它帮助时,我是做第一次,previous月
It helped when I did it for first time, previous month
这篇关于获取Rails的生产到端口80上运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!