ruby on rails+nginx+passenger+ubuntu
ruby使用rvm安装
在使用rmv安装的ruby时候必须要使用rvmsudo来代替sudo
一.安装passenger
$sudogeminstallpassenger
二.安装Nginx
$rvmsudopassenger-install-nginx-module
三.配置具体的nginx的server
打开nginx的配置文件sudogedit/opt/nginx/conf/nginx.conf&配置里面的server
server{
listen80;
server_namelocalhost;
charsetutf-8;
#access_loglogs/host.access.logmain;
location/{
root/home/xxxx/project.root/<spanstyle="color:#ff0000;">public</span>;(一定要是public,否者会出现403错误)
indexindex.htmlindex.htm;
passenger_enabledon;
autoindexon;
rails_envdevelopment;
}
重新启动nginx就可以看到自己部署后运行的项目
[url]http://blog.csdn.net/renkai611919/article/details/7879877[/url]
https://github.com/ruby-china/ruby-china/wiki/Ubuntu-12.04-%E4%B8%8A%E4%BD%BF%E7%94%A8-Nginx-Passenger-%E9%83%A8%E7%BD%B2-Ruby-on-Rails