My manual changes was not conserver in httpd.conf
I had an instruction to add some ifmodule directive into httpd.conf .
But appears this change was not reflected after i did:
/usr/local/cpanel/bin/apache_conf_distiller --update
and then
/usr/local/cpanel/bin/build_apache_conf
Please how the easiest way i can modiffy this httpd.conf from A) command line, B) WHM and keep changes 4ever?
This is httpd.conf header:
[QUOTE]# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# Direct modifications to the Apache configuration file may be lost upon subsequent regeneration of the #
# configuration file. To have modifications retained, all modifications must be checked into the #
# configuration system by running: #
# /usr/local/cpanel/bin/apache_conf_distiller --update #
# To see if your changes will be conserved, regenerate the Apache configuration file by running: #
# /usr/local/cpanel/bin/build_apache_conf #
# and check the configuration file for your alterations. If your changes have been ignored, then they will #
# need to be added directly to their respective template files. #
# #
# It is also possible to add custom directives to the various "Include" files loaded by this httpd.conf #
# For detailed instructions on using Include files and the apache_conf_distiller with the new configuration #
# system refer to the documentation at: [url=http://www.cpanel.net/support/docs/ea/ea3/customdirectives.html]EasyApache #
# #
# This configuration file was built from the following templates: #
# /var/cpanel/templates/apache2/main.default #
# /var/cpanel/templates/apache2/main.local #
# /var/cpanel/templates/apache2/vhost.default #
# /var/cpanel/templates/apache2/vhost.local #
# /var/cpanel/templates/apache2/ssl_vhost.default #
# /var/cpanel/templates/apache2/ssl_vhost.local #
# #
# Templates with the '.local' extension will be preferred over templates with the '.default' extension. #
# The only template updated by the apache_conf_distiller is main.default. #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
-
Do your manual changes need to go inside a VirtualHost container, or outside a VirtualHost container? That is the first thing you need to establish, and that is why I asked that question in my previous reply. If you are not sure if the changes need to be inside or outside a VirtualHost container, you should ask the developer of the software you are trying to install. Once you know whether they should go inside or outside a VirtualHost container, the documentation explains how to make custom changes for each scenario. 0 -
Developer i think dont mention if virtual host or not virtual host. But i found: Q. [QUOTE]But if I do it in cPanel/WHM do I need to insert it in the "Pre VirtualHost Include" in Apache Configuration?
A. That is really a matter of choice. I myself inserted it on a lot of servers just before the section in the main httpd.conf file at /usr/local/apache/bin and ran the update script Another quotation: [QUOTE]The module directives should be written only inside httpd.conf file (per VirtualHost configuration is also supported).
does it make more sense where to add it? I want to use this module for all cpanel accounts. So in which file and where to add it please?0 -
If the entries will apply to all virtual hosts, then the following part of the documentation would be applicable: Custom templates that will apply to all virtual hosts Thank you. 0 -
so on "Home "Server Status "Apache Status" i see "Server Version: Apache/2.2.27 (Unix)". [QUOTE]ls -l /var/cpanel/templates total 24 drwxr-xr-x 6 root root 4096 Apr 20 11:23 ./ drwxr-xr-x 83 root root 4096 Apr 23 12:39 ../ drwxr-xr-x 2 root root 4096 Apr 20 11:23 apache1/ lrwxrwxrwx 1 root root 29 Apr 20 11:23 apache1_3 -> /var/cpanel/templates/apache1/ drwxr-xr-x 2 root root 4096 Apr 23 05:39 apache2/ lrwxrwxrwx 1 root root 29 Apr 20 11:23 apache2_0 -> /var/cpanel/templates/apache2/ lrwxrwxrwx 1 root root 29 Apr 20 11:23 apache2_2 -> /var/cpanel/templates/apache2/ drwxr-xr-x 2 root root 4096 Apr 20 11:23 apache2_4/ drwxr-xr-x 2 root root 4096 Apr 20 10:51 dovecot2.2/
so i assume i need to edit in apache2 directory ONLY?.. [QUOTE]ls -l /var/cpanel/templates/apache2 total 64 drwxr-xr-x 2 root root 4096 Apr 23 05:39 ./ drwxr-xr-x 6 root root 4096 Apr 20 11:23 ../ -rw-r--r-- 1 root root 23684 Apr 23 05:39 main.default -rw-r--r-- 1 root root 7576 Apr 23 05:39 ssl_vhost.default -rw-r--r-- 1 root root 7576 Apr 20 17:36 ssl_vhost.local -rw-r--r-- 1 root root 6940 Apr 23 05:39 vhost.default -rw-r--r-- 1 root root 6940 Apr 20 17:36 vhost.local
but vhost.local and ssl:vhost.local is already existing and it contains alot of data. Im unsure where exactly i need to add my rule mentioned in third post of this topic? [QUOTE]head vhost.local ServerName [% wildcard_safe(vhost.servername) %] [% IF vhost.serveralias_array.size -%] [% FOREACH alias IN vhost.serveralias_array -%] ServerAlias [% alias %] [% END -%] [% ELSE -%] ServerAlias [% vhost.serveralias %] [% END -%]
hope you can advice, help0 -
You can use an include file. EX: vi /usr/local/apache/conf/userdata/mod_evasive.conf
Add the custom entry you referenced earlier to this file. Save the file, then run:/scripts/verify_vhost_includes
Then, assuming it does not fail, rebuild the Apache configuration file via:/scripts/rebuildhttpdconf
This adds the entry to all Virtual Hosts, regardless of Apache version. Thank you.0
Please sign in to leave a comment.
Comments
7 comments