Article ID: 127048, created on Sep 30, 2015, last review on Oct 6, 2015

  • Applies to:
  • Plesk Automation 11.5

Symptoms

How to place every website on IIS node to separate application pool?

Resolution

  1. Go to PSA database (run on the management node):

    # plesk db
    
  2. Find ID of the service node by it's IP address:

    mysql> select id,ipAddress from ServiceNodes;
    +----+-------------+
    | id | ipAddress   |
    +----+-------------+
    |  2 | 172.16.0.11 |
    |  3 | 172.16.0.12 |
    |  4 | 172.16.0.14 |
    |  5 | 172.16.0.15 |
    |  6 | 172.16.0.16 |
    |  7 | 172.16.0.17 |
    |  8 | 172.16.0.18 |
    | 10 | 172.16.0.19 |
    |  1 | local       |
    +----+-------------+
    

    In this example the ID of the service node is 5 with communication IP 172.16.0.15.

  3. Find the ID's of the IP addresses:

    mysql> select id,ip_address,iface from IP_Addresses where serviceNodeId=5;
    +----+--------------------------------------+--------------+
    | id | ip_address                           | iface        |
    +----+--------------------------------------+--------------+
    |  8 | 192.168.5.7                          | "Ethernet"   |
    |  9 | 192.168.5.10                         | "Ethernet"   |
    | 10 | 172.16.0.15                          | "Ethernet 2" |
    +----+--------------------------------------+--------------+
    2 rows in set (0.00 sec)
    

    here, the IP address 192.168.5.10 and 192.168.5.7 are external (public) IP addresses.

  4. Build a list of webspaces which reside on the node based on IP address ID (ID's):

    # mysql -uadmin -p`cat /etc/psa/.psa.shadow` psa -sNe 'select name from domains where webspace_id=0 and id in (select dom_id from DomainServices where ipCollectionId in (select ipCollectionId from IpAddressesCollections where ipAddressId in (8,9) ))' > iisdomains.txt
    
  5. Go to the management node and create a file appool.xml with the following content:

    <?xml version="1.0" encoding="UTF-8"?>
    <packet version="1.6.5.0">
    <webspace>
    <set>
    <filter>
          <name>DomName</name>
    </filter>
    <values>
     <hosting>
      <vrt_hst>
       <property>
          <name>iis_app_pool</name>
          <value>true</value>
       </property>
      </vrt_hst>
     </hosting>
    </values>
    </set>
    </webspace>
    </packet>
    
  6. Create a file enable_appool.sh with the following content:

    #!/bin/bash
    input_file=iisdomains.txt
    
    #Panel password
    passwd=
    
    #Panel IP
    panel_ip=
    
    while read iisdom; do
    echo "Processing webspace $iisdom"
    cat appool.xml |sed 's/DomName/'$iisdom'/g' |curl -k -H "Content-Type: text/xml" -H "HTTP_AUTH_LOGIN:admin" -H "HTTP_AUTH_PASSWD:$passwd" -d@-  https://$panel_ip:8443/enterprise/control/agent.php
    done < $input_file
    

    Specify IP address of the panel in the file above and admin's password for the panel. Make sure that the password does not contain $ and & symbols.

  7. Make the file executable and run:

    # chmod +x enable_appool.sh
    # ./enable_appool.sh
    

Search Words

dedicated pool

application pool

iis

33a70544d00d562bbc5b17762c4ed2b3 caea8340e2d186a540518d08602aa065 e0aff7830fa22f92062ee4db78133079

Email subscription for changes to this article
Save as PDF