November 23, 2020

How to keep cPanel httpd.conf settings from being reset or removed

Sponsored
apache.conf .httpd

Have you made a change to the
/usr/local/apache/conf/httpd.conf
file and it’s not sticking? This is because you are not supposed to edit that file directly on a cPanel server! Many linux guru’s have made this mistake just because they are not used to cPanel!

When you need to edit the httpd.conf file or settings for a specific cPanel user you should do so from the/var/cpanel/userdata/USERNAME folder.

After you update any of those files you need to tell cPanel to rebuild the apache configuration file, the easiest way to do that is to run this command:

/scripts/rebuildhttpdconf

If you want to be able to edit the /usr/local/apache/conf/httpd.conf file directly, you need to run the command below which will run the cPanel Apache Distiller. This will prevent cPanel and Apache from removing any changes you made whenever Apache gets recompiled.

/usr/local/cpanel/bin/apache_conf_distiller --update

advertisement:
smyles 56 37
sMyl.es

 
Source: sMyles
Sponsored