레일즈 서버 시작/중지

Jmnote (토론 | 기여)님의 2016년 1월 26일 (화) 10:59 판 (→‎서버 중지)
레일즈 서버 시작/중지

1 서버 시작

railsuser@zetawiki:~$ cd MyDemo/
railsuser@zetawiki:~/MyDemo$ rails server &
[1] 10622
=> Booting WEBrick
=> Rails 4.2.5 application starting in development on http://localhost:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
[2016-01-25 16:55:33] INFO  WEBrick 1.3.1
[2016-01-25 16:55:33] INFO  ruby 2.2.1 (2015-02-26) [x86_64-linux]
[2016-01-25 16:55:33] INFO  WEBrick::HTTPServer#start: pid=2017 port=3000

2 확인

railsuser@zetawiki:~/MyDemo$ netstat -tnlp | grep ruby
(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
tcp        0      0 127.0.0.1:3000          0.0.0.0:*               LISTEN      10622/ruby      
tcp6       0      0 ::1:3000                :::*                    LISTEN      10622/ruby
railsuser@zetawiki:~/MyDemo$ ps -ef | grep ruby | grep -v grep
testuser 10622 10263  2 08:49 pts/1    00:00:03 /usr/local/rvm/rubies/ruby-2.2.1/bin/ruby bin/rails server

3 서버 중지

railsuser@zetawiki:~/MyDemo$ kill -9 `pidof ruby`
railsuser@zetawiki:~/MyDemo$ 
[1]+  Killed                  rails server
railsuser@zetawiki:~/MyDemo$ 
railsuser@zetawiki:~/MyDemo$ ps -ef | grep ruby | grep -v grep
railsuser@zetawiki:~/MyDemo$

4 같이 보기

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}