0

I don't understand why it's not running on port 80 instead of port 3000 when I run the command RAILS_ENV=production rails s on the same line. I want it to run in production mode but it's not running on the correct port. Anyone know why? I'm trying to use Rubber but I haven't ran any commands for it only just changed some of the files like it says in this tutorial.

root@ip-000-00-00-000:/home/ubuntu/Git/# RAILS_ENV=production rails s => Booting Thin
=> Rails 3.2.11 application starting in production on \http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
\>> Thin web server (v1.5.1 codename Straight Razor)
\>> Maximum connections set to 1024
\>> Listening on 0.0.0.0:3000, CTRL+C to stop
^C>> Stopping ...
Exiting

Petesta
  • 1,623
  • 3
  • 19
  • 29
  • 1
    `RAILS_ENV=production rails server -p 80` – MrYoshiji Aug 22 '13 at 20:46
  • @MrYoshiji I did run that but I thought I didn't have to explicitly state which it should run on. I thought it automatically defaulted to port 80 when I'm in production mode? – Petesta Aug 22 '13 at 20:47
  • Aparently it does not run on 80 for production mode by default, you need to add the `-p 80` argument – MrYoshiji Aug 22 '13 at 20:49
  • It always defaults to `3000` unless you specify something else. – lurker Aug 22 '13 at 20:53
  • @MrYoshiji When deploying it with Rubber does it automatically run it on port 80? I'm just confused about whether I'm going to have to explicitly call it like that everytime or if Rubber takes care of that for me. – Petesta Aug 22 '13 at 20:55
  • @Petesta I have no idea, I think you'll have to do it manually each time you want to launch your app – MrYoshiji Aug 22 '13 at 21:11
  • @Petesta, have a look at this, there are several hints: http://stackoverflow.com/questions/3842818/how-to-change-rails-3-server-default-port-in-develoment – vee Aug 22 '13 at 21:34

1 Answers1

2

webrick runs on port 3000 by default(even in production mode). Pass the port number explicitly if you want to run on a different port.

usha
  • 28,973
  • 5
  • 72
  • 93