dsfdfdfd6576578 2014-02-17 16:19
浏览 62
已采纳

帮助php和ruby on rails共存

I have a RoR app running on a server using Apache as the web server. I also have an instnace of moodle, an LMS based on PHP running. I have placed the web root of moodle inside the RoR space and for the most part it is working ok.

Inside moodle, if I go to sitename.com/moodle/my RoR intercepts that request and reports that it cannot find the page. If I go to sitename.com/moodle/my/index.php it works fine.

I tried creating a new virtual server but adding a second server running on 443 didnt work (the RoR based site is all under ssl).

Does anyone know of a way to tell RoR to ignore the moodle dir or get RoR to automatically detect and append the index.php to the path.

  • 写回答

1条回答 默认 最新

  • doupuzhimuhan9216 2014-02-17 19:46
    关注

    Me to had a same issue below is the apache2 config for the same kind of issue as describe below. Example folder is the rails application folder and "/en/blog" are the folder path in public folder of rails application in which i had a wordpress install so below configuration allow's apache to turn off passenger for a request made to "http:/example.com/en/blog" so this request is not process by passenger and this request is service as a normal php request so i was able to have a wordpress blog and a rails application running on same server.

    # !!! Be sure to point DocumentRoot to 'public'!

      DocumentRoot /var/www/example/public
    
      #RailsEnv production      
      <Directory /var/www/example/public>
         # This relaxes Apache security settings.
         AllowOverride all
         # MultiViews must be turned off.
         Options -MultiViews
      </Directory>
    
      <Location /en/blog>
         PassengerEnabled off
         <IfModule mod_rewrite.c>
           RewriteEngine On
           RewriteBase /en/blog/
           RewriteCond %{REQUEST_FILENAME} !-f
           RewriteCond %{REQUEST_FILENAME} !-d
           RewriteRule . /en/blog/index.php [L]
         </IfModule>
      </Location>
    

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 HFSS 中的 H 场图与 MATLAB 中绘制的 B1 场 部分对应不上
  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?