Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Feature Showcase CLI

Discussion in 'General Discussion' started by sparek-3, Oct 3, 2017.

  1. sparek-3

    sparek-3 Well-Known Member

    Joined:
    Aug 10, 2002
    Messages:
    1,457
    Likes Received:
    35
    Trophy Points:
    178
    cPanel Access Level:
    Root Administrator
    It would be nice if cPanel provided a way to set (enable / disable depending on the option) Feature Showcase options via the command line.

    Believe it or not, I don't actually like logging into 50+ WHM after every cPanel update. I don't actually like logging into the WHM period for server administration tasks.

    For example - homedir htaccess optimization - how do you enable or disable that option from the command line?

    Does cPanel assume that everyone just has 1 or 2 servers to deal with? It's a huge hassle when you have a lot of servers and have to log into the WHM to deal with these things.

    All administrative tasks should be able to be done from the command line. This makes it so much easier when you have 50+ servers to update. cPanel has made great strides with their CLI API access, but there's still just some stuff that is missing. This appears to be one of them.
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,424
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello @sparek-3,

    You can follow the instructions documented below to modify values under "WHM >> Apache Configuration >> Global Configuration":

    Manually Edit Apache Features

    Here's the particular section of the file documented in the URL above to modify:

    Code:
      optimize_htaccess:
        item:
          optimize_htaccess: search_homedir_below
    Are there any other features we can help you find command line modification instructions for?

    Thank you.
     
  3. sparek-3

    sparek-3 Well-Known Member

    Joined:
    Aug 10, 2002
    Messages:
    1,457
    Likes Received:
    35
    Trophy Points:
    178
    cPanel Access Level:
    Root Administrator
    Should /scripts/ensure_apache_local_config_has_defaults populate /var/cpanel/conf/apache/local with default values (i.e. a missing optimize_htaccess: directive) if it does not exist?

    Or is there a kosher way to add directives to /var/cpanel/conf/apache/local other than typical text file manipulation methods.
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,424
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    It does not, but I'm unable to reproduce a scenario where the "optimize_htaccess" entry isn't automatically populated in the /var/cpanel/conf/apache/local file. Can you provide some context or a specific scenario we can test in order to provide you with the best approach to manually setting up the entry?

    Thank you.
     
  5. sparek-3

    sparek-3 Well-Known Member

    Joined:
    Aug 10, 2002
    Messages:
    1,457
    Likes Received:
    35
    Trophy Points:
    178
    cPanel Access Level:
    Root Administrator
    Upgrade from cPanel 60 to cPanel 66 or I suspect, whatever version optimize_htaccess was introduced.

    The directive does not get added to /var/cpanel/conf/apache/local until you log into the WHM and accept the Feature Showcase and/or adjust the value in the Apache Configuration section.

    It would seem that /scripts/ensure_apache_local_config_has_defaults is missing any potential value by not adding in default values to /var/cpanel/conf/apache/local. If default values could be set with something, then a simple regex replace could adjust those values from the default to the desired value.
     
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,424
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    If you are strictly making changes through the command line, then /scripts/ensure_apache_local_config_has_defaults will only populate the new .htaccess optimization entry if /var/cpanel/conf/apache/local is created as a blank file (as opposed to if it doesn't exist at all). Thus, to avoid any interaction at all with Web Host Manager, you'd need to directly add the new entries to /var/cpanel/conf/apache/local.

    Thank you.
     
  7. sparek-3

    sparek-3 Well-Known Member

    Joined:
    Aug 10, 2002
    Messages:
    1,457
    Likes Received:
    35
    Trophy Points:
    178
    cPanel Access Level:
    Root Administrator
    Hmm, that's unfortunate then.

    /scripts/ensure_apache_local_config_has_defaults with an empty /var/cpanel/conf/apache/local seems to miss the directoryindex value.

    Seems there is a lot of cludginess to this - some things work, some things halfway work, some thing don't work at all.

    I'll work at it and see what I can cobble together. Seems this is something that's only affecting me anyway.
     
Loading...

Share This Page