Skip to content

[DOC NEW] Windows IIS Config (Not Supported) #990

@MichaelOv

Description

@MichaelOv

Proposed Topic

How to set up i-doit with IIS

Target Audience

Windows Admins who want or need to use IIS

Content Suggestions

Schritt 1:

i-doit über Windows installer installieren

Schritt 2:

i-doit URL entfernen

Image

Schritt 3:

Rewrite modul herunterladen und installieren https://www.iis.net/downloads/microsoft/url-rewrite

Schritt 4:

Handlerzuordnung erstellen

Image

Image

Schritt 5:

Site einrichten HTTP oder HTTPS

Image

Schritt 6:

web.config Datei in den i-doit Ordner erstellen. .htaccess inhalt umwandeln lassen

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.webServer>

    <!-- Directory browsing off -->
    <directoryBrowse enabled="true" showFlags="Date, Time, Size, Extension, LongDate" />

    <!-- Rewriting rules (Pretty URLs, Redirects, etc.) -->
    <rewrite>
      <rules>
        <!-- Rewrite favicon.ico -->
        <rule name="Rewrite favicon.ico" stopProcessing="true">
          <match url="^favicon\.ico$" />
          <action type="Rewrite" url="images/favicon.ico" />
        </rule>

        <!-- Rewrite root to index.php -->
        <rule name="Rewrite root" stopProcessing="true">
          <match url="^$" />
          <conditions>
            <add input="{REQUEST_METHOD}" pattern="GET" />
          </conditions>
          <action type="Rewrite" url="index.php" />
        </rule>

        <!-- Pretty URLs -->
        <rule name="Pretty URLs" stopProcessing="true">
          <match url=".*" />
          <conditions>
            <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
          </conditions>
          <action type="Rewrite" url="index.php" appendQueryString="true" />
        </rule>

        <!-- Deny access to certain folders -->
        <rule name="Block imports">
          <match url="^imports/.*$" />
          <action type="CustomResponse" statusCode="403" statusReason="Forbidden" statusDescription="Access Denied" />
        </rule>
        <rule name="Block log">
          <match url="^log/.*$" />
          <action type="CustomResponse" statusCode="403" statusReason="Forbidden" statusDescription="Access Denied" />
        </rule>
        <rule name="Block temp except CSS/XSL">
          <match url="^temp/.*$" />
          <conditions>
            <add input="{REQUEST_URI}" pattern="\.css$|\.xsl$" negate="true" />
          </conditions>
          <action type="CustomResponse" statusCode="403" statusReason="Forbidden" statusDescription="Access Denied" />
        </rule>
        <rule name="Block uploads">
          <match url="^upload/(files|images)/.*$" />
          <action type="CustomResponse" statusCode="403" statusReason="Forbidden" statusDescription="Access Denied" />
        </rule>
        <rule name="Block vendor">
          <match url="^vendor/.*$" />
          <action type="CustomResponse" statusCode="403" statusReason="Forbidden" statusDescription="Access Denied" />
        </rule>
      </rules>
    </rewrite>

    <!-- Access restrictions -->
    <security>
      <requestFiltering>
        <fileExtensions>
          <!-- Block .yml -->
          <add fileExtension=".yml" allowed="false" />
          <!-- Block .ini -->
          <add fileExtension=".ini" allowed="false" />
        </fileExtensions>
      </requestFiltering>
    </security>

    <!-- MIME types for caching -->
    <staticContent>
      <clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="30.00:00:00" />
      <remove fileExtension=".ico" />
      <mimeMap fileExtension=".ico" mimeType="image/x-icon" />
    </staticContent>

    <!-- Headers for cache-control -->
    <httpProtocol>
      <customHeaders>
        <add name="Cache-Control" value="public" />
      </customHeaders>
    </httpProtocol>
        <defaultDocument>
            <files>
                <add value="index.php" />
            </files>
        </defaultDocument>

  </system.webServer>
</configuration>

Schritt 7:

Standarddokument index.php hinzufügen

Image

Schritt 8:

Berechtiugungen für den htdocs Ordner setzen. Vererbung aktivieren? Alle Rechte notwendig?

Image

Schritt 9 (optional):

Firewall Konfigurieren Beispiel New-NetFirewallRule -DisplayName "HTTP" -Direction Inbound -Action Allow -Protocol TCP -LocalPort 80

Schritt 10 (optional):

SSL Konfigurieren

  • Besorge ein SSL-Zertifikat (z. B. über Let's Encrypt oder kommerziell)
  • Im IIS-Manager:
  • Website auswählen → „Bindings...“
  • https hinzufügen, Zertifikat auswählen

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions