• The new Python extension is now available. It allows customers to deploy and manage WSGI-based Python applications on their websites directly from Plesk.
  • The Plesk Mobile apps for iOS and Android and the Plesk Mobile Center extension have been deprecated, and are no longer available for new installations. In Plesk Obsidian 18.0.84, the Plesk Mobile Center extension will be removed from servers during the upgrade, and the Plesk Mobile apps will lose their server management features.
  • The Social Login extension has been deprecated and will be removed in Plesk Obsidian 18.0.84. After that, it will no longer be possible to log in to Plesk with a Google, Facebook, GitHub account, or with a passkey. Plesk usernames and passwords, as well as logging in with a WebPros Account, are not affected.

How to access plesk 11 cli tools from Webscripts (correctly) ?

cts-service

New Pleskian
Hi,

I have a private Admin-Webspace written in PHP to do some Server Tasks with shell exec functions.

The Webuser is running under fastcgi permissions.
I put him into /etc/sudoers
Then I enabled the function: Users can use their own webscripts for this particular domain and shell access to bash.

Logging in with ssh as user ftp_user and executing the shell admin script from terminal is no problem at all!

But using the browser, opening the php script and then doing a shell exec always throws me an error.


To make it clear, here a snippet (just example):
creating /var/www/vhosts/domain.com/adminpanel/test.php

test.php:
Code:
#!/bin/bash

KD_DB_PW="ihg45kjbOJGoghigb456ojojbn"
PLESK_PATH="/usr/local/psa/bin/"
DB_USER="test"

PSA_PASSWORD='As45fgIpvi45fgtj2'


echo "setting up hosting";

echo "creating user";

sudo -i -uroot $PLESK_PATH/./customer --create "$DB_USER" \
	-name "Plesk User: $DB_USER" -passwd "$DB_PW" \
	-notify false -owner pleskadmin ' '

The Plesk admin environment variable, how do I use it in scripts?
I always get the error:
Code:
Could not open Repository at "/etc/sw/keys": Cannot open file
Unable to connect to database: get_admin_password() failed: file_get_contents() failed:
 
Last edited:
Back
Top