打印

rails+apache在windows下配置一直不成功!

rails+apache在windows下配置一直不成功!

apache版本2.2,配置内容如下
复制内容到剪贴板
代码:
ProxyRequests Off

<Proxy *>
Order deny,allow
Allow from all
</Proxy>

<VirtualHost *:80>
ServerName www.moyu2.com
DocumentRoot D:/xielei/tlshow/public

<Directory D:/xielei/tlshow/public>
Options Indexes FollowSymLinks
AllowOverride none
Order allow,deny
Allow from all
</Directory>

ProxyPass /stylesheets !
ProxyPass /javascripts !
ProxyPass /images !
ProxyPreserveHost on
ProxyPass / http://127.0.0.1:3000/
ProxyPassReverse / http://127.0.0.1:3000/

</VirtualHost>
使用IP直接访问3000端口一切正常
http://121.11.81.250:3000
但是使用域名就乱套了....很多样式不正确..js也不能正确执行...为什么呢?
http://www.moyu2.com
ie和firefox显示的效果完全不一样.
在firefox下.只是样式乱了..脚本可以正常.执行.
在ie下..不但样式是乱的,连脚本都执行不了..

使用IE点击下边的连接的时候rails有如下异常
复制内容到剪贴板
代码:
Processing ApplicationController#index (for 66.249.72.48 at 2008-07-04 22:52:01) [GET]
Session ID: abe50a5ae25bf7ca8d009dadf3ee5db2
Parameters: {}

ActionController::RoutingError (No route matches "/comment/id=895" with {:method=>:get}):
d:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1441:in `recognize_path'
d:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1424:in `recognize'
d:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:170:in `handle_request'
d:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch'
d:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi'
d:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch'
d:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/../lib/mongrel/rails.rb:76:in `process'
d:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/../lib/mongrel/rails.rb:74:in `synchronize'
d:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/../lib/mongrel/rails.rb:74:in `process'
d:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/../lib/mongrel.rb:159:in `process_client'
d:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/../lib/mongrel.rb:158:in `each'
d:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/../lib/mongrel.rb:158:in `process_client'
d:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/../lib/mongrel.rb:285:in `run'
d:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/../lib/mongrel.rb:285:in `initialize'
d:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/../lib/mongrel.rb:285:in `new'
d:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/../lib/mongrel.rb:285:in `run'
d:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/../lib/mongrel.rb:268:in `initialize'
d:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/../lib/mongrel.rb:268:in `new'
d:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/../lib/mongrel.rb:268:in `run'
d:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/../lib/mongrel/configurator.rb:282:in `run'
d:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/../lib/mongrel/configurator.rb:281:in `each'
d:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/../lib/mongrel/configurator.rb:281:in `run'
d:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/mongrel_rails:128:in `run'
d:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/../lib/mongrel/command.rb:212:in `run'
d:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/mongrel_rails:281
d:/ruby/bin/mongrel_rails:19:in `load'
d:/ruby/bin/mongrel_rails:19

Rendering D:/xielei/tlshow/public/404.html (404 Not Found)

TOP

这一段是多余的
复制内容到剪贴板
代码:
<Directory D:/xielei/tlshow/public>
Options Indexes FollowSymLinks
AllowOverride none
Order allow,deny
Allow from all
</Directory>
然后把dispatch.*和.htaccess删除

再试试
First they ignore you, then they laugh at you, then they fight you, then you win.

TOP

还是不成啊....问题依然存在...我用lighttpd配了一个,也是不行.同样的问题...

$HTTP["host"] =~ "(^|\.)moyu2\.com" {
server.name = "www.moyu2.com"
server.document-root = "D:/xielei/tlshow/public"
server.errorlog = "D:/xielei/tlshow/cuowu.log"
accesslog.filename = "D:/xielei/tlshow/cuowu.log"
proxy.debug = 0
proxy.balance = "fair"
proxy.server = ( "/" =>
        (
                (
                "host" => "127.0.0.1", "port" => 3000)
                )
        )
}

TOP

那你把
复制内容到剪贴板
代码:
ProxyPass /stylesheets !
ProxyPass /javascripts !
ProxyPass /images !
先去掉看看
First they ignore you, then they laugh at you, then they fight you, then you win.

TOP

去掉也是一样地...也会乱七八糟..而且在打开网站的时候看左下角的状态栏,会显示连接很多莫名其妙的网站....真是郁闷啊!!!版主,你们的ROR虚拟机没有便宜点的?我弄200M空间就够用了.

TOP

那你有把www.moyu2.com加到本机的hosts文件,并指向本机了吗?

主机目前没有更便宜的
First they ignore you, then they laugh at you, then they fight you, then you win.

TOP

我在服务器上弄,要配hosts吗?刚才试了一下,一样的!!乱乱的

TOP