Score:0

How enable modsecurity only one site? in edit .htaccess?

gb flag

nano /etc/apache2/mods-enabled/security2.conf

<IfModule security2_module>
        SecDataDir /var/cache/modsecurity
        IncludeOptional /etc/modsecurity/*.conf
        IncludeOptional /usr/share/modsecurity-crs/*.load
</IfModule>

i try in .htaccess

<IfModule mod_security2.c>
    SecRuleEngine On
</IfModule>

Error: .htaccess: SecRuleEngine not allowed here

i have hestia cp and i cant edit <VirtualHost file: # DO NOT MODIFY THIS FILE! CHANGES WILL BE LOST WHEN REBUILDING DOMAINS

Score:0
in flag

You can enable ModSecurity on a per site basis with the SecRuleEngine directive in a VirtualHost definition of that site.

<VirtualHost *:80>
        ServerName example.com
        ServerAlias www.example.com 
        DocumentRoot /var/www/html
        ...
        SecRuleEngine On
        ...
</VirtualHost>

Regarding your edit that you're using a control panel:

Questions involving web hosting control panels are off-topic

because they customize their systems so that standard system administration methods no longer apply. Some related topics may be asked on Webmasters or see Where can I ask questions about web hosting control panels?

My guess is that setting custom non-standard settings in a Apache VirtualHost in Hestia requires creating a custom apache2 template with the correct settings and directives and then in the advanced options select that template instead of the default one.

dr.ipkins avatar
gb flag
i have hestia cp and i cant edit <VirtualHost file: # DO NOT MODIFY THIS FILE! CHANGES WILL BE LOST WHEN REBUILDING DOMAINS. Lost changes
HBruijn avatar
in flag
Repeating my last paragraph for your benefit: *"My guess is that setting custom non-standard settings in a Apache VirtualHost in Hestia requires creating a custom apache2 template with the correct settings and directives and then in the advanced options select that template instead of the default one."*
dr.ipkins avatar
gb flag
tanks is right way i think, but i copy default files to new names (/usr/local/hestia/data/templates/web/apache2) to new teample and not see him in list in control panel. Why?
dr.ipkins avatar
gb flag
tanks i copy defaylt files in /usr/local/hestia/data/templates/web/apache2/php-fpm and see it in list
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.