Wird geladen...
install CSF on a cPanel server
Drucken
  • csf, cpanel/whm, cpanel, CloudFlare
  • 0
To install CSF on a cPanel server, SSH into your server as root, download the latest CSF package from GitHub, extract it, and run the install.cpanel.sh script located in the extracted directory. Since the official CSF website shut down in August 2025, you must download the package from GitHub and then configure the firewall through the WHM interface to enable it and disable testing mode. 
 
1. Prepare Your Server
  • Log in via SSH: Access your server using the root user. 
     
  • Remove conflicting firewalls: If you have other firewalls like APF installed, remove them first by running sh /etc/csf/remove_apf_bfd.sh. 
     
 
2. Download and Install CSF 
 
  • Navigate to the source directory: Use the cd command to go to /usr/src, a common location for installing software.
  • Download the latest package: Get the latest version of CSF from GitHub:
Código
 
    wget https://raw.githubusercontent.com/waytotheweb/scripts/refs/heads/main/csf.tgz
Extract the package.
Código
 
    tar -xzf csf.tgz
Change to the CSF directory.
Código
 
    cd csf
  • Run the cPanel install script: This script handles the installation for cPanel/WHM environments. 
     
Código
 
    <<!nav>>./install.cpanel.sh<<!/nav>>
3. Configure and Enable CSF
  • Access WHM: Log in to your WebHost Manager (WHM). 
     
  • Find the CSF plugin: Navigate to the "ConfigServer Security & Firewall" option in the WHM interface. 
     
  • Configure ports: Use the "Firewall Configuration" button in the WHM interface to open necessary ports. 
     
  • Disable testing mode: In the main CSF interface, you will need to turn off the "Test Mode" to fully activate the firewall. 
     
  • Restart the firewall: After making configuration changes, restart CSF to apply them. 
     
4. Verify Installation
  • Check CSF status: You can verify the installation and status through the WHM interface. 
     
  • Check for errors: Be aware of potential errors, especially concerning the Firewall LKM (Loadable Kernel Module), which may require enabling a monolithic kernel in /etc/csf/csf.conf. 

War diese Antwort hilfreich?

Mehr zum Thema