2016-07-04 6 views
0

После развертывания веб-сайта Grav CMS (http://getgrav.org) на Azure через ретрансляцию Bitbucket я получаю сообщение «У вас нет разрешения на просмотр этого каталога или страницы». когда я пытаюсь просмотреть сайт. Я еще не изменил настройки.Развертывание Grav CMS до Azure

ответ

5

Поскольку приложения PHP, работающие на Azure, размещены в IIS, поэтому ваша проблема возникает из-за того, что вы не настроили режим перезаписи URL-адресов в IIS.

Попробуйте создать файл с именем web.config в корневом каталоге приложения, со следующим содержанием:

<?xml version="1.0" encoding="UTF-8"?> 
<configuration> 
    <system.webServer> 
     <defaultDocument> 
      <files> 
       <remove value="index.php" /> 
       <add value="index.php" /> 
      </files> 
     </defaultDocument> 
     <rewrite> 
      <rules> 
       <rule name="request_filename" stopProcessing="true"> 
        <match url="." ignoreCase="false" /> 
        <conditions logicalGrouping="MatchAll"> 
         <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" /> 
         <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" /> 
        </conditions> 
        <action type="Rewrite" url="index.php" /> 
       </rule> 
       <rule name="user_accounts" stopProcessing="true"> 
        <match url="^user/accounts/(.*)$" ignoreCase="false" /> 
        <action type="Redirect" url="error" redirectType="Permanent" /> 
       </rule> 
       <rule name="user_config" stopProcessing="true"> 
        <match url="^user/config/(.*)$" ignoreCase="false" /> 
        <action type="Redirect" url="error" redirectType="Permanent" /> 
       </rule> 
       <rule name="user_error_redirect" stopProcessing="true"> 
        <match url="^user/(.*)\.(txt|md|html|php|yaml|json|twig|sh|bat)$" ignoreCase="false" /> 
        <action type="Redirect" url="error" redirectType="Permanent" /> 
       </rule> 
       <rule name="cache" stopProcessing="true"> 
        <match url="^cache/(.*)" ignoreCase="false" /> 
        <action type="Redirect" url="error" redirectType="Permanent" /> 
       </rule> 
       <rule name="bin" stopProcessing="true"> 
        <match url="^bin/(.*)$" ignoreCase="false" /> 
        <action type="Redirect" url="error" redirectType="Permanent" /> 
       </rule> 
       <rule name="backup" stopProcessing="true"> 
        <match url="^backup/(.*)" ignoreCase="false" /> 
        <action type="Redirect" url="error" redirectType="Permanent" /> 
       </rule> 
       <rule name="system" stopProcessing="true"> 
        <match url="^system/(.*)\.(txt|md|html|yaml|php|twig|sh|bat)$" ignoreCase="false" /> 
        <action type="Redirect" url="error" redirectType="Permanent" /> 
       </rule> 
       <rule name="vendor" stopProcessing="true"> 
        <match url="^vendor/(.*)\.(txt|md|html|yaml|php|twig|sh|bat)$" ignoreCase="false" /> 
        <action type="Redirect" url="error" redirectType="Permanent" /> 
       </rule> 
      </rules> 
     </rewrite> 
    </system.webServer> 
    <system.web> 
     <httpRuntime requestPathInvalidCharacters="&lt;,&gt;,*,%,&amp;,\,?" /> 
    </system.web> 
</configuration> 

А затем развернуть его с приложением к Azure. Кроме того, этот файл конфигурации можно найти в папке webserver-configs в вашем приложении grav. Или вы можете обратиться к https://github.com/Vivalldi/grav/blob/develop/webserver-configs/web.config в github.

Любая дополнительная забота, пожалуйста, сообщите мне.

+0

Я добавил файл web.config в корень моего приложения, но он все еще не работает. Я следую инструкциям здесь. https://getgrav.org/blog/grav-on-azure. NB: Хотя у меня есть web.config в корне, в папке webserver-configs есть еще один web.config. – user2721794

+0

Вы используете свой собственный репозиторий? Удобно ли вам предоставить ваш репозиторий для воспроизведения вашей проблемы? –

+0

Да, я здесь, здесь https://bitbucket.org/vics_linq/damblaise – user2721794