0

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.

Yogzzz
  • 2,735
  • 5
  • 36
  • 56

2 Answers2

6

Don't use webrick in production.

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.

iltempo
  • 15,718
  • 8
  • 61
  • 72
  • 1
    Let me reiterate iltempo's point: **Do not use Webrick in production**. It purposely sends verbose server headers including info such as the Webrick version and the Ruby version, up to the patch level. Prey scanners can target your server more effectively, and attackers can tailor their attacks to your server. I recommend using Thin because it's extremely easy to setup. – Ashitaka Apr 01 '13 at 22:55
0

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.

But, iltempo is correct that you should be using a different stack in production. I've had good luck with Passenger.

Community
  • 1
  • 1
Charles
  • 11
  • 2