ilSavo
ilSavo

Reputation: 854

Create subdomain and set home and stats value for plesk 10.4.4 using API

I was able to create a subdomain in my plesk panel (linux serverm and plesk 10.4.4 ) using API (with a PHP script). But I'm not able to find a documentation online for just two things:

  1. How can I set the stats property to be "awstats" instead of "Nothing"?
  2. How can I set (if is it possible) the home directory for the created subdomain to be, for example /subdomains/my-subdomain?

Thank you very much...

Upvotes: 1

Views: 1343

Answers (1)

rdo
rdo

Reputation: 3982

Try this one:

HTTP_AUTH_LOGIN: <login here>
HTTP_AUTH_PASSWD: <password here>
Content-Type: text/xml
<?xml version="1.0" encoding="UTF-8"?>
<packet version="1.6.3.4">
  <subdomain>
    <add>
      <parent>parent domain name here</parent>
      <name>subdomain name</name>
      <property>
        <name>ftp_password</name>
        <value>qweqwe</value>
      </property>
      <property>
        <name>webstat</name>
        <value>awstats</value>
      </property>
      <property>
        <name>www_root</name>
        <value>httpdoc</value>
      </property>
    </add>
  </subdomain>
</packet>

In case of set request will be:

HTTP_AUTH_LOGIN: <login here>
    HTTP_AUTH_PASSWD: <password here>
    Content-Type: text/xml
    <?xml version="1.0" encoding="UTF-8"?>
    <packet version="1.6.3.4">
      <subdomain>
        <set>
          <filter><id>ID</id></filter>
          <property>
            <name>webstat</name>
            <value>awstats</value>
          </property>
          <property>
            <name>www_root</name>
            <value>httpdoc</value>
          </property>
        </set>
      </subdomain>
    </packet>

Upvotes: 1

Related Questions