Plesk Befehl zum anlegen von Subdoamin

rethus

Registered User
Ich habe ein CMS-System, in dem ich diverse Mandanten verwalten kann.
Nun möchte ich es gerne so erweitern, dass ich über das CMS-System wählen kann, ob beim erstellen eines neuen Mandanten automatisch eine Subdomain angelegt werden soll.

Meine Frage:
Welchen Befehl nutzt Plesk um eine neue Subdomain anzulegen? Kann ich vergabe von Benutzernamen und Passwörter für die Subdomain automatisieren?
 
So, mitlerweile hab ich rausgefunden, dass für das anlegen von subdomains die Datei subdomain.php im Verzeichnis psa/admin/plib/api-cli zuständig ist.

ein./subdomain.php --help ergibt:
Code:
Usage: subdomain command <subdomain_prefix> [options]

    Available commands:
    --create or -c     <subdomain>     creates a subdomain in the domain that
                                       you specify using -domain option
    --update or -u     <subdomain>     updates an existing subdomain for
                                       domain specified with -domain option
    --remove or -r                     removes subdomains specified with
                                       -subdomains option for domain
                                       specified with -domain option
    --info or -i                       retrieves information on subdomains
    --help or -h                       displays this help page

    Available options:
    -domain or -d      <domain_name>   use to specify the main (parent)
                                       domain for creating the subdomain for
    -new_name          <new_subdomain> change the subdomain's name to the
                                       specified one (the option cannot be
                                       used when creating new subdomains)
    -ftp_user          <native|main>   Use a separate FTP user account for
                                       this subdomain (native) or the same
                                       FTP user as that of the main domain
                                       (main). By default the FTP account of
                                       the main (parent) domain is used for
                                       managing the subdomain
    -login             <login>         FTP user login name (can be specified
                                       if separate FTP account is used)
    -passwd            <password>      FTP password (No password is set by
                                       default, and it may be specified when
                                       separate FTP account is used) [see the
                                       note below for details]
    -passwd_type  <plain|encrypted>    FTP user password type (default:
                                       plain) [see the note below for
                                       details]
    -hard_quota        <number>[K|M|G] hard disk quota (use 0 for
                                       "unlimited", which is set by default.
                                       You can specify this option when using
                                       a separate FTP account)
    -ssi               <true|false>    SSI support on subdomain (default:
                                       false)
    -php               <true|false>    PHP support on subdomain (default:
                                       false)
    -cgi               <true|false>    CGI support on subdomain (default:
                                       false)
    -perl              <true|false>    Perl support on subdomain (default:
                                       false)
    -fastcgi           <true|false>    FastCGI support on subdomain (default:
                                       false)
    -miva              <true|false>    Miva support on subdomain (default:
                                       false)
    -asp               <true|false>    ASP support on subdomain (default:
                                       false)
    -python            <true|false>    Python support on subdomain (default:
                                       false)
    -coldfusion        <true|false>    ColdFusion support on subdomain
                                       (default: false)
    -ssl               <true|false>    SSL support on subdomain (default:
                                       false)
    -same_ssl          <true|false>    Place SSL content in same directory as
                                       NonSSL content (default: false)
    -subdomains or -s <subdomain[,...]>
                                       Use for specifying the subdomains to
                                       be removed or to retrieve subdomain
                                       information (--remove and --info
                                       commands respectively). By default,
                                       the --info command outputs information
                                       on all existing subdomains

Note:
 * For security reasons, you can transfer not encrypted passwords via
 environment variable PSA_PASSWORD, by specifying the empty value in the command
 line for the passwd arguments (like " -passwd ''") and setting the password
 value in the PSA_PASSWORD variable.
 Similarly, you can transfer the encrypted password via the environment
 variable PSA_CRYPTED_PASSWORD, by specifying the empty value in the command
 line for the passwd arguments (like " -passwd ''") and by setting the password
 value in the PSA_CRYPTED_PASSWORD variable.

Einziges Problem jetzt ist nur noch, das ich es nicht über die Konsole aufrfen kann, da dort eine Sicherheitsschleife eingebaut ist, welche prüft ob es aus dem Plesk-System heraus aufgerufen wird...

Hier die Ausgabe des direkten Aufrufs:
PHP:
 php ./subdomain.php -c meinetestdomain -d hauptdomain.de -php true
The file subdomain.php is part of Plesk distribution. It cannot be run outside of Plesk environment.

Hat jemand einen Tipp, wie ich dieses Script ansprechen kann?
 
Ok, hab es herausgefunden:

Einfach das Script direkt aufrufen, ohne php davor.

Also NICHT:
php ./subdomain.php -c meinetestdomain -d hauptdomain.de -php true

SONDERN:
./subdomain.php -c meinetestdomain -d hauptdomain.de -php true

Danke, Bitte, Gelöst, Over And Out :D
 
Back
Top