VPS搭建ROR环境

root@vps:~# apt-get install build-essential

root@vps:~# apt-get install git-core mercurial subversion

root@vps:~# vim /etc/mysql/my.cnf

    default-character-set=utf8

root@vps:/usr/local/src# apt-get install wget curl

root@vps:~# cd /usr/local/src/

root@vps:/usr/local/src# wget http://rubyenterpriseedition.googlecode.com/files/ruby-enterprise_1.8.7-2011.03_amd64_ubuntu10.04.deb

更新地址:

http://www.rubyenterpriseedition.com/download.html

root@vps:/usr/local/src# dpkg -i ruby-enterprise_1.8.7-2011.03_amd64_ubuntu10.04.deb

root@vps:~# apt-get install php5-cli php5-cgi

libmysqld-dev

libmysql-ruby

libmysqlclient-dev  php5-mysql

root@vps:/usr/local/src# wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.10.tar.gz

root@vps:/usr/local/src# tar zxvf pcre-8.10.tar.gz

root@vps:/usr/local/src# wget http://nginx.org/download/nginx-0.8.54.tar.gz

root@vps:/usr/local/src# tar zxvf nginx-0.8.54.tar.gz

root@vps:/usr/local/src/nginx-0.8.54# apt-get install libcurl4-openssl-dev

root@vps:/usr/local/src/nginx-0.8.54# ./configure –sbin-path=/usr/local/sbin     –with-http_ssl_module –with-http_stub_status_module –with-http_gzip_static_module –with-pcre=/usr/local/src/pcre-8.10 –add-module=/usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.2/ext/nginx/

root@vps:/usr/local/src/nginx-0.8.54# make

root@vps:/usr/local/src/nginx-0.8.54# make install

root@vps:/usr/local/src/nginx-0.8.54# service apache2 stop

root@vps:/usr/local/src/nginx-0.8.54# nginx

root@vps:/usr/local/src/nginx-0.8.54# vim /usr/local/nginx/conf/nginx.conf

    http {

        …

        #——————–passenger————————————

        passenger_root /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.2;

        passenger_ruby /usr/local/bin/ruby;

        #—————————————————————–

    …}

root@vps:/usr/local/src/nginx-0.8.54# mkdir /usr/local/nginx/conf/vhosts

root@vps:/usr/local/src/nginx-0.8.54# vim /usr/local/nginx/conf/nginx.conf

    http {

        …

        include /usr/local/nginx/conf/vhosts/*;

    }

root@vps:/usr/local/src/nginx-0.8.54# vim /usr/local/nginx/conf/vhosts/rails_test

    server {

            listen       3000;

            server_name  100.110.110.110;

            root /var/www/test/railsdemo/public/;

            passenger_enabled on;

            rails_env development;

           }

root@vps:~# nginx -s reload

原文地址:

http://w.lxneng.com/vps