Je vais avoir Apache + phusion passager, j’ai mis
RailsEnv production
dans / etc / apache2 / sites-available / default fichier et avoir redémarré apache mais quand je suis en cours d’exécution
rails c > Rails.env.production?
il donne des billets où comme pour
> Rails.env.development?
ça donne vrai. Existe-t-il un autre moyen de redémarrer les passagers, car je pense que mettre «RailsEnv production» en défaut est la bonne solution? btw j’utilise
sudo service apache2 restart
Comment démarrer mon application ruby on rails en mode production avec passager + apache?
Votre application est probablement déjà en mode production.
Par défaut, rails c
charge l’application en mode développement.
Si vous souhaitez que votre console soit lancée en mode production, procédez comme suit:
RAILS_ENV=production rails c
La console et l’application Web sont deux rails différents et fonctionnent indépendamment.
Vous devez vérifier votre fichier production.log pour vous assurer que votre application s’exécute en production.
il suffit de créer un restart.txt dans le répertoire tmp de votre application
par exemple
touch %RAILS_ROOT%/tmp/restart.txt
regardez ici http://www.modrails.com/documentation/Users%20guide%20Apache.html section 3.3
Juste pour démarrer l’application avec un port particulier, utilisez la commande ci-dessous:
démarrage passager -a production de 0.0.0.0 -p 3000d -e
J’ai suivi les commandes listées dans PhusionPassenger docs ici et ils ont travaillé immédiatement.
deployer@staging:~$ passenger-config restart-app Please select the application to restart. Tip: re-run this command with --help to learn how to automate it. If the menu doesn't display correctly, press '!' ‣ /home/deployer/myapp/current (staging) /home/deployer/myapp_2/current (staging) Cancel Restarting /home/deployer/myapp/current (staging) deployer@staging:~$ passenger-config restart-app Please select the application to restart. Tip: re-run this command with --help to learn how to automate it. If the menu doesn't display correctly, press '!' /home/deployer/myapp/current (staging) ‣ /home/deployer/myapp_2/current (staging) Cancel Restarting /home/deployer/myapp_2/current (staging)