Issue index
Resolve a "500 - Internal Server Error" when accessing an IIS website
Resolve website inaccessibility due to a port conflict in IIS
Resolve a "403.14 - Forbidden" error when accessing an IIS website
Resolve a "0x80070002 The system cannot find the file specified" error when accessing an IIS website
Resolve a "534 Policy requires SSL" error for FTP over TLS (FTPS) connections
Resolve a "Bad Request - Invalid Hostname" error when accessing an IIS website
Resolve a "500 - Internal Server Error"
Cause
Hidden detailed errors: By default, IIS shows a generic "500 error" page to remote clients to avoid exposing sensitive server information, such as code paths or database connection strings.
Configuration or code defects: The root cause is often syntax errors in the
web.configfile or application code exceptions.
Solution
By enabling Detailed Errors for a site in IIS, the server will display the specific error reason and code line number directly in the browser, which helps you accurately locate the problem.
Log on to an ECS instance.
Go to ECS console - Instances. In the top-left corner, select the region and resource group for the target instance.
Navigate to the details page of the target instance. Click Connect and select Workbench. Set the connection method to Terminal Connection, enter your username and password, and log on to the graphical terminal.
Open IIS Manager.
Click Start and select Server Manager.
In the upper-right corner of the Server Manager page, select .
Enable detailed errors.
In the Connections pane on the left side of Internet Information Services (IIS) Manager, select the target website (such as www.xxx) to go to its home page.
In the IIS section, double-click Error Pages.
In the Actions area on the right side of the page, click Edit Feature Settings, select Detailed Errors, and click OK.
Access the website to view the detailed error information.
Press
Ctrl + F5to force a refresh. The browser will display detailed error information and specify the line in the configuration file (such asweb.config) that contains the error. You can fix the corresponding configuration file or application code based on the detailed error message.
Block direct IP access in IIS
Blocking direct access to your website by IP address can prevent security risks caused by unregistered or malicious domain names resolving directly to your server's public IP address.
Log on to an ECS instance.
Go to ECS console - Instances. In the top-left corner, select the region and resource group for the target instance.
Navigate to the details page of the target instance. Click Connect and select Workbench. Set the connection method to Terminal Connection, enter your username and password, and log on to the graphical terminal.
Open IIS Manager.
Click Start and select Server Manager.
In the upper-right corner of the Server Manager page, select .
Bind a domain name.
In the left navigation bar of the Internet Information Services (IIS) Manager page, click the target website, and then click Bindings in the Actions column. In the Site Bindings window, double-click the record where the Hostname parameter is empty to open the Edit Site Binding window and enter the domain name.
The configuration is successful if the website is accessible via its domain name but not the server's public IP address.
Resolve IIS port conflicts
Log on to an ECS instance.
Go to ECS console - Instances. In the top-left corner, select the region and resource group for the target instance.
Navigate to the details page of the target instance. Click Connect and select Workbench. Set the connection method to Terminal Connection, enter your username and password, and log on to the graphical terminal.
Open Command Prompt as an administrator.
Click Start, enter
cmd, right-click Command Prompt, and select Run as administrator.Check whether the service port is in use.
Get-NetTCPConnection -LocalPort <port>The response includes the port status
Stateand the owning processOwningProcess.LocalAddress LocalPort RemoteAddress RemotePort State AppliedSetting OwningProcess ------------ --------- ------------- ---------- ----- -------------- ------------- :: 80 :: 0 Listen 4The example above indicates that port
80is occupied by the process whoseIDis4.Use the
PIDto find the specific application.Replace <PID> with the process ID displayed in the OwningProcess column in the previous step.
Get-Process -Id <PID>Resolve the port conflict.
Stop the process that is using the port.
If you confirm that the program that is using the port can be closed, you can use the
taskkillcommand to forcibly terminate the process.taskkill /F /PID <PID>Change the application port.
To reduce application port conflicts, use a port within the registered port range (8000–49151).
Click Start, select Server Manager, and in the top-right corner of the Server Manager page, select .
In the left navigation pane of the Internet Information Services (IIS) Manager page, click the target website, and then in the Actions pane, click Bindings.
In the Site Bindings window, select an existing binding record, click Edit, modify the port, and click OK.
Restart IIS.
iisreset /noforceAccess the website to verify that it is accessible.
Resolve a "403.14 - Forbidden" error
Cause
Missing Default Document: A default entry file (such as
index.htmlordefault.aspx) is not configured in the website's root directory or the accessed subdirectory.Directory browsing disabled: For security, IIS prohibits listing directory contents by default. This setting triggers a 403.14 error when a default document is not found.
Solution
Option 1: Configure a default document
Log on to an ECS instance.
Go to ECS console - Instances. In the top-left corner, select the region and resource group for the target instance.
Navigate to the details page of the target instance. Click Connect and select Workbench. Set the connection method to Terminal Connection, enter your username and password, and log on to the graphical terminal.
Open IIS Manager.
Click Start and select Server Manager.
In the upper-right corner of the Server Manager page, select .
Configure the default document.
In Internet Information Services (IIS) Manager, click the target website, and in the IIS section, double-click Default Document and click Enable.
In the Default Document list, add the entry file names for your website, such as
index.htmlordefault.htm. Ensure that the specified default document file exists in the physical root directory of your website.
Access the website again to verify that it is accessible.
Option 2: Enable directory browsing
Enabling directory browsing exposes your site's file and directory structure, which poses a security risk.
Log on to an ECS instance.
Go to ECS console - Instances. In the top-left corner, select the region and resource group for the target instance.
Navigate to the details page of the target instance. Click Connect and select Workbench. Set the connection method to Terminal Connection, enter your username and password, and log on to the graphical terminal.
Open IIS Manager.
Click Start and select Server Manager.
In the upper-right corner of the Server Manager page, select .
Enable directory browsing.
On the Internet Information Services (IIS) Manager page, in the left navigation bar, click the target website.
In the IIS section, double-click Directory Browsing, and in the Actions pane on the right, click Enable.
Access the website again to verify that it is accessible.
Resolve a "0x80070002" error
Cause
IIS relies on Handler Mappings to determine how to process requests for specific file types, such as .aspx files. If the .NET Framework is installed in the wrong order, or if its registration information in IIS is damaged or missing, IIS cannot find the correct component to handle ASP.NET requests. This causes a "file not found" error.
Solution
The solution is to use the aspnet_regiis.exe tool to re-register the correct .NET Framework version with IIS. This repairs the damaged handler mappings.
Click Start, enter
cmd, right-click Command Prompt, and select Run as administrator.Navigate to the
Frameworkdirectory.The
aspnet_regiis.exetool is located in the .NET Framework installation directory.It is usually located in the
C:\Windows\Microsoft.NET\Framework64directory. Take .NET Framework 4.x as an example:cd /d C:\Windows\Microsoft.NET\Framework64\v4.0.30319Uninstall ASP.NET.
aspnet_regiis.exe -uInstall and register ASP.NET with IIS.
aspnet_regiis.exe -iRestart IIS.
iisreset /noforceAccess the website to verify that it is accessible.
Resolve a "534 Policy requires SSL" error
Cause
The FTP client is configured to use FTP over TLS (FTPS), but the corresponding IIS FTP site is not configured to allow SSL connections. As a result, the server rejects the SSL/TLS handshake request from the client.
Solution
Check and enable the SSL connection policy for the target FTP site in IIS to ensure it matches the client's security connection requirements.
Log on to an ECS instance.
Go to ECS console - Instances. In the top-left corner, select the region and resource group for the target instance.
Navigate to the details page of the target instance. Click Connect and select Workbench. Set the connection method to Terminal Connection, enter your username and password, and log on to the graphical terminal.
Open IIS Manager.
Click Start and select Server Manager.
In the upper-right corner of the Server Manager page, select .
Configure the FTP site SSL policy.
Click the target FTP site and double-click FTP SSL Settings in the FTP area on the home page.
In the FTP SSL Settings area, set SSL Policy to Allow SSL connections, and then in the Actions window, click Apply.
Connect to the FTP site to verify that it is accessible.
Resolve a "Bad Request - Invalid Hostname" error
Cause
The IIS server received an HTTP request but could not find a configured site that matches the hostname in the request header for one of the following reasons:
Hostname not bound: The target website does not have a binding added in IIS for the accessed domain name.
Incorrect binding information: The website has a hostname bound, but it contains a spelling error or is bound to the wrong IP address or port.
Binding conflict: The domain name is already bound to another site in IIS, causing a request routing conflict.
Solution
Check and correctly configure the website bindings for the target site to ensure that the access domain name matches the site configuration.
Log on to an ECS instance.
Go to ECS console - Instances. In the top-left corner, select the region and resource group for the target instance.
Navigate to the details page of the target instance. Click Connect and select Workbench. Set the connection method to Terminal Connection, enter your username and password, and log on to the graphical terminal.
Open IIS Manager.
Click Start and select Server Manager.
In the upper-right corner of the Server Manager page, select .
Check and configure website bindings.
In the left navigation pane of the Internet Information Services (IIS) Manager page, click the target website, and then click Bindings in the Actions pane.
On the Site Binding page, bind a domain name or check that the information for the bound domain name is correct.
Add a new domain name.
On the Site Binding page, click Add.
On the Add Site Binding page, set the domain name in the Hostname field and click OK.
View or modify a bound domain name.
On the Site Binding page, double-click the existing binding record.
On the Edit Website binding page, view the binding information.
To modify the domain name, edit the Hostname and then click OK.
Access the website to verify that it is accessible.
Resolve a "500.19" error
Cause
The ApplicationHost.config or Web.config file contains a malformed or unrecognized XML element.
ApplicationHost.config is the server's root configuration file and defines global defaults and server-level settings.Web.config files provide application-level configuration and are used to override or extend settings inherited from upper levels.Solution
Log on to an ECS instance.
Go to ECS console - Instances. In the top-left corner, select the region and resource group for the target instance.
Navigate to the details page of the target instance. Click Connect and select Workbench. Set the connection method to Terminal Connection, enter your username and password, and log on to the graphical terminal.
Open IIS Manager.
Click Start and select Server Manager.
In the upper-right corner of the Server Manager page, select .
Check the
web.configfile.In the left-side navigation pane of the Internet Information Services (IIS) Manager page, click the target website, and then click Browse in the Actions area to go to the site directory.
Open the
web.configconfiguration file in the site directory, and refer to the IIS Configuration Reference to check and fix it.
Check the
ApplicationHost.configfile.Go to the
C:\Windows\System32\inetsrv\config\folder, open theApplicationHost.configconfiguration file, and refer to ApplicationHost.config configuration to check and fix the file.Open Command Prompt and restart IIS.
iisreset /noforceAccess the website to verify that it is accessible.