Recently, a friend of mine has encountered problems on the IIS server. After a period of operation, a database connection error is prompted when accessing the website on the server. Then, after Restarting IIS, the website can be accessed normally, I can't find out why this problem is caused. However, I finally came up with a stupid way, that is, to enable the IIS server to automatically restart at a scheduled time and specify a time in the Windows Task Plan for the IIS server to automatically restart.(This is just a stupid way. If you know what the cause is and the specific solution, please leave a message. Thank you .)
How to Set timed Automatic Restart of IIS Server: (here I use Windows Server 2003 as an example)
1. Enable the Task sched service for Windows. If you have not disabled the service, it is enabled by default. If you have disabled the service, you can enable the Task Scheduler Service as follows:
Choose "start"> "Control Panel"> "Administrative Tools"> "services"> "find the Task Scheduler Service in the window on the right, set the start type to automatic, and set the service status to" enable, the related information is as follows:
2. Choose "start"> "program"> "attachment"> "System Tools"> "Task Plan"> "add Task Plan". The task plan wizard is displayed, as shown in the following figure:
3. Click "Next", click "Browse" in the displayed window, find C: WINDOWSsystem32iisreset.exe, and click "open ".
4. In the displayed window, enter the name of the scheduled task and select the time for executing the task, as shown in the following figure:
5. Click the next button to set the start time, the cycle of the scheduled task, and the start date, as shown below:
6. Click "Next" and enter the user name and password of your computer as follows:
7. Click "Next", and the message "you have successfully planned the following tasks" appears. Click "finish", as shown in the following figure: