Introduction
Shared hosting is a cost-effective way to host websites, making it a popular choice for individuals and small businesses. However, sharing server resources with multiple users increases the risk of vulnerabilities and potential breaches. Proper security measures are essential to protect your website, data and users. This guide outlines how to leverage cPanel's built-in security features and follow best practices to enhance website security effectively.
Using cPanel Security Features
1. IP Blocking
Purpose: Prevent unauthorised access and block malicious traffic.
Steps to Block an IP Address:
-
Log in to cPanel.
-
Navigate to the Security section and click on IP Blocker.
-
Enter the IP address or range you wish to block (e.g.,
192.168.1.1
or192.168.0.1-192.168.0.255
). -
Click Add to apply the block.
When to Use:
-
After detecting repeated unauthorised login attempts.
-
To block known malicious IPs or regions.
-
As a temporary measure during an ongoing attack.
Example:
A visitor attempts to brute force your login page. By checking the access logs in cPanel, you identify their IP address and block it using the IP Blocker.
2. SSL Management
Purpose: Encrypt data transmitted between your website and visitors, ensuring secure communication.
Steps to Enable SSL:
-
Log in to cPanel.
-
Navigate to the Security section and click on SSL/TLS.
-
Use the AutoSSL feature to automatically install a free SSL certificate for your domain.
-
After installation, redirect your website to HTTPS:
-
Go to Domains in cPanel.
-
Enable the Force HTTPS Redirect toggle for your domain.
-
Benefits:
-
Protects sensitive user data, such as passwords and payment details.
-
Boosts search engine rankings (Google prioritises HTTPS).
Example:
You run an online store. Enabling SSL ensures your customers' payment details are encrypted and secure.
3. Directory Privacy
Purpose: Restrict access to sensitive directories by requiring a password.
Steps to Password-Protect a Directory:
-
Log in to cPanel.
-
Navigate to the Files section and click on Directory Privacy.
-
Select the directory you wish to protect.
-
Enable Password Protect this Directory and provide a name for the protected area.
-
Create a username and password for access.
-
Save the settings.
Use Cases:
-
Protecting admin areas or development files.
-
Securing confidential documents or backup directories.
Example:
You’re working on a new website feature. By password-protecting the development folder, only authorised team members can access it.