Redmine+Apache+SVN+Postfix配置(3)
作者:iifksp 来源:蓝色理想 时间:2010-07-05 11:20:00
代码:
ruby script/server webrick -e production
默认的管理员用户名和密码都是admin,进入系统后就可以开始熟悉下了。可以为每个人定义语言环境。下图是管理页面。
在apache上部署
其自带的webrick可能不能满足使用需求,那么就把它配置到apache上。
apache运行ROR有多种方式,这里使用passenger。
代码:
apt-get install build-essential
apt-get install apache2-prefork-dev libaprutil1-dev libapr1-dev ruby1.8-dev
然后安装 passenger
代码:
gem install passenger
passenger-install-apache2-module
如果报passenger-install-apache2-module这条命令找不到的话,那么通过下面的命令查看执行路径:
代码:
gem environment
代码:
RubyGems Environment:
- RUBYGEMS VERSION: 1.3.5
- RUBY VERSION: 1.8.7 (2010-01-10 patchlevel 249) [i486-linux]
- INSTALLATION DIRECTORY: /var/lib/gems/1.8
- RUBY EXECUTABLE: /usr/bin/ruby1.8
- EXECUTABLE DIRECTORY: /var/lib/gems/1.8/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86-linux
- GEM PATHS:
- /var/lib/gems/1.8
- /root/.gem/ruby/1.8
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
其中,EXECUTABLE DIRECTORY就是命令的全路径,所以对于我例子里的情况执行
代码:
/var/lib/gems/1.8/bin/passenger-install-apache2-module
根据提示安装和部署。
passenger会在本机编译并成为apache的一个模块。安装过程中会遇到下面的提示信息(根据版本的不同,信息也会稍有变化):
代码:
Welcome to the Phusion Passenger Apache 2 module installer, v2.2.13.
This installer will guide you through the entire installation process. It
shouldn't take more than 3 minutes in total.
Here's what you can expect from the installation process:
1. The Apache 2 module will be installed for you.
2. You'll learn how to configure Apache.
3. You'll learn how to deploy a Ruby on Rails application.
Don't worry if anything goes wrong. This installer will advise you on how to
solve any problems.
代码:
The Apache 2 module was successfully installed.
Please edit your Apache configuration file, and add these lines:
LoadModule passenger_module /var/lib/gems/1.8/gems/passenger-2.2.13/ext/apache2/mod_passenger.so
PassengerRoot /var/lib/gems/1.8/gems/passenger-2.2.13
PassengerRuby /usr/bin/ruby1.8
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:
<VirtualHost *:80>
ServerName www.yourhost.com
DocumentRoot /somewhere/public # <-- be sure to point to 'public'!
<Directory /somewhere/public>
AllowOverride all # <-- relax Apache security settings
Options -MultiViews # <-- MultiViews must be turned off
</Directory>
</VirtualHost>
And that's it! You may also want to check the Users Guide for security and
optimization tips, troubleshooting and other useful information:
/var/lib/gems/1.8/gems/passenger-2.2.13/doc/Users guide Apache.html
Enjoy Phusion Passenger, a product of Phusion (www.phusion.nl) :-)
http://www.modrails.com/
Phusion Passenger is a trademark of Hongli Lai & Ninh Bui
.
根据提示信息部署,我这里的步骤稍有不同。