csf Not Installable After Initial DA Install

davidc

Verified User
Joined
Jun 19, 2020
Messages
73
I need help!

Here's the situation. Moving from another VPS with Centos 7.

Today, I started to configure an unmanaged VPS w/ Debian 11. First order was to install DA. I followed the following steps:

1. ssh into the server
2. created options.conf and php_extensions.conf in /usr/local/directadmin/custombuild with copies from the old server.
3. Install DA using the command:
Bash:
bash <(curl -Ss https://www.directadmin.com/setup.sh || wget -O - https://www.directadmin.com/setup.sh) 'auto'
4. logged into the web interface, and then into CustomBuild
5. noticed that csf was OFF in Options (GUI) and turned it ON.
6. switched to Build, (which had no version for CSF) and pressed build next to CSF
7. build failed with error:

csf GUI install attempt .png
8. in the console, tried again with
Bash:
# ./build csf
which returned:

csf ssh install attempt.png
showing some evidence that /etc/csf does not exist - neither does /usr/local/csf.

The hosting company support is balking, because it's unmanaged. I'm unsure about support from DirectAdmin, because it's a Personal license.

Side note: This isn't the only thing causing problems.
Running:
/etc/csf/csftest.pl resulted in:
Bash:
# perl /etc/csf/csftest.pl
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
    LANGUAGE = (unset),
    LC_ALL = (unset),
    LANG = "en_US.UTF-8"

    are supported and installed on your system.

perl: warning: Falling back to the standard locale ("C").
Can't open perl script "/etc/csf/csftest.pl": No such file or directory

I got the locale problem fixed, but that still leaves: Can't open perl script "/etc/csf/csftest.pl": No such file or directory

What is the solution?
 
There are a couple of ways you can do it.

1.) Download your own csf copy from configsterver, extract the tarball and copy the csftest.pl to /etc/csf if you're 100% sure that is the only thing missing.

2.) Backup your currenct CSF directory. Then install CSF manually yourself, which can be done easy and quick by using the ./install_directadmin.sh command when following the installation instructions.
After that copy back your current CSF directory. And then you will have a full working copy with all files in the correct place, not only /etc/csf but also in /var/lib/csf where also a part should be installed.
I personally would suggest to do it this way.

3.) Use the da build all command which will rebuild everything. But that will take a long time and probably you need to use the "force" command to do it. Not sure about that and I can't find it that quickly.
 
My hosting company (graciously & supposedly) fixed csf with the following explanation:
As a one time courtesy, I took a look at your server. This issue was entirely on the path defined in the csf config file related to where it has iptable path set in it.

root@nvme:/usr/src/csf# which iptables
/usr/sbin/iptables

I still don't have confidence that csf was installed correctly.

For example:

1. CSF - Test iptables
Testing ip_tables/iptable_filter...open3: exec of /sbin/iptables -I OUTPUT -p tcp --dport 9999 -j ACCEPT failed: No such file or directory at /usr/local/csf/bin/csftest.pl line 144.

After a long search, I found the solution!

RESTRICT_SYSLOG was set to 0. When I set it to 2 and restarted, the above issue is gone and CSF reports no errors.
 
Re-installed Debian 11 and DA, without CSF - successfully

Then followed the instructions for manual CSF install (modified of #2 in post #2 above)

Code:
cd /usr/local/src
wget https://download.configserver.com/csf.tgz
tar xfz csf.tgz
cd csf
./install.directadmin.sh
cat /etc/csf/csf.conf

In the DA GUI > ConfigServer > Test iptables:
Code:
Testing ip_tables/iptable_filter...open3: exec of /sbin/iptables -I OUTPUT -p tcp --dport 9999 -j ACCEPT failed: No such file or directory at /usr/local/csf/bin/csftest.pl line 144.

@Richard G You may recall the conversation from earlier today in another thread

Do you think this failure has to do with the iptables location which is symlinked from /usr/sbin/iptables -> /etc/alternatives/iptables ?
 
Do you think this failure has to do with the iptables location which is symlinked from /usr/sbin/iptables -> /etc/alternatives/iptables ?
Might very well be the case.
Seems the DA test script is assuming that the csftest.pl is in /usr/local/csf/bin and iptables is in /sbin.

Does the "check server security" in Configserver also throw errors?
 
I forgot how fresh install Debian 11 from cd-iso look like, I don't have test server. so don't know if it symlink "/sbin" or not. but Rhel 7,8,9 have this symlink normally.
 
RHEL has the symlink from /sbin like this:
lrwxrwxrwx. 1 root root 26 2023-09-10 06:18 iptables -> /etc/alternatives/iptables
maybe not 7, but Alma 8 and 9 do.
 
Back
Top