Prevent vhost.default Overwrite?
Greetings,
My server provides a common cgi-bin directory structure, allowing multiple sites to run the same scripts. In the /var/cpanel/templates/apache2_4/vhost.default file, I modified the ScriptAlias template, to use a common ScriptAlias in the HTTPD.CONF file. I changed the "[% vhost.documentroot %]" portion below to the physical path I want to use:
[% IF vhost.hascgi && scriptalias == 1 -%]
ScriptAlias /cgi-bin/ [% vhost.documentroot %]/cgi-bin/
[% END -%]
This typically works fine in the event of automated updates, however the latest update apparently overwrote the vhost.default file, causing my sites to lose access to the common cgi-bin.
Is there a way to either prevent the vhost.default from being over-written, or perhaps have an alternative for defining the ScriptAlias template?
Thank you,
Michael Reynolds
-
Hello, Could you verify if this system uses EasyApache 4, or EasyApache 3? Thank you. 0 -
Hello, Could you verify if this system uses EasyApache 4, or EasyApache 3? Thank you.
WHM indicates that EasyApache 4 is installed, according to the sub-menu title under Software. I also have this: Apache 2.4, PHP 5.6, and PHP 7.0 Michael0 -
Hello, You can follow the instructions on the following thread: Apache log format issue with EasyApache 4 Remember to use "vhost.default" and "vhost.local" for your particular scenario. Thank you. 0 -
Thank you. I created the vhost.local file with the customized ScriptAlias template, and returned vhost.default to its original state. After running /scripts/rebuildhttpdconf, httpd.conf shows the proper values, and sites work as expected. Which file should be used for storing the customized ScriptAlias template? vhost.local? Should vhost.default be left alone, because it might be over-written? Michael 0 -
Hello, Yes, vhost.default should be left alone and modifications to this file should always occur in the vhost.local file instead. Thanks. 0 -
Great! Thank you for the clarification, and for your assistance. Michael 0 -
I have one additional question. In the vhost.local file, does the file need to contain the entire template from vhost.default, or can it contain only those portions that are being customized? Michael 0 -
Hello, You should start by copying the vhost.default file first, and then making adjustments to it accordingly. Thank you. 0
Please sign in to leave a comment.
Comments
8 comments