[How-to] CSF Support in Hestia CP

Until to dot 6 the panel hestiacp worked. after the proceed the last dot, hestiaco stopped to work with error 500 (before to edit the panel.html file) (nothing log errors)
now I cannot check it…I stopped the CSF installation and I installed iptables -fail2ban script.

Thanks. I will check it out during the weekend when I’m more free.

Hestia & CSF integration is working flawlessly for me though.

Hi guys,

I’ve just tested installing CSF in Hestia CP in my temp virtual and found no issue when following the provided step-by-step how-to guide.

Tested both on Ubuntu (temp) & Debian (prod).

Well, nothing I can not install on Debian 10 in a clean installation.

1

With out any changes you have made or even the effort to look something up. Support isn’t availble…

What I did is what appears in this manual not something else, I thought that if I did not say it, it was understood that I had done it.

as usual: first thing should be looking into the logfiles. an error 500 from the webserver can be found there and most likely holds additional information.

maybe you blocked your upstream or whatever. depends on your setup. nat-ip by any chance?

as @eris said, CSF is not officially supported, so use at your own risk :wink:

@MaKiSpAiN - Do you get the error after altering the “panel.html” file?

Which change did you apply?

  1. <div class="l-menu__item <?php if($TAB == 'CSF' ) echo 'l-menu__item--active' ?>"><a href="/list/csf/"><?=_('CSF')?></a></div>
  2. <div class="l-menu__item <?php if($TAB == 'CSF' ) echo 'l-menu__item--active' ?>"><a href="/list/csf/"><?=__('CSF')?></a></div>

My /usr/local/hestia/web/templates/admin/panel.html looks like below. Not quite exactly as the instructions in this post that says that I should add the l-menu__item tag directly below <div class="l-menu clearfix noselect">
=> <div class="l-menu__item <?php if($TAB == 'SERVER' ). Because my row <div class=“l-menu__item <?php if($TAB == ‘SERVER’ ) is inside the l-profile noselect” element.

The CSF link only works when I put in the l-profile noselected element. And put in the element there, and replace the existing old CSF element.

Later I disable test mode, and fix and restrict_syslog warnings. All fine. But then it says its stopped so I choose start csf+ldf and then server hangs completely.

The screen dump above is done before installing csf (after a restore), so the existing csf element is not there. I assume it’s installed after the csf install.sh. And then when I later edit this file there is already an old version formatted csf element there. I have to replace that one, with 1. <div class="l-menu__item <?php if($TAB == 'CSF' ) echo 'l-menu__item--active' ?>"><a href="/list/csf/"><?=__('CSF')?></a></div>. Then the menu works (se picture below).

Then i fix the test warning and syslog warning, and restart the service. Then all hangs.

Error 500 shows it to me when I try to enter the panel wherever it is, not when I try to enter the CSF, which also shows it to me.

I do not know if I explain myself correctly.

Change in /usr/local/hestia/web/list/user/index.php line 2
error_reporting(NULL); to #error_reporting(NULL);

Then visit the page /list/users/

And then check /var/log/hestia/nginx-error.log

Basic debug work

4 Likes

I don’t know how I can help here further…

It just works for me when following the given tutorial on both Debian & Ubuntu.

1 Like

Hi,

I can see that “CSF” menu item is in the left part, near statistics on your HestiaCP. On my HestiaCp and with your instructions on changing the /usr/local/hestia/web/templates/admin/panel.html, my CSF menu item is turning up on the right side menu part, near the cogg-wheel. So our panel.html is not the same, I assume!? Maybe we have different versions of HestiaCP? I have version v1.3.5 running on Ubuntu 20.04.2 LTS.

As I’ve pointed out earlier in this thread, your instructions on chaning the panel.html does not quite add up with my version of panel.html ([How-to] CSF Support in Hestia CP - #90 by clyde).

If I add CSF to the same left hand menu item group as you have, i get a html page not found error later. But when I place it in the right hand side menu item group beside the cogg-wheel, it works and loads, but a bit later everything freezes.

Hi clyde.

Thanks for the input. I understand you completely…

The tutorial provided is as-is. I just posted here what worked for me and seems it’s still working even on new machines with fresh install of Hestia CP - at least for me…

Simple to understand and fix that error 500

Even if you are not edited the file /usr/local/hestia/web/templates/admin/panel.html

When you run sh install.hestia.sh, this script insert a code in the file panel.html line 35 with “wrong” code, you should delete that line and insert the line like in exemple:

<div class="l-menu__item <?php if($TAB == 'CSF' ) echo 'l-menu__item--active' ?>"><a href="/list/csf/"><?=_('CSF')?></a></div>

No one never think a HTML file can cause error 500.

I lost a lot of time trying to solve this, but now got fixed!

It is executed as php and due to the fact it is exectuted via php-fpm it will trow an 500 error

Good morning.

Today I have upgraded hestia to 1.4.3 from 1.3.5. CSF, of course, disappears, then I re-install it, but this time CSF still disappears. Maybe this time the script needs an upgrade? The first thing that I’m doubting is that the directory /usr/local/hestia/web/templates/admin/, it does not exists

Thanks a lot.

We renamed all the templates… And so on…

1 Like

Hi,

the location of the panel.html file in 1.4.3 is:
/usr/local/hestia/web/templates/includes/panel.html

adding the same code in the correct place (after line 29 as the code is atm) does the trick:
<div class="l-menu__item <?php if($TAB == 'CSF' ) echo 'l-menu__item--active' ?>"><a href="/list/csf/"><?=_('CSF')?></a></div>
If you place it like that the CSF link will show right next to the Statistics link.

I tried the latest 1.4.3 on debian 10.10.0 and following the steps in the original post resulted in a login loop and I had to reinstall the OS. I assume the problem arises because the when in step 6 the install.sh script runs, all it does is to check if a supported panel is installed and then it runs the appropriate csf install..sh script. Since hestiacp is not supported by csf it ends up running the generic installation script. The in step 7 run the find/sed/rename commands that replace all variants of the word vesta to the relevant variant of the word hestia and renames the install.vesta.sh file to install.hestia.sh, then in step 8 we run that file which in fact re-installs csf on top of the existing generic installation.

I believe the correct way is to run the snippet as step 6, then run install.sh as step 7 (the script now will run install.hestia.sh instead of the generic one) and then edit the panel.html as step 8. I also did a ‘systemctl restart hestia’, not sure how required this is.

I hope this helps newcomers like myself who are on 1.4.3 and want to use the excellent CSF/LFD firewall.