Using WP-CLI with ISPCFG3

Discussion in 'General' started by Ovidiu, Oct 15, 2015.

  1. Ovidiu

    Ovidiu Active Member

    I host only Wordpress sites so http://wp-cli.org/ would be very useful to me even if one could only use part of its features.
    I tried installing it into /usr/local/bin and adding /usr/local/bin/wp-cli.phar to the Jailkit chrooted applications then created a shell chrooted user but I can't see wp-cli.phar inside the bin folder.

    I have setup my shell users in such a way that their IDs are linked toe the IDs of the web user so this could be quite a nice addition if I could get it to work.

    Anyone got any ideas?
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Did you create a completely new website? The jail is created once for a website when the first jailed ssh user or jailed crojob is added, when you add files later to the jailkit configuration then they dont get added to existing jails. If you want to copy files into a jail later, use the jailkit jk_cp command.
     
  3. Ovidiu

    Ovidiu Active Member

    Yes, I had created a new jail user after doing these steps.
    Seems to work now except its telling me its not compatible with APC (alternative PHP Cache) so this issue is solved.
    Will give it a new try once I've retired APC and switched to another compatible cache.

    Thanks for the pointers!
     
  4. Ovidiu

    Ovidiu Active Member

    Till, can you help with some questions regarding deeper integration?
    i.e. http://wp-cli.org/ they talk about

    How would I achieve that automatically for all shell users?

    Any chance that the shell user can actually perform more "complex" commands like http://wp-cli.org/commands/db/ like performing DB operations? I expect the shell user will be limited to what is allowed within the jail and with the given credentials inside wp-config.php meaning he can modify a DB but probably no delete/create it?
     
  5. till

    till Super Moderator Staff Member ISPConfig Developer

    It depends on which database credentials you use. If you created the database in ispconfig and use this database credentials, then you can created and delete tables but not the database itself. If you use the mysql root login then you can do anything in the database incl. deleting databases and deleting ispconfig.

    If you want to run a script automatically when a new website gets created then you can e.g. write your own ispconfig server plugin and attachs it to the website insert command.
     
    Ovidiu likes this.
  6. Ovidiu

    Ovidiu Active Member

    hm, I was thinking more along the lines of this:

    when a shell user is created he is linked to the web account so he can edit and modify files in the web directory.

    so I was thinking if shell users could also be somehow linked to the DB management, i.e. a shell user limited to the limits of the client, i.e. client is allowed 2 DBs then this shell user could create 2 DBs? Or have access to a clients DBs?

    Anyway, just thinking out loudly here :)
     
  7. till

    till Super Moderator Staff Member ISPConfig Developer

    MySQL does not know what a Linux shell user is, MySQL has its own user management and it has no support for database quotas, neither by size nor number. so you cant have a mysql user that is limited to create just two databases. Therefor you create databases in ispconfig in a client account and ispconfig applies the limit on how many databases a client can create. the login details of the databases that you create in ispconfig can then be used on the shell with any mysql tool or cms / shop system that uses mysql.
     
  8. Ovidiu

    Ovidiu Active Member

    exactly :) I didn't say anything about MYSQL users but was referring to client limitations.
    so the question would have been (had I know the right terms), can you connect a shell user to a client account and its limits?
     
  9. till

    till Super Moderator Staff Member ISPConfig Developer

    No. A client is a virtual construct in ispconfig to hold limitations for a user. neither the linux shell nor mysql know what a client is and no similar limitations exist in bash nor mysql cli.
     
    Ovidiu likes this.
  10. Ovidiu

    Ovidiu Active Member

    Thanks for the nice write-up, will give it a try asap and let you know how it goes.
     

Share This Page