2

我想在 azure webrole 上设置 Laravel 框架并且必须更改文档根目录,但到目前为止我找不到如何做到这一点

我的部署项目文件夹:

├──webrole <- now this is document root
│  ├──app
│  ├──bin
│  ├──bootstrap
│  ├──config
│  ├──database
│  ├──public <- I want make this as document root
│  ├──resources
│  ├──storage
│  ├──tests
│  ├──vendor
│  ├──.env
│  ├──.env.example
│  ├──.gitattributes
│  ├──.gitignore
│  ├──artisan
│  ├──composer.json
│  ├──composer.lock
│  ├──gulpfile.js
│  ├──package.json
│  ├──phpspec.yml
│  ├──phpunit.xml
│  ├──readme.md
│  ├──server.php
│  ├──Web.cloud.config
│  └──Web.config
├──deploymentSettings.json
├──ServiceConfiguration.Cloud.cscfg
├──ServiceConfiguration.Local.cscfg
├──ServiceDefinition.csdef

我发现了这个Change approot path of Windows Azure WebRole但这是一个很老的问题并且没有得到批准的答案

我发现的唯一一种解决方法是使用重写规则,但我认为这并不安全......

4

1 回答 1

0

在 Azure 云服务 PHP WebRole 目录中,用于在 IIS 上配置 PHP 站点应用程序的位置web.config和文件。web.cloud.config

Web 可以在这些文件中找到如下内容:

<system.webServer>
    <defaultDocument>
      <files>
        <clear />
        <add value="index.php" />
      </files>
    </defaultDocument>
  </system.webServer>

我们可以修改设置defaultDocument以更改您的 laravel 应用程序的文档根目录:

<system.webServer>
    <defaultDocument>
      <files>
        <clear />
        <add value="public/index.php" />
      </files>
    </defaultDocument>
  </system.webServer>
于 2016-02-15T02:33:57.177 回答