質問編集履歴
6
httpd.confを修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -66,19 +66,13 @@
|
|
66
66
|
|
67
67
|
<Directory /var/www/html/lunchfriends/current>
|
68
68
|
|
69
|
-
|
69
|
+
Allow from all
|
70
70
|
|
71
71
|
Options -MultiViews
|
72
72
|
|
73
73
|
# Uncomment this if you're on Apache > 2.4:
|
74
74
|
|
75
|
-
|
75
|
+
Require all granted
|
76
|
-
|
77
|
-
Require all denied
|
78
|
-
|
79
|
-
Require ip ***.***.**.***
|
80
|
-
|
81
|
-
|
82
76
|
|
83
77
|
</Directory>
|
84
78
|
|
5
初心者マーク追加
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
4
apache, passengerの実行状況確認コマンドとその結果を追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -500,6 +500,90 @@
|
|
500
500
|
|
501
501
|
|
502
502
|
|
503
|
+
### apache, passengerの実行状況
|
504
|
+
|
505
|
+
```
|
506
|
+
|
507
|
+
# sudo /usr/sbin/passenger-memory-stats
|
508
|
+
|
509
|
+
|
510
|
+
|
511
|
+
|
512
|
+
|
513
|
+
Version: 5.2.3
|
514
|
+
|
515
|
+
Date : 2018-05-03 16:47:20 +0900
|
516
|
+
|
517
|
+
|
518
|
+
|
519
|
+
--------- Apache processes ---------
|
520
|
+
|
521
|
+
PID PPID VMSize Private Name
|
522
|
+
|
523
|
+
------------------------------------
|
524
|
+
|
525
|
+
7468 1 314.9 MB 0.4 MB /usr/sbin/httpd -DFOREGROUND
|
526
|
+
|
527
|
+
7507 7468 316.9 MB 0.4 MB /usr/sbin/httpd -DFOREGROUND
|
528
|
+
|
529
|
+
7508 7468 316.9 MB 0.4 MB /usr/sbin/httpd -DFOREGROUND
|
530
|
+
|
531
|
+
7509 7468 316.9 MB 0.5 MB /usr/sbin/httpd -DFOREGROUND
|
532
|
+
|
533
|
+
7512 7468 316.9 MB 0.4 MB /usr/sbin/httpd -DFOREGROUND
|
534
|
+
|
535
|
+
7513 7468 316.9 MB 0.4 MB /usr/sbin/httpd -DFOREGROUND
|
536
|
+
|
537
|
+
7595 7468 316.9 MB 0.4 MB /usr/sbin/httpd -DFOREGROUND
|
538
|
+
|
539
|
+
7601 7468 316.9 MB 0.3 MB /usr/sbin/httpd -DFOREGROUND
|
540
|
+
|
541
|
+
7602 7468 316.9 MB 0.2 MB /usr/sbin/httpd -DFOREGROUND
|
542
|
+
|
543
|
+
7603 7468 316.9 MB 0.3 MB /usr/sbin/httpd -DFOREGROUND
|
544
|
+
|
545
|
+
7604 7468 316.9 MB 0.3 MB /usr/sbin/httpd -DFOREGROUND
|
546
|
+
|
547
|
+
### Processes: 11
|
548
|
+
|
549
|
+
### Total private dirty RSS: 3.84 MB
|
550
|
+
|
551
|
+
|
552
|
+
|
553
|
+
|
554
|
+
|
555
|
+
-------- Nginx processes --------
|
556
|
+
|
557
|
+
|
558
|
+
|
559
|
+
### Processes: 0
|
560
|
+
|
561
|
+
### Total private dirty RSS: 0.00 MB
|
562
|
+
|
563
|
+
|
564
|
+
|
565
|
+
|
566
|
+
|
567
|
+
----- Passenger processes -----
|
568
|
+
|
569
|
+
PID VMSize Private Name
|
570
|
+
|
571
|
+
-------------------------------
|
572
|
+
|
573
|
+
7491 354.8 MB 2.1 MB Passenger watchdog
|
574
|
+
|
575
|
+
7498 1054.1 MB 4.9 MB Passenger core
|
576
|
+
|
577
|
+
7614 381.1 MB 87.1 MB Passenger RubyApp: /var/www/html/lunchfriends (production)
|
578
|
+
|
579
|
+
### Processes: 3
|
580
|
+
|
581
|
+
### Total private dirty RSS: 94.07 MB
|
582
|
+
|
583
|
+
```
|
584
|
+
|
585
|
+
|
586
|
+
|
503
587
|
### 環境情報(FW/ツールのバージョンなど)
|
504
588
|
|
505
589
|
|
3
rbenv のversionを追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -508,6 +508,8 @@
|
|
508
508
|
|
509
509
|
ruby: 2.4.3(rbenv)
|
510
510
|
|
511
|
+
rbenv 1.1.1-28-gb943955
|
512
|
+
|
511
513
|
rails 5.0.6
|
512
514
|
|
513
515
|
Phusion Passenger 5.2.3
|
2
設定ファイルを追記(deploy.rb, production.rb, Capifile.rb)
test
CHANGED
File without changes
|
test
CHANGED
@@ -100,6 +100,340 @@
|
|
100
100
|
|
101
101
|
|
102
102
|
|
103
|
+
### config/deploy/production.rb
|
104
|
+
|
105
|
+
```
|
106
|
+
|
107
|
+
# server-based syntax
|
108
|
+
|
109
|
+
# ======================
|
110
|
+
|
111
|
+
# Defines a single server with a list of roles and multiple properties.
|
112
|
+
|
113
|
+
# You can define all roles on a single server, or split them:
|
114
|
+
|
115
|
+
|
116
|
+
|
117
|
+
# server "example.com", user: "deploy", roles: %w{app db web}, my_property: :my_value
|
118
|
+
|
119
|
+
# server "example.com", user: "deploy", roles: %w{app web}, other_property: :other_value
|
120
|
+
|
121
|
+
# server "db.example.com", user: "deploy", roles: %w{db}
|
122
|
+
|
123
|
+
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
# role-based syntax
|
130
|
+
|
131
|
+
# ==================
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
# Defines a role with one or multiple servers. The primary server in each
|
136
|
+
|
137
|
+
# group is considered to be the first unless any hosts have the primary
|
138
|
+
|
139
|
+
# property set. Specify the username and a domain or IP for the server.
|
140
|
+
|
141
|
+
# Don't use `:all`, it's a meta role.
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
role :app, %w{vpslunch@***.***}
|
146
|
+
|
147
|
+
role :web, %w{vpslunch@***.***}
|
148
|
+
|
149
|
+
role :db, %w{vpslunch@***.***}
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
# Configuration
|
154
|
+
|
155
|
+
# =============
|
156
|
+
|
157
|
+
# You can set any configuration variable like in config/deploy.rb
|
158
|
+
|
159
|
+
# These variables are then only loaded and set in this stage.
|
160
|
+
|
161
|
+
# For available Capistrano configuration variables see the documentation page.
|
162
|
+
|
163
|
+
# http://capistranorb.com/documentation/getting-started/configuration/
|
164
|
+
|
165
|
+
# Feel free to add new variables to customise your setup.
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
# Custom SSH Options
|
174
|
+
|
175
|
+
# ==================
|
176
|
+
|
177
|
+
# You may pass any option but keep in mind that net/ssh understands a
|
178
|
+
|
179
|
+
# limited set of options, consult the Net::SSH documentation.
|
180
|
+
|
181
|
+
# http://net-ssh.github.io/net-ssh/classes/Net/SSH.html#method-c-start
|
182
|
+
|
183
|
+
#
|
184
|
+
|
185
|
+
# Global options
|
186
|
+
|
187
|
+
# --------------
|
188
|
+
|
189
|
+
set :ssh_options, {
|
190
|
+
|
191
|
+
port: 22,
|
192
|
+
|
193
|
+
keys: ['~/.ssh/id_rsa'],
|
194
|
+
|
195
|
+
forward_agent: true,
|
196
|
+
|
197
|
+
}
|
198
|
+
|
199
|
+
|
200
|
+
|
201
|
+
set :deploy_target, 'app'
|
202
|
+
|
203
|
+
set :branch, :master
|
204
|
+
|
205
|
+
|
206
|
+
|
207
|
+
#
|
208
|
+
|
209
|
+
# The server-based syntax can be used to override options:
|
210
|
+
|
211
|
+
# ------------------------------------
|
212
|
+
|
213
|
+
# server "example.com",
|
214
|
+
|
215
|
+
# user: "user_name",
|
216
|
+
|
217
|
+
# roles: %w{web app},
|
218
|
+
|
219
|
+
# ssh_options: {
|
220
|
+
|
221
|
+
# user: "user_name", # overrides user setting above
|
222
|
+
|
223
|
+
# keys: %w(/home/user_name/.ssh/id_rsa),
|
224
|
+
|
225
|
+
# forward_agent: false,
|
226
|
+
|
227
|
+
# auth_methods: %w(publickey password)
|
228
|
+
|
229
|
+
# # password: "please use keys"
|
230
|
+
|
231
|
+
# }
|
232
|
+
|
233
|
+
|
234
|
+
|
235
|
+
```
|
236
|
+
|
237
|
+
|
238
|
+
|
239
|
+
### config/deploy.rb
|
240
|
+
|
241
|
+
|
242
|
+
|
243
|
+
```
|
244
|
+
|
245
|
+
# config valid only for current version of Capistrano
|
246
|
+
|
247
|
+
# lock '3.3.5'
|
248
|
+
|
249
|
+
|
250
|
+
|
251
|
+
set :application, 'lunchfriends'
|
252
|
+
|
253
|
+
# set :repo_url, '****'
|
254
|
+
|
255
|
+
set :repo_url, ' ***'
|
256
|
+
|
257
|
+
# set :repo_url, '***'
|
258
|
+
|
259
|
+
# Default branch is :master
|
260
|
+
|
261
|
+
# ask :branch, proc { `git rev-parse --abbrev-ref HEAD`.chomp }.call
|
262
|
+
|
263
|
+
|
264
|
+
|
265
|
+
# Default deploy_to directory is /var/www/my_app_name
|
266
|
+
|
267
|
+
set :deploy_to, '/var/www/html/lunchfriends'
|
268
|
+
|
269
|
+
set :user, "vpslunch"
|
270
|
+
|
271
|
+
# Default value for :scm is :git
|
272
|
+
|
273
|
+
|
274
|
+
|
275
|
+
# set :scm, :git
|
276
|
+
|
277
|
+
# set rbenv
|
278
|
+
|
279
|
+
set :rbenv_type, :user # or :system, depends on your rbenv setup
|
280
|
+
|
281
|
+
set :rbenv_ruby, '2.4.3'
|
282
|
+
|
283
|
+
|
284
|
+
|
285
|
+
# Default value for :format is :pretty
|
286
|
+
|
287
|
+
# set :format, :pretty
|
288
|
+
|
289
|
+
|
290
|
+
|
291
|
+
# Default value for :log_level is :debug
|
292
|
+
|
293
|
+
# set :log_level, :debug
|
294
|
+
|
295
|
+
|
296
|
+
|
297
|
+
# Default value for :pty is false
|
298
|
+
|
299
|
+
# set :pty, true
|
300
|
+
|
301
|
+
|
302
|
+
|
303
|
+
# Default value for :linked_files is []
|
304
|
+
|
305
|
+
set :linked_files, fetch(:linked_files, []).push('config/database.yml')
|
306
|
+
|
307
|
+
set :linked_dirs, fetch(:linked_dirs, []).push('bin', 'log', 'tmp/pids', 'tmp/cache', 'tmp/sockets', 'vendor/bundle', 'public/system', 'public/uploads')
|
308
|
+
|
309
|
+
|
310
|
+
|
311
|
+
# Default value for default_env is {}
|
312
|
+
|
313
|
+
# set :default_env, { path: "/opt/ruby/bin:$PATH" }
|
314
|
+
|
315
|
+
|
316
|
+
|
317
|
+
# Default value for keep_releases is 5
|
318
|
+
|
319
|
+
# set :keep_releases, 5
|
320
|
+
|
321
|
+
|
322
|
+
|
323
|
+
namespace :deploy do
|
324
|
+
|
325
|
+
|
326
|
+
|
327
|
+
after :restart, :clear_cache do
|
328
|
+
|
329
|
+
on roles(:web), in: :groups, limit: 3, wait: 10 do
|
330
|
+
|
331
|
+
# Here we can do anything such as:
|
332
|
+
|
333
|
+
# within release_path do
|
334
|
+
|
335
|
+
# execute :rake, 'cache:clear'
|
336
|
+
|
337
|
+
# end
|
338
|
+
|
339
|
+
end
|
340
|
+
|
341
|
+
end
|
342
|
+
|
343
|
+
|
344
|
+
|
345
|
+
end
|
346
|
+
|
347
|
+
```
|
348
|
+
|
349
|
+
|
350
|
+
|
351
|
+
### Capifile
|
352
|
+
|
353
|
+
```
|
354
|
+
|
355
|
+
# Load DSL and set up stages
|
356
|
+
|
357
|
+
require "capistrano/setup"
|
358
|
+
|
359
|
+
|
360
|
+
|
361
|
+
# Include default deployment tasks
|
362
|
+
|
363
|
+
require "capistrano/deploy"
|
364
|
+
|
365
|
+
|
366
|
+
|
367
|
+
# Load the SCM plugin appropriate to your project:
|
368
|
+
|
369
|
+
#
|
370
|
+
|
371
|
+
# require "capistrano/scm/hg"
|
372
|
+
|
373
|
+
# install_plugin Capistrano::SCM::Hg
|
374
|
+
|
375
|
+
# or
|
376
|
+
|
377
|
+
# require "capistrano/scm/svn"
|
378
|
+
|
379
|
+
# install_plugin Capistrano::SCM::Svn
|
380
|
+
|
381
|
+
# or
|
382
|
+
|
383
|
+
require "capistrano/scm/git"
|
384
|
+
|
385
|
+
install_plugin Capistrano::SCM::Git
|
386
|
+
|
387
|
+
|
388
|
+
|
389
|
+
# Include tasks from other gems included in your Gemfile
|
390
|
+
|
391
|
+
#
|
392
|
+
|
393
|
+
# For documentation on these, see for example:
|
394
|
+
|
395
|
+
#
|
396
|
+
|
397
|
+
# https://github.com/capistrano/rvm
|
398
|
+
|
399
|
+
# https://github.com/capistrano/rbenv
|
400
|
+
|
401
|
+
# https://github.com/capistrano/chruby
|
402
|
+
|
403
|
+
# https://github.com/capistrano/bundler
|
404
|
+
|
405
|
+
# https://github.com/capistrano/rails
|
406
|
+
|
407
|
+
# https://github.com/capistrano/passenger
|
408
|
+
|
409
|
+
#
|
410
|
+
|
411
|
+
# require "capistrano/rvm"
|
412
|
+
|
413
|
+
require "capistrano/rbenv"
|
414
|
+
|
415
|
+
# require "capistrano/chruby"
|
416
|
+
|
417
|
+
require "capistrano/bundler"
|
418
|
+
|
419
|
+
require "capistrano/rails/assets"
|
420
|
+
|
421
|
+
require "capistrano/rails/migrations"
|
422
|
+
|
423
|
+
require "capistrano/passenger"
|
424
|
+
|
425
|
+
|
426
|
+
|
427
|
+
# Load custom tasks from `lib/capistrano/tasks` if you have any defined
|
428
|
+
|
429
|
+
Dir.glob("lib/capistrano/tasks/*.rake").each { |r| import r }
|
430
|
+
|
431
|
+
|
432
|
+
|
433
|
+
```
|
434
|
+
|
435
|
+
|
436
|
+
|
103
437
|
### apacheのエラーログ vi /var/log/httpd/error_log
|
104
438
|
|
105
439
|
|
1
vi /etc/httpd/conf/httpd.conf のソース部分を更新
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
capistranoでrailsのデプロイをしたはずがcurrentディレクトリのソースがアクセス時にrenderされません。
|
1
|
+
capistranoでrailsのデプロイをしたはずがcurrentディレクトリの最新のソースがサイトアクセス時にrenderされません。
|
test
CHANGED
@@ -20,13 +20,15 @@
|
|
20
20
|
|
21
21
|
```
|
22
22
|
|
23
|
-
LoadModule passenger_module /
|
23
|
+
LoadModule passenger_module /usr/lib64/httpd/modules/mod_passenger.so
|
24
24
|
|
25
25
|
<IfModule mod_passenger.c>
|
26
26
|
|
27
|
-
PassengerRoot /
|
27
|
+
PassengerRoot /usr/share/ruby/vendor_ruby/phusion_passenger/locations.ini
|
28
28
|
|
29
29
|
PassengerDefaultRuby /home/vpslunch/.rbenv/versions/2.4.3/bin/ruby
|
30
|
+
|
31
|
+
PassengerInstanceRegistryDir /var/run/passenger-instreg
|
30
32
|
|
31
33
|
</IfModule>
|
32
34
|
|