Skip to main content

can user COMMON cPanel connect to API ?

Comments

18 comments

  • cPRex Jurassic Moderator
    Hey there! The token system there is specifically for the WHMAPI commands, which would not be available to standard users. Only root and resellers with WHM access would be able to run those commands as WHM access is required, either directly through a session or through the token.
    0
  • 000
    master @cPRex then how is possible su - $COMMON_USER_cPanel -s /bin/bash -c 'ubic restart ea-tomcat85'
    restart TomCat from X.php ??
    0
  • cPRex Jurassic Moderator
    In the Tomcat guide at Tomcat 8 and EasyApache Setup Guide, step 4 is where the root user grants access to the cPanel user to run the ubic process.
    0
  • 000
    sure!, ROOT give access to RUBIC. After, how from "any.php" can user $COMMON_USER_cPanel restart TC ? yes, he can login into SHELL, but the target is doit using API interface or "file.php"
    0
  • cPRex Jurassic Moderator
    I'm not completely sure I'm following where this is going. You're saying you want to have a user be able to execute the PHP code to restart the service? I don't believe that would work either, as the PHP would be executed as either the cPanel user or Apache, and not the user with enough permissions to perform the service restart with the token.
    0
  • 000
    I'm not completely sure I'm following where this is going. You're saying you want to have a user be able to execute the PHP code to restart the service? I don't believe that would work either, as the PHP would be executed as either the cPanel user or Apache, and not the user with enough permissions to perform the service restart with the token.

    yes master, the idea is: "user cPanel with TC enable, restart TomCat" WITHOUT use SHELL that is all, and this user NOT is reseller
    0
  • cPRex Jurassic Moderator
    There isn't going to be a way to do that - if that were possible, that would open up major security risks to the system.
    0
  • 000
    then how USERX can restart TC without access to SHELL ?
    0
  • cPRex Jurassic Moderator
    I currently don't have a good way to do that - shell access is listed as a requirement for the Tomcat and ubic tools:
    0
  • 000
    I currently don't have a good way to do that - shell access is listed as a requirement for the Tomcat and ubic tools:
    0
  • cPRex Jurassic Moderator
    There is currently not a way to do that without shell access.
    0
  • 000
    There is currently not a way to do that without shell access.

    and is possible as RESELLER user using API ?
    0
  • cPRex Jurassic Moderator
    Yes, a reseller would have access to the whmapi.
    0
  • 000
    Yes

    thanks. Which is the command for a USER RESELLER restart TC ?
    0
  • cPRex Jurassic Moderator
    I believe there is some confusion about the Tomcat and ubic processes. The ubic commands outlined in the guide should only be run as the user, as they are restarting their specific Tomcat application instance. Any actions performed by root or a reseller would be restarting the service for the entire machine, which is a bit different process.
    0
  • 000
    yes master, the focus is restart only TomCat without use SHELL how doit ?
    0
  • cPRex Jurassic Moderator
    There isn't a way to do that, as each Tomcat instance is linked with the user, which would also need shell access. Here is an excerpt from Introduction to Tomcat | cPanel & WHM Documentation "In EasyApache 4, Tomcat runs as a per-user private instance and allows the user to configure their instance themselves. Tomcat runs as the individual user, rather than as the tomcat user. This increases security and places management of the Tomcat instance in the user"s control, but may affect your server"s performance due to the memory requirements." There is not a global restart command for a global Tomcat process, because such a process does not exist.
    0
  • 000
    thanks by your time master @cPRex
    0

Please sign in to leave a comment.