1、linux下源码编译redmine(待续...)
2、源码编译apache
省略
3、源码编译passenger
Java代码 收藏代码
wget http://rubyforge.org/frs/download.php/75548/passenger-3.0.11.tar.gz
tar -zxvf passenger-3.0.11.tar.gz
cp passenger-3.0.11 /usr/local
cd /usr/local/passenger-3.0.11
./bin/passenger-install-apache2-module
4、安装完成后修改apache的http.conf文件
passenger安装完成后会出现如下提示:
Java代码 收藏代码
Please edit your Apache configuration file, and add these lines:
LoadModule passenger_module /usr/local/passenger-3.0.11/ext/apache2/mod_passenger.so
PassengerRoot /usr/local/passenger-3.0.11
PassengerRuby /usr/local/bin/ruby
After you restart Apache, you are ready to deploy any number of Ruby on Rails
applications on Apache, without any further Ruby on Rails-specific
configuration!
--------------------------------------------
Deploying a Ruby on Rails application: an example
Suppose you have a Rails application in /somewhere. Add a virtual host to your
Apache configuration file and set its DocumentRoot to /somewhere/public:
ServerName www.yourhost.com
DocumentRoot /somewhere/public # <-- be sure to point to 'public'!
AllowOverride all # <-- relax Apache security settings
Options -MultiViews # <-- MultiViews must be turned off
And that's it! You may also want to check the Users Guide for security and
optimization tips, troubleshooting and other useful information:
/u01/passenger-2.2.11/doc/Users guide Apache.html
Enjoy Phusion Passenger, a product of Phusion (www.phusion.nl)
http://www.modrails.com/
Java代码 收藏代码
根据上面的提示,添加Passenger的配置到httpd.conf中:
LoadModule passenger_module /usr/local/passenger-3.0.11/ext/apache2/mod_passenger.so
PassengerRoot /usr/local/passenger-3.0.11
PassengerRuby /usr/local/bin/ruby
在httpd.conf中添加虚拟主机:
<VirtualHost *:80>
ServerName localhost
ServerAdmin webmaster@xxxxxx.com
DocumentRoot /opt/redmine-1.2/public
ErrorLog logs/redmine_error_log
<Directory “/opt/redmine-1.2/public”>
Options Indexes ExecCGI FollowSymLinks
Order allow,deny
Allow from all
AllowOverride all
</Directory>
</VirtualHost>
5、重启apache
Java代码 收藏代码
/etc/init.d/httpd restart
(责任编辑:IT) |