Skip to content

Commit de89cba

Browse files
authored
Merge pull request #33 from AdamG100/master
Updated IIS page
2 parents f2ff952 + 7ccb12c commit de89cba

File tree

1 file changed

+155
-72
lines changed

1 file changed

+155
-72
lines changed

docs/customizations/web-server-configurations/setting-up-iis.mdx

Lines changed: 155 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -5,122 +5,205 @@ sidebar_label: Setting up IIS with TCAdmin
55

66
# Setting up IIS with TCAdmin
77

8-
## Install IIS with Support for ASP.NET 4.0/4.5 Development
8+
## Prerequisites
99

10-
1. Install IIS on your system with support for ASP.NET 4.0/4.5 development. ASP.NET development can be found in Server Roles -> Web Server (IIS) -> Application Development - > .NET Extensibility 4.x.
10+
:::info Prerequisite
11+
Make sure you are running a supported Windows Server environment and have already downloaded and installed TCAdmin 2 before starting this guide.
12+
:::
13+
14+
:::caution Warning for IIS Users
15+
16+
If you are using IIS with TCAdmin, **do not configure your monitor ports as 80 or 443**. Instead, use the default ports **8880 and 8881**.
17+
18+
When the monitor starts, it reconfigures the ports using the HTTP listener. If ports 80 or 443 are assigned to the monitor, this can cause conflicts with IIS, resulting in service disruptions or unexpected behavior.
19+
20+
To avoid issues, ensure that your monitor ports are correctly set to **8880 and 8881** in the TCAdmin configuration.
21+
22+
:::
23+
24+
Before setting up IIS with TCAdmin, ensure that:
25+
26+
- You are running a Windows Server environment.
27+
- You have downloaded and installed TCAdmin 2.
28+
29+
## Step 1: Install IIS with ASP.NET 4.0/4.5 Support
30+
31+
1. Open **Server Manager** and select **Add Roles and Features**.
32+
2. Select **Web Server (IIS)** under **Server Roles**.
33+
3. Under **Application Development**, ensure the following features are enabled:
34+
- **ASP.NET 4.x**
35+
- **.NET Extensibility 4.x**
36+
4. Complete the installation process.
37+
38+
## Step 2: Set up SQLite Database (Skip if using MySQL)
39+
40+
:::tip Using SQLite
41+
If you are using an SQLite database, ensure you copy `sqlite3.dll` to the correct location (`C:\Windows\System32`).
42+
:::
43+
44+
If you're using SQLite for TCAdmin:
45+
46+
1. Copy the `sqlite3.dll` file from `TCAdmin2\Monitor\sqlite3.dll` to `C:\Windows\System32`.
47+
48+
## Step 3: Configure IIS for TCAdmin
1149

12-
## Set up SQLite Database
50+
### 1. Add User to IIS Group
1351

14-
1. Copy `TCAdmin2\Monitor\sqlite3.dll` to `C:\Windows\System32` if you are using an SQLite database.
52+
- Add the `TCAWeb` user to the `IIS_IUSRS` group. This ensures proper permissions for web access.
1553

16-
## Configure IIS
54+
### 2. Create a Website in IIS Manager
1755

18-
1. Add the user `TCAWeb` to the `IIS_IUSRS` group.
56+
1. Open **IIS Manager**.
57+
2. Right-click **Sites** > **Add Website**:
58+
- Set **Physical Path** to `C:\Program Files\TCAdmin2\ControlPanel.MVC`.
59+
- Set **Application Pool** to `.NET v4.5`.
60+
3. Right-click on the newly created website and select **Add Application**:
61+
- Name the application **Aspx** (case-sensitive).
62+
- Set **Physical Path** to `C:\Program Files\TCAdmin2\ControlPanel`.
63+
- Use the same **.NET v4.5** application pool.
1964

20-
2. Manually create a website in IIS Manager:
65+
### 3. Configure Website Settings
2166

22-
- Web root: `Program Files\TCAdmin2\ControlPanel.MVC`
23-
- Application pool: `.NET v4.5`
67+
1. In IIS Manager, select the website, click **Basic Settings**, and click **Connect As**.
68+
2. Enter the credentials for the Windows user running the TCAdmin website.
69+
3. Ensure this user has **full permissions** on the following folders:
70+
- `ControlPanel`
71+
- `ControlPanel.MVC`
72+
- `Cache`
73+
- `Temp`
74+
- `Logs`
75+
- `Database`
76+
- Read permissions for `Monitor\Shared`
2477

25-
3. In IIS Manager, right-click on the created website and select "Add Application":
78+
### 4. Configure `Aspx` Application
2679

27-
- Name: `Aspx` (case-sensitive)
28-
- Web root: `Program Files\TCAdmin2\ControlPanel`
29-
- Application pool: `.NET v4.5`
80+
Ensure the **Aspx** application uses the same user as the main website (from step 3).
3081

31-
4. Select the website in IIS Manager:
82+
### 5. Let's Encrypt (Optional)
3283

33-
- Click on "Basic Settings"
34-
- Under "Connect as...", enter the user and password of the Windows user that runs your website.
35-
- Ensure this user has full permissions on the following folders:
36-
- ControlPanel
37-
- ControlPanel.MVC
38-
- Cache
39-
- Temp
40-
- Logs
41-
- Database
42-
- Read permissions on Monitor\Shared
84+
:::note Let's Encrypt Option
85+
Using Let's Encrypt for SSL certificates is recommended if you don’t already have a custom SSL certificate.
86+
:::
87+
88+
If using Let's Encrypt, bind the website to a specific IP and hostname to prevent TCAdmin from changing the certificate.
4389

44-
5. If using TCAWeb, start the monitor in console mode and execute `tcaweb-pass` to obtain the password or attach `TCAdmin2\Monitor\TCAWeb.config` to a support ticket for assistance.
90+
### 6. Set Folder Permissions
4591

46-
6. Configure the `Aspx` application to run with the same user as the main website.
92+
:::caution Permissions
93+
Ensure that you assign the correct permissions to `IIS APPPOOL\.NET v4.5`. Missing or incorrect permissions can cause issues with the TCAdmin control panel.
94+
:::
4795

48-
7. If using Let's Encrypt, bind the website to a specific IP and hostname to prevent TCAdmin from changing the website's certificate.
96+
1. Grant full control to `IIS APPPOOL\.NET v4.5` on the following directories:
4997

50-
8. Give full permissions to `IIS APPPOOL\.NET v4.5` on the following folders:
51-
- C:\Program Files\TCAdmin2\Cache
52-
- C:\Program Files\TCAdmin2\Temp
53-
- C:\Program Files\TCAdmin2\Logs\Web
54-
- C:\Program Files\TCAdmin2\ControlPanel
55-
- C:\Program Files\TCAdmin2\ControlPanel.MVC
56-
- C:\Program Files\TCAdmin2\Database
98+
- `C:\Program Files\TCAdmin2\Cache`
99+
- `C:\Program Files\TCAdmin2\Temp`
100+
- `C:\Program Files\TCAdmin2\Logs\Web`
101+
- `C:\Program Files\TCAdmin2\ControlPanel`
102+
- `C:\Program Files\TCAdmin2\ControlPanel.MVC`
103+
- `C:\Program Files\TCAdmin2\Database`
57104

58-
## Database Configuration
105+
2. Under **"Connect as..."**, enter the user and password of the Windows user that runs your website.
106+
107+
:::important TCAWeb Setup
108+
If using **TCAWeb**, start the monitor in **console mode** and execute `tcaweb-pass` to obtain the password or attach `TCAdmin2\Monitor\TCAWeb.config` to a support ticket for assistance.
109+
:::
59110

60-
1. Execute the following command on your database to disable the built-in web server:
111+
```bash
112+
tcaweb-pass
113+
```
114+
115+
3. Configure the Aspx application to run with the same user as the main website.
116+
117+
## Step 4: Database Configuration
118+
119+
:::caution Warning
120+
Disabling the built-in TCAdmin web server is permanent unless you run the re-enable command provided.
121+
:::
122+
123+
1. To disable the built-in TCAdmin web server, run the following SQL command:
61124

62125
```sql
63-
DELETE FROM tc_server_enabled_components WHERE module_id = '07405876-e8c2-4b24-a774-4ef57f596384' AND component_id = 2 AND server_id = 1;
126+
DELETE FROM tc_server_enabled_components
127+
WHERE module_id = '07405876-e8c2-4b24-a774-4ef57f596384'
128+
AND component_id = 2
129+
AND server_id = 1;
64130
```
65-
66-
2. If you need to enable the built-in web server again, use the following command:
131+
If you ever wish to enable the built in web server again you can run the following SQL command:
67132

68133
```sql
69-
INSERT INTO tc_server_enabled_components (module_id, component_id, server_id) values ('07405876-e8c2-4b24-a774-4ef57f596384', 2, 1);
134+
INSERT INTO tc_server_enabled_components
135+
(module_id, component_id, server_id)
136+
VALUES ('07405876-e8c2-4b24-a774-4ef57f596384', 2, 1);
70137
```
138+
## Step 5: Disable Output Caching
71139

72-
## Disable Output Caching
140+
1. In IIS Manager, select your website.
141+
2. Double-click Output Caching.
142+
3. Under Actions, click Edit Feature Settings.
143+
4. Uncheck both Enable Cache and Enable kernel cache.
144+
5. Click OK.
73145

74-
1. Disable output caching to prevent issues with user sessions:
75-
- Open IIS Manager
76-
- Select your website
77-
- Double click on "Output Caching"
78-
- Under Actions on the right side, click on "Edit Feature Settings"
79-
- Uncheck "Enable Cache" and "Enable kernel cache"
80-
- Click OK
146+
## Step 6: Configure IIS for Multiple Worker Processes
81147

82-
## Configure IIS with Multiple Worker Processes
148+
:::tip Multiple Worker Processes
149+
Running multiple worker processes improves performance for high-traffic websites but requires proper session state configuration.
150+
:::
83151

84-
1. Follow the instructions above to disable the built-in web server.
85152

86-
2. Start the ASP.NET state service and set the startup to Automatic:
153+
1. Follow the instructions in Step 4 to disable the built-in web server.
87154

88-
- Go to Start > Administrative Tools > Services
155+
2. Start the ASP.NET State Service and set it to Automatic:
156+
- Go to Start > Administrative Tools > Services.
157+
- Right click on ASP.net state service > properties > Recovery
158+
- First failure: `Restart`
159+
- Second failure: `Restart`
160+
- Subsequent failures: `Restart`
89161

90-
3. Edit `TCAdmin2\ControlPanel\Web.config` and `TCAdmin2\ControlPanel.MVC\Web.config`:
162+
3. Edit the following web.config files:
91163

92-
- Replace `<sessionState timeout="30"/>` with `<sessionState mode="StateServer" stateConnectionString="tcpip=localhost:42424" cookieless="false" timeout="30" />`
164+
- TCAdmin2\ControlPanel\Web.config
165+
- TCAdmin2\ControlPanel.MVC\Web.config
93166

94-
4. Open IIS Manager and select the advanced properties of the .NET Application pool. Increase the number of worker processes as needed.
167+
3.1. Replace the session state configuration:
95168

96-
## Lets Encrpyt Install (recommended)
169+
```html
170+
<sessionState timeout="30" />
171+
```
172+
With:
97173

98-
## Installation
174+
```html
175+
<sessionState mode="StateServer" stateConnectionString="tcpip=localhost:42424" cookieless="false" timeout="30" />
176+
```
99177

100-
1. **Download Certify The Web:**
101-
Visit the official website of Certify The Web at [https://certifytheweb.com/](https://certifytheweb.com/) and download the appropriate version for your operating system (Windows).
178+
## Step 7: SSL Certificate Installation
102179

103-
2. **Install Certify The Web:**
104-
Run the installer and follow the on-screen instructions to install Certify The Web on your system.
180+
### Option 1: Install Let's Encrypt SSL (Recommended)
105181

106-
:::tip
107-
Here is the full documentation to Certify The Web [https://docs.certifytheweb.com/](https://docs.certifytheweb.com/)
182+
:::info Let's Encrypt Tip
183+
For automatic SSL management, Let's Encrypt is the recommended option. Certify The Web provides a simple interface to manage certificates.
108184
:::
109185

110-
## Use Custom SSL Certificate (Windows) (optional)
186+
1. Download Certify The Web: Download it from [Certify The Web](https://certifytheweb.com/).
187+
188+
2. Install and Configure:
111189

112-
1. Install the SSL certificate in Windows. Follow the instructions at [Trustico](https://www.trustico.com/install/import/iis7/iis7-pfx-installation.php).
190+
- Follow the on-screen instructions for installation.
191+
- For detailed documentation, visit [Certify The Web Documentation](https://docs.certifytheweb.com/).
113192

114-
2. Launch the TCAdmin 2 Configuration Utility:
193+
### Option 2: Use a Custom SSL Certificate
115194

116-
- Go to Start > Programs > TCAdmin 2 > Configuration Utility
195+
:::caution SSL Certificate Installation
196+
Ensure that the SSL certificate is correctly installed in Windows following the linked guide, as an incorrectly configured certificate can cause connection issues.
197+
:::
117198

118-
3. Navigate through the utility until you reach the IP and port settings.
199+
1. Install your custom SSL certificate following this [guide](https://www.trustico.com/install/import/iis7/iis7-pfx-installation.php).
119200

120-
4. Check the option to use a custom certificate and select it from the list.
201+
2. Open the TCAdmin 2 Configuration Utility and navigate to IP and Port Settings.
121202

122-
5. Continue through the utility until the monitor is restarted.
203+
3. Select your custom SSL certificate from the list and apply the changes.
123204

124-
:::note
125-
The actual URLs, paths, and commands may need adjustments based on your specific setup and requirements.
205+
:::tip Best Practices
206+
It’s a good idea to back up your configuration and website settings before making any major changes to the IIS or TCAdmin setup.
126207
:::
208+
209+
Adjust URLs, file paths, and commands based on your specific setup and configuration. For additional support, consult the official TCAdmin or IIS documentation.

0 commit comments

Comments
 (0)