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 BP神经网络控制倒立摆
  • ¥20 要这个数学建模编程的代码 并且能完整允许出来结果 完整的过程和数据的结果
  • ¥15 html5+css和javascript有人可以帮吗?图片要怎么插入代码里面啊
  • ¥30 Unity接入微信SDK 无法开启摄像头
  • ¥20 有偿 写代码 要用特定的软件anaconda 里的jvpyter 用python3写
  • ¥20 cad图纸,chx-3六轴码垛机器人
  • ¥15 移动摄像头专网需要解vlan
  • ¥20 access多表提取相同字段数据并合并
  • ¥20 基于MSP430f5529的MPU6050驱动,求出欧拉角
  • ¥20 Java-Oj-桌布的计算