(Advanced) Deployment on Amazon EC2

To simplify Plesk provisioning in the Cloud for infrastructure providers (including service providers offering dedicated servers, VPS, or IaaS), Plesk provides AMIs (Amazon Machine Images) for deploying on the Amazon EC2 web service (for details, refer to https://aws.amazon.com/ec2/?nc1=h_ls). Each AMI allows deploying a particular instance of Plesk 12.5 optimized for specific needs.

Plesk 12.5 AMIs are shipped in five editions and are available for both Linux and Windows. The provided AMIs are listed below.

Image name

License and OS version

Plesk 12.5 for Linux Web Hosting with WordPress Toolkit (CentOS 7)

Plesk Web Host Edition on CentOS 7

Plesk 12.5 for Linux Web Hosting with WordPress Toolkit (Ubuntu 14)

Plesk Web Host Edition on Ubuntu 14.04

Plesk 12.5 for Linux Web Hosting with WordPress Toolkit and Security Bundle (CentOS 7)

Plesk Web Host Edition on CentOS 7 + Kaspersky Antivirus + Security Core Complete

Plesk 12.5 for Linux Web Hosting with WordPress Toolkit and Security Bundle (Ubuntu 14)

Plesk Web Host Edition on Ubuntu 14.04 + Kaspersky Antivirus + Security Core Complete

Plesk 12.5 for WordPress Hosting (CentOS 7)

Plesk Web Admin Edition on CentOS 7 + WordPress Toolkit

Plesk 12.5 for WordPress Hosting (Ubuntu 14)

Plesk Web Admin Edition on Ubuntu 14.04 + WordPress Toolkit

Plesk 12.5 for Developers with App Security (CentOS 7)

Plesk Web App Edition on CentOS 7 + Security Core Complete.

Plesk 12.5 for Developers with App Security (Ubuntu 14)

Plesk Web App Edition on Ubuntu 14.04 + Security Core Complete

Plesk 12.5 'Bring Your Own License' (CentOS 7)

Plesk 12.5 on CentOS 7 with no license

Plesk 12.5 'Bring Your Own License' (Ubuntu 14)

Plesk 12.5 on Ubuntu 14.04 with no license

Plesk for DNN Hosting

Plesk Web Admin Edition on Windows + Control Suite

Plesk 12.5 'Bring Your Own License' (Windows)

Plesk 12.5 on Windows  with no license

Note: The 'Bring Your Own License' (BYOL) instance of Plesk 12.5 allows you to purchase your own license directly from the Plesk Online Store or from a Plesk reseller. Plesk 12.5 licenses are available for two platform types: for dedicated servers and for VPSes. You can use either with your Plesk installed on an Amazon EC2 VPS.

More information about Plesk 12 editions can be found in the following Knowledge Base article: Plesk 12 available editions and differences between them.

Next in this section:

Steps to Deploy

Changing IP address

How it works

Upgrade or Transfer

Troubleshooting and Limitations

 

Steps to Deploy

To deploy Plesk 12.5 from an AMI, perform the following steps:

  1. Log in to the AWS Marketplace, search for the AMI with Parallels as the publisher, then click the selected product.
  2. Check the product description to make sure that it suits your needs, and click the Continue button.
  3. You can choose one of two tabs: Manual Launch with EC2 console or 1-Click Launch. The 1-Click Launch uses the predefined settings (this option does not allow you to modify the default storage size and type when creating the instance: 10 GB magnetic storage for a Linux AMI, and 30 GB magnetic storage for a Windows AMI. To change the disk storage size after deployment, see the Amazon AWS documentation: Expanding the Storage Space of a Volume).
  4. If you select 1-Click Launch (predefined settings):
  5. If you select Manual Launch with EC2 console (adjust additional settings, such as disk space, before launch):
  6. When the instance is deployed, click the Visit Your Software link. The page with your subscription will be opened.
  7. Select Manage in the AWS console. In the AWS Management Console, open your instances list (using the Instances link in the left menu) and select the instance.
  8. It is recommended to attach your Elastic IP to the instance. In the left menu, select Elastic IPs and Allocate New Address, or select any existing unassociated address to be associated to your instance. After the Elastic IP attachment, reboot the instance and perform additional actions to configure Plesk (see the Changing IP Address section). Learn more about Elastic IP in the Amazon AWS documentation: Elastic IP Addresses
  9. To get your Plesk instance admin password:

    On Linux

    Log in via SSH as the EC2-user using the private key of the Key Pair you deployed the instance with.

    For CentOS, use the following command:

    $ ssh -i <path to private key> ec2-user@<elastic or public IP>

    For Ubuntu, use the following command:

    $ ssh -i <path to private key> ubuntu@<elastic or public IP>

    And then run the following command:

    $ sudo plesk bin admin --show-password

    On Windows

    Log in via the remote desktop as the Administrator user with the password taken from the AWS console with the Get Windows Password action. Then, run this command in the command line or or powershell:

    c:\> plesk bin admin --show-password

  10. Log in to Plesk at https://<public IP>:8443 using the login "admin" and the password you just retrieved.
  11. Configure your server's IP address - there is an autodetected private IP address in the configuration form. 

    Note: Never add your public IP to your Plesk instance - only private IP addresses must be registered in Plesk. You can assign a public IP later, on the Tools & Settings > IP Addresses page (it is done automatically on Windows instances). For details, refer to the Administrator's Guide.

    In Plesk 12.5 "Bring Your Own License", "Web Host", and "Web Pro" editions, there is an option to mark the private IP as either dedicated or shared. The private IP should be shared if you want to host different customers in Plesk (this can be changed later in Tools & Settings > IP Addresses).

  12. Specify a hostname. We recommend that you use a domain name that you control, or one controlled by the Amazon instance's Public DNS that will be constant in the case of an Elastic IP.

    Note: Some spam filters (including the default Plesk Greylisting tool) treat mail auto-generated by Amazon hostnames as spam.

  13. Change your password.
  14. If you chose the "Bring Your Own License" edition, activate the license of the Plesk instance as described in the Install a License Key chapter.
  15. (Recommended) For Linux AMI, switch the server to serve any subdomain's DNS records in separate DNS zones for every subdomain. Run the command:
    plesk bin server_pref -u -subdomain-dns-zone own
  16. (Recommended) For correct work of site preview on Plesk 12.5 for Linux AMI, register the Public IP of the instance as the Plesk public IP. This can be done by two ways:
    1. Go to Tools & Settings > IP Addresses, click the IP of the instance and fill the Public IP field.
    2. Run the command:
      plesk bin ipmanage -u `curl http://169.254.169.254/latest/meta-data/local-ipv4` -public-ip `curl http://169.254.169.254/latest/meta-data/public-ipv4`

 

Changing IP address

After every stop/start, your instance changes the public and private IP addresses pair. As a result, you need to perform some additional steps. These steps must also be performed after assigning a new Elastic IP to a configured Plesk instance, but this requires an additional instance restart. For Plesk to operate correctly, all services must be configured to use the private IP, and all A-type DNS records pointing to the local services should point to the public IP.

Steps on Linux
  1. Connect to the instance via SSH as the EC2-user.
  2. If this is the initial IP configuration (for example, after associating an Elastic IP and rebooting) and there are no domains in Plesk yet, run the following command:

    $ sudo /usr/local/psa/bin/amazon_install_dns_template `curl http://169.254.169.254/latest/meta-data/public-ipv4`

  3. If the IP was changed for a Plesk instance that already hosts domains:
  1. Reconfigure all public DNS servers used by the hosted domains to match the machine's new public IP address.
  2. If a public IP was configured for Plesk IP, it should be modified after the IP change. This can be done by the following ways:
    1. Change public IP to the new AWS Public (Elastic) IP in Tools & Settings > IP Addresses.
    2. Run the command:
      plesk bin ipmanage -u `curl http://169.254.169.254/latest/meta-data/local-ipv4` -public-ip `curl http://169.254.169.254/latest/meta-data/public-ipv4`
Steps on Windows

In AMIs with Plesk 12.5, automatic reconfiguration of the public IP addresses is enabled by default. It means that you do not need to make any changes after the IP address change except the instance restart. Just make sure that the Plesk public IP has been changed to the new AWS Public (Elastic) IP in Tools & Settings > IP Addresses.

 

How it works

A number of actions are performed automatically when an instance is deployed, stopped, started, or restarted. You can disable these actions if necessary.

On Linux

After an instance deployment, the following actions are performed automatically:

After an instance stop/start/restart, the following actions are performed automatically:

To disable there reconfigurations, rename the /etc/rc.local file to /etc/rc.local.bak.

On Windows

After an instance deployment, the following actions are performed automatically:

After an instance stop/start/restart, the following actions are performed automatically:

To disable these reconfigurations, disable the scheduled task Prepare public IP.

 

Upgrade or Transfer

Upgrade a Plesk EC2 instance from previous version to Plesk 12.5

If you have already deployed a Plesk instance based on an AMI of a previous version and want to upgrade to Plesk 12.5:

  1. Upgrade your Plesk as described in the Upgrading Plesk chapter.
  2. Use the utilities described below:

On Linux

#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.

touch /var/lock/subsys/local
 
main()
{
    date
    local amazon_public_ip=`curl http://169.254.169.254/latest/meta-data/public-ipv4`
    if [ -n "$amazon_public_ip" ]; then
        bash /usr/local/psa/bin/amazon_setup_ip $amazon_public_ip
    fi
}
 
main >> /var/log/plesk/amazon_setup.log 2>&1

 

On Windows

Go to Tools &Settings > IP Addresses and set the current Amazon Public IP as public IP for the local IP listed in the interface. Alternatively, run the following command: 
%plesk_bin%\ipmanage.exe -u "[local IP listed on interface]" -public_ip "[Amazon Public IP]"
(Here [local IP listed on interface] and [Amazon Public IP] should be changed to the corresponding IP addresses.)

This will enable automatic public IP reconfiguration (for more details, see the How it works section). To disable this reconfiguration, disable the imported scheduled task Prepare public IP. If your Plesk is not configured or its IP address has been changed, refer to the Changing IP address section above.

Plesk transfer to Amazon EC2 instance

To transfer your Plesk server to or from an Amazon instance deployed from a Plesk AMI, follow the instructions provided in the Knowledge Base article How to migrate domains which use custom DNS templates.

 

Troubleshooting and Limitations

Troubleshooting
Known Issues and Limitations