Get Ruby
sudo apt-get install ruby-full build-essential
Get Apache
sudo apt-get install apache2 apache2-mpm-prefork apache2-prefork-dev
Get and install passenger
gem install passenger
passenger-install-apache2-module
配置文件apache2
/etc/apache2/mods-available 目录下
passenger.conf中:
<IfModule mod_passenger.c>
#passenger根目录,按照自己的配
PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-3.0.7
#ruby根目录按照自己的配
PassengerRuby /usr/bin/ruby1.8
</IfModule>
passenger.load中:
#加载passenger模块
LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-3.0.7/ext/apache2/mod_passenger.so
/etc/apache2/sites-available 目录下
default 中配置虚拟服务器
Listen 8080
<VirtualHost *:8080>
ServerName www.yourhost.com
DocumentRoot /var/www/blog/public
RailsEnv development
<Directory /var/www/blog/public>
AllowOverride all
Options -MultiViews
</Directory>
</VirtualHost>
强制重新加载服务器配置文件
sudo /etc/init.d/apache2 force-reload
重启服务器
sudo /etc/init.d/apache2 restart
sudo apt-get install ruby-full build-essential
Get Apache
sudo apt-get install apache2 apache2-mpm-prefork apache2-prefork-dev
Get and install passenger
gem install passenger
passenger-install-apache2-module
配置文件apache2
/etc/apache2/mods-available 目录下
passenger.conf中:
<IfModule mod_passenger.c>
#passenger根目录,按照自己的配
PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-3.0.7
#ruby根目录按照自己的配
PassengerRuby /usr/bin/ruby1.8
</IfModule>
passenger.load中:
#加载passenger模块
LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-3.0.7/ext/apache2/mod_passenger.so
/etc/apache2/sites-available 目录下
default 中配置虚拟服务器
Listen 8080
<VirtualHost *:8080>
ServerName www.yourhost.com
DocumentRoot /var/www/blog/public
RailsEnv development
<Directory /var/www/blog/public>
AllowOverride all
Options -MultiViews
</Directory>
</VirtualHost>
强制重新加载服务器配置文件
sudo /etc/init.d/apache2 force-reload
重启服务器
sudo /etc/init.d/apache2 restart
浙公网安备 33010602011771号