dqrqp8492 2012-06-02 20:54
浏览 65
已采纳

指向虚拟目录

I deployed an application on Heroku and I used a folder to place all my files inside thus now my application is only accesible from:

http://myapp.heroku.com/app/

Is it possible to create a virtual root to point

http://myapp.heroku.com -> http://myapp.heroku.com/app/ ?

Something similar to Apache VirtualHost?:

<VirtualHost 10.1.2.3>
  ServerAdmin webmaster@host.foo.com
  DocumentRoot /www/docs/host.foo.com
  ServerName host.foo.com
  ErrorLog logs/host.foo.com-error_log
  TransferLog logs/host.foo.com-access_log
</VirtualHost>

Thanks in advance.

  • 写回答

2条回答 默认 最新

  • douzouchang7448 2012-06-02 21:06
    关注

    Yes you can configure the apache as well, however, this needs some changes on your system.

    I've compiled a blog post recently that shows this (as the last part), it also shows how you can compile your own PHP extensions for heroku:

    PHP on Heroku, again (by hakre; 20 May 2012)

    It basically works by extending the standard configuration with your additional settings in another file. Look for the Configure the Webroot section, that's where it starts:

    Now comes the next tricky part that is specifying the webroot. Specifying the webroot needs a little bit more work and background information. The CVBacklogs applications webroot in the git-tree is src/app/public. For Heroku, by default, the webroot is the root of the git-tree. That directory is internally mapped to /app/www btw. So what this needs is to create a so called Procfile that starts a sh-script each time the Heroku app web-node starts. That script then modifies the Apache configuration and includes your own config which is setting the webroot to /app/www/src/app/public. So we create the procfile, a config directory, the script and the Apache configuration. Ready?

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 孟德尔随机化结果不一致
  • ¥15 深度学习残差模块模型
  • ¥50 怎么判断同步时序逻辑电路和异步时序逻辑电路
  • ¥15 差动电流二次谐波的含量Matlab计算
  • ¥15 Can/caned 总线错误问题,错误显示控制器要发1,结果总线检测到0
  • ¥15 C#如何调用串口数据
  • ¥15 MATLAB与单片机串口通信
  • ¥15 L76k模块的GPS的使用
  • ¥15 请帮我看一看数电项目如何设计
  • ¥23 (标签-bug|关键词-密码错误加密)