質問編集履歴
4
フォルダ構成追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -20,7 +20,7 @@
|
|
20
20
|
|
21
21
|
app.rb
|
22
22
|
|
23
|
-
config-unicorn.rb
|
23
|
+
config - unicorn.rb
|
24
24
|
|
25
25
|
config.ru
|
26
26
|
|
@@ -28,11 +28,13 @@
|
|
28
28
|
|
29
29
|
log
|
30
30
|
|
31
|
-
public-index.html
|
31
|
+
public - index.html
|
32
|
-
|
32
|
+
|
33
|
-
tmp-pid-unicorn.pid
|
33
|
+
tmp - pid - unicorn.pid
|
34
|
-
|
34
|
+
|
35
|
-
|
35
|
+
tmp - sockets - unicorn.sock
|
36
|
+
|
37
|
+
|
36
38
|
|
37
39
|
■app.rb ★ここのページを表示したい。
|
38
40
|
|
3
unicorn\.rbの追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -74,6 +74,32 @@
|
|
74
74
|
|
75
75
|
|
76
76
|
|
77
|
+
|
78
|
+
|
79
|
+
unicorn.rb内容
|
80
|
+
|
81
|
+
@dir = "/home/[ユーザー名]/projects/hogehoge/"
|
82
|
+
|
83
|
+
worker_processes 2
|
84
|
+
|
85
|
+
working_directory @dir
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
timeout 30
|
90
|
+
|
91
|
+
listen "#{@dir}tmp/sockets/unicorn.sock", :backlog => 64
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
pid "#{@dir}tmp/pids/unicorn.pid"
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
stderr_path "#{@dir}log/unicorn.stderr.log"
|
100
|
+
|
101
|
+
stdout_path "#{@dir}log/unicorn.stdout.log"
|
102
|
+
|
77
103
|
■nginxの設定
|
78
104
|
|
79
105
|
/etc/nginx/sites-available/default
|
2
フォルダ詳細追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -16,7 +16,39 @@
|
|
16
16
|
|
17
17
|
|
18
18
|
|
19
|
-
|
19
|
+
■フォルダ構成
|
20
|
+
|
21
|
+
app.rb
|
22
|
+
|
23
|
+
config-unicorn.rb
|
24
|
+
|
25
|
+
config.ru
|
26
|
+
|
27
|
+
Gemfile
|
28
|
+
|
29
|
+
log
|
30
|
+
|
31
|
+
public-index.html
|
32
|
+
|
33
|
+
tmp-pid-unicorn.pid
|
34
|
+
|
35
|
+
-sockets-unicorn.sock
|
36
|
+
|
37
|
+
■app.rb ★ここのページを表示したい。
|
38
|
+
|
39
|
+
require 'sinatra/base'
|
40
|
+
|
41
|
+
|
42
|
+
|
43
|
+
class App < Sinatra::Base
|
44
|
+
|
45
|
+
get '/' do
|
46
|
+
|
47
|
+
"<p>This is <i>dynamic</i> content served via unicorn: #{rand(36**6).to_s(36)}"
|
48
|
+
|
49
|
+
end
|
50
|
+
|
51
|
+
end
|
20
52
|
|
21
53
|
■unicornの設定
|
22
54
|
|
1
タグ追加
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|