Back to Question Center
0

Ruby a kan Rails - Nginx mai fasinja - 403 Semalt

1 answers:

Na yi ta neman amsar ga dogon lokaci yanzu don haka zan gwada a nan

Ina ƙoƙarin samun rubutun Ruby a kan Rails aikace-aikace tare da fasinja da nginx amma ina samun izini na 403 lokacin da nake ƙoƙarin shigar da shafin na. (Sunan yana gudana Semalt 17 x64). kuma wannan shi ne yadda na yi wannan a yanzu.

Na bi umarnin a kan wannan jagorar:
Fitarwa ta Generic, haɓakawa da kuma hanyar gyaran hanya ta hanyar via RubyGems

Bayan gudu fasinja-install-nginx-module Na shirya nginx. conf da kuma kara da cewa, a cikin ɓangaren HTTP, asusun uwar garke na kamar wannan:

     uwar garken {saurari 80;server_name www - play all free slots. yanki. com;tushen / gida / sunan mai amfani / rails-live / rails-app / public;rails_env ci gaba;fasinja a cikin;
}    

(Na kuma saita mai amfani zuwa www-data da kuma chown'ed / rails-app zuwa ga adireshin yanar gizo)

Sa'an nan Na sanya wani turɓãya. d rubutun don farawa / tsayawa / sake farawa bayan bin wannan jagorar a nan:
Red Hat Nginx Init Script

(Na canza hanyar zuwa ginx zuwa inda fasinja ya shigar da shi)

Yanzu zan iya fara / dakatar / sake kunna nginx ba tare da wata matsala ba, kuma lokacin da na ziyarci yankinku (ba tare da www. a cikin url) Ina zuwa ga "Barka da zuwa nginx!" shafin, don haka nginx alama yana aiki.

Ba zai yi kama Ruby yana gudana yayin da nginx ya kasance (Ban sani ba idan ya kamata, amma kawai don bayani wanda zai iya amfani) Lokacin da na bi umarnin da ke cikin alamar yana kama da wannan.

     [sunan uwar garken @ uwar garken] # ps aux | grep nginxtushen 23497 0. 0 0. 1 53716 1036? Ss Apr23 0:00 nginx: tsarin sarrafawa / fita / nginx / sbin / nginx
www-data 23498 0. 0 0. 1 54120 2004? S Apr23 0:00 nginx: tsarin aiki
tushen 23601 0. 0 0. 0 109404 868 pts / 1 S + 00:04 0:00 grep --color = auto nginx    


     [sunan uwar garken @ uwar garken] # ps aux | grep rubytushen 23612 0. 0 0. 0 109404 868 pts / 1 S + 00:06 0:00 grep --color = auto ruby    

Har ila yau, ina amfani da na '' ƙaramin '' a cikin rails-app don haka sai na duba haka kuma, idan dai.

     [sunan uwar garken @ uwar garken] # ps aux | grep na bakin cikitushen 23616 0. 0 0. 0 109404 868 pts / 1 S + 00:06 0:00 grep --color = auto na bakin ciki    

Ina makale a nan kuma ina iya bukatar taimako!

February 8, 2018

Idan uwar garke yana gudana Nginx + Passeneger, zaka iya fara aikace-aikacen Ruby ta hanyar haka:

cd / gida / mai amfani / rails_apps / mai amfani; sudo -u mai amfani / usr / gida / bin / ruby ​​/ usr / gida / bin / fasinja fara -p 12045 -e samar &

sudo -u mai amfani / usr / gida / bin / ruby ​​/ usr / gida / bin / fasinja fara -p 12421 -e samar & - umurnin don gudu shine allon

/ gida / mai amfani / rails_apps / mai amfani] # fasinja daina -p 12045

/ gida / mai amfani / rails_apps / mai amfani] # fasinja fara -p 12045

Duba izinin don / gida / sunan mai amfani / rails-live / rails-app / public .

Tabbatar cewa mai amfani da ke gudana Nginx ya karanta da kuma sanya izini.