🔵 IIS (Windows)
Running Monitron SaaS on Windows with IIS is fully supported. This guide walks you through the complete setup.
📋 Onkosullar
- Windows Server 2019/2022 or Windows 10/11
- IIS 10+ with URL Rewrite Module
- PHP 8.2+ installed (via Web Platform Installer or manually)
🔧 Step 1: Install IIS & PHP
Install IIS
- Open Server Manager → Add Roles and Features
- Select Web Server (IIS)
- Under Role Services, enable:
- ✅ Common HTTP Features → Static Content, Default Document
- ✅ Application Development → CGI
- ✅ Security → Request Filtering
Install PHP
- Download PHP 8.3 (Non Thread Safe) from windows.php.net
- Extract to
C:\PHP - Copy
php.ini-productiontophp.ini - Edit
php.iniand enable required extensions:
extension_dir = "ext"
extension=bcmath
extension=curl
extension=fileinfo
extension=gd2
extension=mbstring
extension=openssl
extension=pdo_mysql ; or pdo_pgsql, pdo_sqlite
extension=sockets
extension=zip
Install URL Rewrite Module
Download and install from iis.net
📝 Step 2: Web.config
Create or verify the web.config file in public/:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<!-- URL Rewriting for Laravel -->
<rewrite>
<rules>
<rule name="Redirect Trailing Slashes" stopProcessing="true">
<match url="(.*)/$" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
</conditions>
<action type="Redirect" url="{R:1}" redirectType="301" />
</rule>
<rule name="Send Requests To Front Controller" stopProcessing="true">
<match url="^(.*)$" ignoreCase="false" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="index.php/{R:1}" />
</rule>
</rules>
</rewrite>
<!-- Block .env file access -->
<security>
<requestFiltering>
<hiddenSegments>
<add segment=".env" />
</hiddenSegments>
<fileExtensions>
<add fileExtension=".env" allowed="false" />
</fileExtensions>
</requestFiltering>
</security>
<!-- Default Document -->
<defaultDocument>
<files>
<clear />
<add value="index.php" />
</files>
</defaultDocument>
<!-- Custom Headers -->
<httpProtocol>
<customHeaders>
<add name="X-Frame-Options" value="SAMEORIGIN" />
<add name="X-Content-Type-Options" value="nosniff" />
<add name="X-XSS-Protection" value="1; mode=block" />
</customHeaders>
</httpProtocol>
</system.webServer>
</configuration>
🌐 Step 3: Create the IIS Site
- Open IIS Manager
- Right-click Sites → Add Website
- Fill in:
| Ayar | Deger |
|---|---|
| Site name | Monitron |
| Physical path | E:\monitron\public |
| Host name | your-domain.com |
| Port | 80 (or 443 with SSL) |
tehlike
Point to the public folder! NOT the root installation directory.
🔒 Step 4: Add SSL
- In IIS Manager, select your site
- Click Bindings → Add
- Set Type to https, port 443
- Select your SSL certificate
For free SSL, use win-acme (Let's Encrypt for Windows):
# Download and run win-acme
wacs.exe --target iis --siteid 1 --installation iis
⏰ Step 5: Scheduled Task (Cron Equivalent)
Windows uses Task Scheduler instead of cron:
- Open Task Scheduler
- Click Create Basic Task
- Name:
Monitron Scheduler - Trigger: Daily → set start time → Repeat every 1 minute for Indefinitely
- Action: Start a program
- Program:
C:\PHP\php.exe - Arguments:
artisan schedule:run - Start in:
E:\monitron
- Program:
Or use PowerShell:
$action = New-ScheduledTaskAction -Execute "C:\PHP\php.exe" -Argument "artisan schedule:run" -WorkingDirectory "E:\monitron"
$trigger = New-ScheduledTaskTrigger -Once -At (Get-Date) -RepetitionInterval (New-TimeSpan -Minutes 1) -RepetitionDuration ([TimeSpan]::MaxValue)
Register-ScheduledTask -TaskName "Monitron Scheduler" -Action $action -Trigger $trigger -User "SYSTEM" -RunLevel Highest
🔄 Step 6: Queue Worker Service
Use NSSM to run the queue worker as a Windows service:
# Download NSSM from nssm.cc
nssm install MonitronWorker "C:\PHP\php.exe" "artisan queue:work --sleep=3 --tries=3 --max-time=3600"
nssm set MonitronWorker AppDirectory "E:\monitron"
nssm set MonitronWorker Start SERVICE_AUTO_START
nssm start MonitronWorker