Skip to main content

CWP: How to Enable GUI for CSF on CentOS 7

CSF Web UI required some of Perl modules to be installed on your system. Use the following commands to check the required modules are installed operating system. If not present please install those packages .
# yum info perl-IO-Socket-SSL.noarch perl-Net-SSLeay perl-Net-LibIDN perl-IO-Socket-INET6 perl-Socket6 
To enable CSF web UI edit /etc/csf/csf.conf file
# vi /etc/csf/csf.conf

# 0 = Unrestricted UI
# 1 = Restricted UI
# 2 = Disabled UI

# 1 to enable, 0 to disable
UI = "1"

# Do NOT enable access to this port in TCP_IN, instead only allow trusted IP's
# to the port using Advanced Allow Filters (see readme.txt)
UI_PORT = "1025"

# Leave blank to bind to all IP addresses on the server
UI_IP = ""

# This should be a secure, hard to guess username
# This must be changed from the default
UI_USER = "admin"

# This must be changed from the default
UI_PASS = "adminX"
edit /etc/csf/ui/ui.allow configuration file and add your public IP to allow access to CSF UI.
# echo "YOUR_PUBLIC_IP_ADDRESS" >>  /etc/csf/ui/ui.allow 
# systemctl restart lfd.service 

How to use LetsEncrypt Free SSL certificate for CSF UI ?
# cd /etc/csf/ui
# mv server.key server.key.old
# mv server.crt server.crt.old
# ln -s /etc/letsencrypt/live/DOMAIN/fullchain.pem server.crt
# ln -s /etc/letsencrypt/live/DOMAIN/privkey.pem server.key

[root@cloud ui]# ln -s /etc/pki/tls/private/hostname.key server.key
[root@cloud ui]# ln -s /etc/pki/tls/certs/hostname.bundle server.crt

Now, access CSF UI on your browser with the specified port.