Skip to main content

My manual changes was not conserver in httpd.conf

Comments

7 comments

  • JaredR.
    Were your custom changes inside a VirtualHost container, or outside? If the changes were inside a VirtualHost container, the distiller will not preserve them. The following documentation explains how to make changes that should go inside a VirtualHost container so that they will be preserved:
    0
  • postcd
    [quote="cPanelJared, post: 1625651">
    0
  • JaredR.
    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
  • postcd
    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
  • cPanelMichael
    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
  • postcd
    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, help
    0
  • cPanelMichael
    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.