Adding a Protected Directory
WTP monitors website directories in real time, backs up files, and restores tampered files using the backup, protecting websites from Trojan horses, illegal links, and tampering.
Constraints and Limitations
- WTP only protects files in the protected directories you set. It does not protect the files specified by the links in protected files.
- Ensure the local backup path is valid, or the specified directories will not be protected.
- The local backup path cannot overlap protected directories of the server, or local backup will fail.
- The disk of the local backup path must have sufficient space, or tampering cannot be prevented.
- Protected directories can be configured only for Linux.
Setting a Protected Directory
- Log in to the management console.
- In the upper left corner of the page, select a region, click
, and choose . Figure 1 Accessing HSS
- Choose Web Tamper Protection > Server Protection, click Configure Protection. The Protected Directory Settings tab is displayed. Figure 2 Web Tamper Protection page
- If your server runs the Linux OS, set Type to Directory, as shown in Figure 3.
- You can add a maximum of 50 protected directories.
- Click Add. In the Add Protected Directory dialog box, set required parameters. For details, see Table 1. Figure 4 Adding a protected directory
Table 1 Parameters for a protected directory Parameter
Description
Restriction
Protected Directory
Files and folders in this directory are read-only.
Do not set it to any OS directories.
Excluded Subdirectories
Subdirectories that do not need to be protected in the protected directory, such as temporary file directories.
Separate subdirectories with semicolons (;).
The subdirectory is a relative directory in the protected directory.
Excluded File Types
Types of files that do not need to be protected in the protected directory, such as log files.
Separate file types with semicolons (;).
To record the running status of the server in real time, exclude the log files in the protected directory. You can grant high read and write permissions for log files to prevent attackers from viewing or tampering with the log files.
-
Local Backup Path
After WTP is enabled, files in the protected directory are automatically backed up to the local backup path.
Generally, the backup completes within 10 minutes. The actual duration depends on the size of files in the protected directory. Protection takes effect immediately when the backup completes.
Excluded subdirectories and types of files are not backed up.
If WTP detects that a file in a protected directory is tampered with, it immediately uses the backup file on the local server to restore the file.
The local backup path cannot overlap with the added protected directory.
- Click OK.
If you need to modify files in the protected directory, stop protection for the protected directory first. After the files are modified, resume protection for the directory in a timely manner.
- Click Add. In the Add Protected Directory dialog box, set required parameters. For details, see Table 1.
- Enable remote backup.
By default, HSS backs up the files from the protected directories (excluding specified subdirectories and file types) to the local backup directory you specified when adding protected directories. To protect the local backup files from tampering, you must enable the remote backup function.
For details about how to add a remote backup server, see Adding a Remote Backup Server.
- Click Enable Remote Backup. Figure 5 Enabling remote backup
- Select a backup server from the drop-down list box. Figure 6 Setting remote backup
- Click OK.
- Click Enable Remote Backup.
Follow-Up Procedure
- Suspend protection: You can suspend WTP for a directory if needed. It is best practice that you resume WTP in a timely manner to prevent the files in the directory from being tampered with.
- Edit a protected directory: You can modify the added protected directory as needed.
- Delete a protected directory: You can delete the directories that do not need to be protected.
- After you suspend protection for a protected directory, delete it, or modify its path, files in the directory will no longer be protected. Before performing these operations, ensure you have taken other measures to protect the files.
- After you suspend protection for a protected directory, delete it, or modify its path, if you find your files missing in the directory, search for them in the local or remote backup path.
Last Article: WTP
Next Article: Adding a Remote Backup Server

Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.