reset apache config when restore backup and reboot server

Muhammad++

Member
Sep 18, 2017
11
1
1
GE
cPanel Access Level
Root Administrator
Hello ,
When reboot or restore new back up on server config apache restore on default
I change /etc/apache2/conf/httpd.conf AllowOverride None on AllowOverride All But when restore new backup and reboot server , config reset when i see httpd.conf i see AllowOverride All changed AllowOverride None so need again set it to all .
How can fix this problem ?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
Hello,

Can you provide more information about the steps you took to manually restore the system configuration files?

Thank you.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463

Muhammad++

Member
Sep 18, 2017
11
1
1
GE
cPanel Access Level
Root Administrator
Hello,

Manual changes to the httpd.conf file are not preserved. Thus, if you reboot or create/restore an account, you will lose any direct modifications to that file. Please see this document for information on how to customize Apache:

Advanced Apache Configuration - EasyApache 4 - cPanel Documentation

Thank you.
Thanks ,
I can not fiend how can change AllowOverride None to AllowOverride All from Apache Configuration , Which option on Global Configuration is before AllowOverride
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
Hello,

It's controlled with the following option in "WHM Home » Service Configuration » Apache Configuration » Global Configuration":

Optimize .htaccess (AllowOverride)

Thank you.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
Hello,

I recommend using "Search Home Directory and below". With this option, the .htaccess files in your account's subdirectories are recursively searched in the /home/$username/ directory. EX:

/home/$username/.htaccess > works
/home/$username/public_html/.htaccess > works
/home/$username/public_html/123/.htaccess > works
/home/$username/public_html/123/456/.htaccess > works


Otherwise, you'd use "Search "/' and below" if you want Apache to search for all .htaccess files.

Thank you.
 

Muhammad++

Member
Sep 18, 2017
11
1
1
GE
cPanel Access Level
Root Administrator
Hello,

I recommend using "Search Home Directory and below". With this option, the .htaccess files in your account's subdirectories are recursively searched in the /home/$username/ directory. EX:

/home/$username/.htaccess > works
/home/$username/public_html/.htaccess > works
/home/$username/public_html/123/.htaccess > works
/home/$username/public_html/123/456/.htaccess > works


Otherwise, you'd use "Search "/' and below" if you want Apache to search for all .htaccess files.

Thank you.
Hello ,
I set this option's and test but reset or when restore user backup AllowOverride set all for all time
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
I set this option's and test but reset or when restore user backup AllowOverride set all for all time
Feel free to open a support ticket using the link in my signature if you'd like us to take a closer look.

Thank you.