LoginSignup
2
2

More than 5 years have passed since last update.

RailsアプリをCentOs上で動かす。

Last updated at Posted at 2017-06-15

1か2のどっちかでやる

1)apacheにpassengerを入れてapache上で動かせるようにする。
http://qiita.com/tporange/items/9ab8ec21cbe4b0b29379
virtualhostsでドメインによって動的にディレクトリ変えられるから便利。

2)webrickで立ち上げる。

rails server --binding=0.0.0.0

ドメイン:3000でアクセスできる。
http://blog.toshimaru.net/publish-rails-app-in-lan/
--binding=0.0.0.0をいれないと、ローカルホストとして解釈されるので、指定する必要がある。
0.0.0.0はワイルドカードで、LAN内全て許可。
webrickのデフォルトポートは3000だが、オプション -pで指定のポートに変えられる。

rails s -p 8080 --binding=0.0.0.0

さくっと動かせて便利。

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2