All about CSF (ConfigServer Security & Firewall)

csf

To add IP address in to deny list

csf -d IP

To add IP address in to allow list

csf -a IP

How to restart csf firewall

csf -r

How to stop csf firewall

csf -x

Path of CSF configuration file on cPanel server

/etc/csf/csf.conf

Path of denied IP addresses file in CSF

/etc/csf/csf.deny

Path of allowed IP address file in CSF

/etc/csf/csf.allow

How to add IP address in to ignorelist

(1) login to shell

(2) add IP address in to /etc/csf/csf.ignore

How to find IP address blocked in temporary ban

grep IP /etc/csf/csf.tempban

 

cPanel: Group ownership become ID?

Today I found that one account having weird error.

Error:
1) The group ownership became an ID and the site is unable to load as in valid group.
2) Where try chown the folder, it will return “invalid user” error

Solution:

1) check if the group ownership is correct, it wrong as below, please continue step (2)

2) open /etc/group and add in USER:x:GROUP:

For the screen shot case, add it as ipless:x:512:

3) /etc/gshadow and add in USER:!::

For the screen shot case, add it as ipless:!::

Done and the group permission will correct automatically.

ClamAV commands

There is some command to trigger ClamAV in Linux server which is more easy to use back-end.

To scan all the file in the path

clamscan -r path

To scan all directories and sub directories recursive

clamav -ril /home/user/clamav.log

To scan all the server and provide report

clamscan -ir / -l cscanreport

Ruby: Unable to Create Ruby on Rails Application at cPanel

When you receive the error as below when try to create Ruby on Rails application on cPanel. It mean that your rails/ruby version installed is not supported by cPanel.

Your app is NOT installed because there was a problem. Try again or contact
our support team.

So the solution will be remove the current Ruby and Rails and install it by cPanel build in script. Moving the unsupported Ruby and Rails environment and then reinstalling using the proper cPanel script should setup the machine with the right Rails version and mongrel.

(1) Remove the unsupported Ruby and Rails

mv /usr/bin/ruby /usr/bin/ruby.bak
mv /usr/lib/ruby /usr/lib/ruby.bak
mv /usr/bin/gem /usr/bin/gem.bak
mv /usr/bin/rails /usr/bin/rails.bak

(2) Install again by cPanel script

/scripts/installruby --force