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!

In Progress [CPANEL-24040] Using whmapi1 set_service_config_key with Apache

Discussion in 'cPanel Developers' started by jmginer, Jul 13, 2019.

  1. jmginer

    jmginer Well-Known Member

    Joined:
    Jul 26, 2006
    Messages:
    128
    Likes Received:
    1
    Trophy Points:
    168
    Location:
    Alicante
    cPanel Access Level:
    Root Administrator
    Hello,

    I run this command:

    Code:
    whmapi1 set_service_config_key api.version=1 service=apache key=startservers value=10
    The result resturn OK

    Code:
    ---
    metadata:
      command: set_service_config_key
      reason: Succeeded
      result: 1
      version: 1
    But nothing's changed when I connect to the WHM > Apache > Global conf

    What I'm doing wrong?

    Thanks!
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. Infopro

    Infopro cPanel Sr. Product Evangelist Staff Member

    Joined:
    May 20, 2003
    Messages:
    16,953
    Likes Received:
    485
    Trophy Points:
    583
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. jmginer

    jmginer Well-Known Member

    Joined:
    Jul 26, 2006
    Messages:
    128
    Likes Received:
    1
    Trophy Points:
    168
    Location:
    Alicante
    cPanel Access Level:
    Root Administrator
    @Infopro Yes, but what do you mean?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. Infopro

    Infopro cPanel Sr. Product Evangelist Staff Member

    Joined:
    May 20, 2003
    Messages:
    16,953
    Likes Received:
    485
    Trophy Points:
    583
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Well, I'm thinking about this mesaage, there:
    I assume then that, service=apache, is not compatible. No clue if I'm correct here or not though, just going by what I read on that docs page.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. jmginer

    jmginer Well-Known Member

    Joined:
    Jul 26, 2006
    Messages:
    128
    Likes Received:
    1
    Trophy Points:
    168
    Location:
    Alicante
    cPanel Access Level:
    Root Administrator
    Strange, the get_service_config function in the documentation also says that it only works with dovecot, but it does return Apache results correctly.

    WHM API 1 Functions - get_service_config - Developer Documentation - cPanel Documentation


    Code:
    # whmapi1 get_service_config service=apache
    ---
    data:
      defaultvhost:
        userdirprotect: -1
      main:
        directory:
          options:
            directive: options
            item:
              options: ExecCGI FollowSymLinks IncludesNOEXEC Indexes
        directoryindex:
          directive: directoryindex
          item:
            directoryindex: index.php index.php5 index.php4 index.php3 index.perl index.pl index.plx index.ppl index.cgi index.jsp index.jp index.phtml index.shtml index.xhtml index.html index.htm index.wml Default.html Default.htm default.html default.htm home.html home.htm index.js
        documentroot:
          directive: documentroot
          item:
            documentroot: /usr/local/apache/htdocs
        extendedstatus:
          directive: extendedstatus
          item:
            extendedstatus: 'On'
    ...
    

    Then, can tell me how I can automate the implementation of the configurations?

    * Apache Global Configuration
    * Exim Configuration
    * FTP Server Configuration
    * Backup Configuration

    Thanks!
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    #5 jmginer, Jul 15, 2019
    Last edited: Jul 15, 2019
  6. cPanelMichael

    cPanelMichael Technical Support Community Manager Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    47,580
    Likes Received:
    2,182
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello @jmginer,

    Internal case CPANEL-24040 is open to address an issue where the set_service_config_key WHM API 1 function accepts Apache as an input parameter for service despite the apparent intended limitation of this function to the Dovecot service. I'll monitor this case and update this thread with more information as it becomes available.

    You may find the cpconftool script useful as an alternative for all of the quoted configurations (except for FTP):

    The cpconftool Script - Version 82 Documentation - cPanel Documentation

    For FTP, the instructions on the document below are applicable:

    FTP Server Configuration - Version 82 Documentation - cPanel Documentation

    Let me know if this helps.

    Thank you.
     
  7. jmginer

    jmginer Well-Known Member

    Joined:
    Jul 26, 2006
    Messages:
    128
    Likes Received:
    1
    Trophy Points:
    168
    Location:
    Alicante
    cPanel Access Level:
    Root Administrator
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    cPanelMichael likes this.
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice