简体   繁体   English

Rails Webrick生产端口号

[英]Rails webrick production port number

How can I permanently change my application port number in production? 如何在生产中永久更改我的应用程序端口号?

I know I can specify the port number when starting the server rails s -p 3005 , but was wondering how to change it so that I dont have to specifiy the port number everytime I start up the app. 我知道我可以在启动服务器rails s -p 3005时指定端口号,但是想知道如何更改它,这样我每次启动应用程序时就不必指定端口号。

Don't use webrick in production. 不要在生产中使用webrick。

It is only optimized for development purposes. 仅针对开发目的进行了优化。 Use something like thin , unicorn or passenger for example. 例如,使用诸如独角兽乘客之类的东西。 You can find capistrano recipes to start or restart web servers when deploying the app. 部署应用程序时,您可以找到capistrano配方来启动或重新启动Web服务器。

This seems to answer your question even though the question references running in development. 即使问题引用正在开发中, 似乎仍在回答您的问题。 I tend to agree with modifying the config/boot.rb as per . 我倾向于修改配置/的boot.rb以同意

But, iltempo is correct that you should be using a different stack in production. 但是,iltempo是正确的,您应该在生产中使用其他堆栈。 I've had good luck with Passenger. 我和乘客有好运。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM