Cpanel virtualhost Function
Cpanel will always create apache configration and virtual host by its own template and every domian creation or susspenssion or termination or any thing else related to virtualhost configration of apache if being done will resultin cpanel to recreate apache virtualhost configration that will overwrite other custom modified settings.
Solution to have custom virtualhost configration
so that the cpanel will recreat virtualhost from its template how to have custom virtualhost of some domains configrations?
there is an answer to that question that is to have modified configration on elsewhere and then include it in to that virtual host but there maybe a question came to your mind that as the Cpanel will recreate the virtualhost from its template so that the include will also become overwritten.
Cpanel builtin scripts for including customized virtualhost configration
for this problem cpanle has created a ready made script that will verify your configration that should be inclueded that is
the step by step to how to do so is in the following
creating custom virtualhost configration step by step
1- create the commented include section directory such as this# Include “/usr/local/apache/conf/userdata/std/2/woshka/woshka.com/*.conf”
to create run
2-go to that directory
3-creat a config file than should be end by .conf
4-put your custom config in that config file config.conf
5-run this
or with jsut that user
/scripts/ensure_vhost_includes username
you are now finished
for confirmation that everything is fine go to that virtualhost and verify that the included section is uncommented with that custom config name
hope you enjoyed this training
have fun
voshka
Related posts:
- how to optimize apache?
- How to have both fantastico running and shell_exec disabled on cpanel?
- how to rebuild httpd.conf in cpanel?
- creating backup of accounts in cpanel
- The way to prevent ddos attacks
- backup and restore Cpanel accounts with command line usnig ssh
- How to secure tmp the easy way if you have WHM/Cpanel