KHA

Member
Aug 25, 2016
7
1
3
Dubai
cPanel Access Level
Root Administrator
Hello,

I need to update my Server httpd.conf file. so i did follwoings

I run this command to find the httpd.conf file location
httpd -V

Now i have location as HTTPD_ROOT="/etc/apache2" so i got this directory as bellow command
cd /etc/apache2/conf

and i edit the file
nano httpd.conf

I change value of DocumentRoot /var/www/html to my domain directory under <VirtualHost *.*:80> as bellow
<VirtualHost *.*.*.*:80>
ServerName *.*.*.*
DocumentRoot /home/myapp/public_html
ServerAdmin [email protected]
<IfModule suphp_module>
suPHP_UserGroup nobody nobody
</IfModule>
</VirtualHost>

now after saving file, i check my server and ever thing works as i need.

now i run this command to keep the settings save in update or rebuild.

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

now after this command i build the httpd.conf again with bellow command
/scripts/rebuildhttpdconf

and after rebuild i check that my settings are gone.
how to make changes and keep them save even after rebuild.

Thanks
 

KHA

Member
Aug 25, 2016
7
1
3
Dubai
cPanel Access Level
Root Administrator
Hello @cPanelMichael,
in this link you ask for make configuration for mysite.com, but i want to change
<VirtualHost *.*.*.*:80>

how could i do it ?
i could not follow as this is not any site, its server shared IP.

Thanks
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,908
2,216
463
<VirtualHost *.*.*.*:80>
Hello,

Do you want to make the change for VirtualHosts with all shared IP addresses on the system? If so, this thread should help:

Apache log format issue with EasyApache 4

Here's the relevant section to edit:

Code:
##################################################
##################################################
#
# Define default vhosts for shared IPs
#
##################################################
##################################################

[% FOREACH vh IN sharedips -%]
<VirtualHost [% vh %]>
    ServerName [% parsed_ip(vh) %]
    DocumentRoot [% paths.dir_docroot %]
    ServerAdmin [% serveradmin %]

    <IfModule suphp_module>
        suPHP_UserGroup nobody nobody
    </IfModule>

[%-     IF supported.mod_userdir && userdirprotect_enabled && defaultvhost.userdirprotect != '-1' %]
    UserDir disabled
[%-         IF defaultvhost.userdirprotect != '' && !supported.mpm_itk && !supported.mod_ruid2 %]
    UserDir enabled [% defaultvhost.userdirprotect %]
[%-         END -%]
[%-     END %]
</VirtualHost>

[% END -%]
Thank you.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,908
2,216
463
I'm happy to see that information helped. Thank you for updating us with the outcome.