posts - 8,  comments - 5,  trackbacks - 0

Although there is too much articals in webwork to subscribe the process intall the rails and apache, but I feel difficult to find a usefull and full instructions which can lead me step by step to reach the end.So here is the artical.
 
1.install rails
   1)download instantrails from rails web http://www.rubyonrails.org/
   2)unzip it into a folder which has no blank  in the path.
   It is so easy, isn't it?
2.install apache2
   1.)If you want to use the fastcgi with rails, as far as I know , my recommandation is 2.0.* apache, because I found that rubyforapache is not available for 2.2*. so you can download it  from apache.org.
   2)install apache2, just follow the next button.
3.install rubyforapache
   Install this to use rails on the Apache.
   1)download rubyforapache in windows from rubyforge https://rubyforge.org/projects/rubyforapache/. You can choose the appropriate version  .May be the newer the better.
   2)Install it, carefully fill the path for ruby and apache. And you should have the adiministration privilege , or have the privilege to put the libfcgi.dll into the folder c:\windows\system32.The install program will put the *.so into apache/modules folder.
   3)config fcgi in apache, add the line below into httpd.conf
   LoadModule fastcgi_module modules/mod_fastcgi.so

<IfModule mod_fastcgi.c>
  AddHandler fastcgi-script .fcgi
</IfModule>

FastCgiConfig -restart-delay 120 -idle-timeout 150 -appConnTimeout 100 -init-start-delay 100 -startDelay 100

4.install mod_auth_sspi.so
   1)Download it from sourceforge. 
   2)unzip the zip file. Copy bin/mod_auth_sspi.so to apache/modules/
   3)modify httpd.conf .remember , change the the path into your own path.

LoadModule sspi_auth_module modules/mod_auth_sspi.so   #add

DocumentRoot "D:\tool\InstantRails\rails_apps"   #modify
AliasMatch ^/([^/]*)(.*) "D:\tool\InstantRails\rails_apps/$1/public$2" #add

#add

<Directory "D:\tool\InstantRails\rails_apps">
 AddHandler fastcgi-script .fcgi 
  Options ExecCGI FollowSymLinks
  AllowOverride all
  Allow from all
  Order allow,deny
 
  AuthName "My Intranet"
  AuthType SSPI
  SSPIAuth On
  SSPIAuthoritative On
  require valid-user
</Directory>

Ok, now all needed have been ready, so you can generate a new rails app in the folder "D:\tool\InstantRails\rails_apps". and modify the app's public/.htaccess and dispatch.fcgi.

.htaccess should be like this
AddHandler fastcgi-script .fcgi
AddHandler cgi-script .cgi
Options +FollowSymLinks +ExecCGI

RewriteEngine On

RewriteRule ^$ index.html [QSA]
RewriteRule ^([^.]+)$ $1.html [QSA]
RewriteCond %{REQUEST_FILENAME} !-f
#RewriteRule ^(.*)$ dispatch.cgi [QSA,L]
RewriteRule ^(.*)$ dispatch.fcgi [QSA,L] #be carefull of this fcgi
RewriteBase /cookbook

ErrorDocument 500 "<h2>Application error</h2>Rails application failed to start properly"
 
and the dispatch.fcgi should have a head like
#!D:/tool/InstantRails/ruby/bin/ruby 
#it's should be your own ruby path.

Now, start the Apache ,   open the IE, try it.

posted on 2007-03-02 15:07 Steven.L 阅读(536) 评论(0)  编辑 收藏 引用 所属分类: ruby on rails
只有注册用户登录后才能发表评论。
<2024年11月>
272829303112
3456789
10111213141516
17181920212223
24252627282930
1234567

常用链接

留言簿(1)

随笔分类(12)

随笔档案(8)

文章档案(1)

最新随笔

搜索

  •  

最新评论

阅读排行榜

评论排行榜