Bon vous allez me dire encore... ouai c'est vrai, mais là le script est
écrit !
Testé sur Debian et Ubuntu, il installe Ruby enterprise edition
feb-2010, passenger 3.0, Nginx 0.8.53, et rmagick.
Plus qu'à faire :
sudo wget
http://blog.escarworld.com/public/install-ree-nginx-passenger.sh
sudo chmod +x install-ree-nginx-passenger.sh
./install-ree-nginx-passenger.sh
Après l'installation, vous pouvez changer dans le fichier
/opt/nginx/conf/nginx.conf
passenger_root
/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/passenger-3.0.0;
passenger_ruby
/opt/ruby-enterprise-1.8.7-2010.02/bin/ruby;
en
passenger_root
/opt/ree/lib/ruby/gems/1.8/gems/passenger-3.0.0;
passenger_ruby /opt/ree/bin/ruby;
Mettez dans votre /opt/nginx/conf/nginx.conf où ça
doit aller(en dessous de l'exemple de server { .... } )
:
# Pour activer la compression Gzip (il y a ce qui faut dans le
script pour que ça marche)
gzip
on;
gzip_proxied
any;
gzip_http_version 1.1;
#gzip_min_length 1100;
gzip_comp_level 5;
#gzip_buffers 4
8k;
gzip_types text/plain
text/html text/css application/x-javascript text/xml application/xml
application/xml+rss text/javascript application/atom+xml;
#gzip_vary
on;
#gzip_disable "MSIE
[1-6]\.";
# Pour une application
server {
listen 80;
server_name
ledomainedemonappli.com;
root
/usr/local/webapps/monappli/current/public;
passenger_enabled
on;
}
Ajouter dans /etc/init.d le script d'nginx :
sudo cd /etc/init.d && sudo wget
http://blog.escarworld.com/public/nginx
sudo chmod +x /etc/init.d/nginx
Et voilà vous deployez votre application monappli avec
capistrano dans /usr/local/webapps .
Vous pouvez :
- démarrer nginx :
- redémarrer nginx :
sudo /etc/init.d/nginx
restart
- recharger la conf sans redémarrer :
sudo /etc/init.d/nginx
reload
- stopper nginx :
sudo /etc/init.d/nginx
stop
Si vous avez des améliorations... laissez des commentaires !