How to deploy Plesk on the Amazon EC2 service

Refers to:

  • Plesk for Linux
  • Plesk 12.0 for Windows
  • Plesk 12.0 for Linux
  • Plesk 12.5 for Windows
  • Pesk Onyx

Created:

2016-11-16 12:52:34 UTC

Modified:

2017-02-24 06:45:48 UTC

4

Was this article helpful?


Have more questions?

Submit a request

How to deploy Plesk on the Amazon EC2 service

Release Notes

To simplify Plesk provisioning on Cloud for infrastructure providers (including service providers offering dedicated, VPS, or IaaS), Plesk has introduced Plesk AMI images for the Amazon EC2 service.

The following Plesk configurations are available on AWS Marketplace:

Plesk Onyx
Plesk Components set
Plesk Onyx on CentOS 7 (Web Host) Recommended set*
Plesk Onyx on Ubuntu 16.04 (Web Host) Recommended set*
Plesk Onyx on Windows 2012 R2 (Web Host) Recommended set*
Plesk Onyx on CentOS 7 (BYOL**) Recommended set*, except for: WordPress Toolkit, Security Advisor, Let’s Encrypt, Git, the resctrl utility, Docker
Plesk Onyx on Windows 2012 R2 (BYOL**) Recommended set*, except for: WordPress Toolkit, Security Advisor, Let’s Encrypt, Git, the resctrl utility, Docker

*The Recommended components set includes all components necessary for web hosting (including the web server, a mail server, a database server, and so on), plus the most popular and widely used features.

Plesk 12 

Image name License and OS version
Plesk for Linux Web Hosting with WordPress Toolkit Plesk Web Host Edition on CentOS 7
Plesk for Linux Web Hosting with WordPress Toolkit and Security Bundle Plesk Web Host Edition on CentOS 7 + Kaspersky Antivirus + Security Core Complete
Plesk for WordPress Hosting Plesk Web Admin Edition on CentOS 7 + WordPress Toolkit
Plesk for DNN Hosting Plesk Web Admin Edition on Windows + Control Suite
Plesk for Developers with App Security Plesk Web App Edition on CentOS 6 + Security Core Complete.
Plesk 12 'Bring Your Own License' ** on CentOS 6 and Windows

** Plesk 'Bring Your Own License' - this instance of Plesk 12 allows you to purchase your own license directly from Plesk or from a Plesk partner. Plesk 12 licenses are available for two platform types: for dedicated server or for VPS. License for any platform type will fit your needs.

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

Steps to Deploy

  1. Log into the AWS Marketplace, search for the AMI from Parallels for Plesk 12 or Plesk for Plesk Onyx as the publisher, then click the selected product.

  2. Check the product description to verify it suits your needs. Then, click the "Continue" button.

  3. You can choose the Manual Launch with EC2 console by selecting the corresponding tab, or continue with the 1-Click Launch using predefined settings (the 1-Click Launch option does not allow you to modify the default storage size and type when creating the instance: 10 GB magnetic storage on the Linux AMI and 30 GB magnetic storage on the Windows AMI. To change disk storage after deployment, see the Amazon AWS documentation: Expanding the Storage Space of a Volume .)

  4. 1-Click Launch (predefined settings):

      • Select the "Region" to deploy the instance and the EC2 Instance Type depending on your needs (Note: the price is different for different regions).
      • In VPC settings, select where your instance will be deployed: EC2 classic (recommended) or your personal Virtual Private Cloud. If the VPC network is selected, please make sure that your virtual network is configured to provide internet access to the instance that is being deployed. The main differences between EC2-classic and VPC are described in Amazon EC2 and Amazon Virtual Private Cloud (VPC) . Find more information about VPC in the Amazon VPC documentation.
      • Select the default options or create a new Security Group based on the seller settings. Pay special attention to the ports that are required for Plesk - see the Knowledge Base article KB391: Which ports need to be opened for all Plesk services to work with a firewall?
      • Select the Key Pair to be used for connection to the instance (an existing Key Pair is required for connection to the Plesk instance). A Key Pair can be generated in the AWS Management Console.

    Note: Keep your private key safe. If you lose the private key, you may not be able to regain access to your instance.

    • Click the Launch with 1-Click button.

    By default, instances are deployed with small root storage (10 GB on Linux and 30 GB on Windows). To deploy instances with bigger storage, use Manual Launch with EC2 console.

    To change the disk storage after deployment, check the Amazon AWS documentation: Expanding the Storage Space of a Volume .

  5. Manual Launch with EC2 console (adjust additional settings such as disk space before launch):

    • Click on the Manual Launch tab.
    • Click the Launch with EC2 Console button in the Region the instance is to be deployed.
    • In the opened EC2 Console, choose an Instance Type depending on your requirements. Then, click the Next: Configure Instance Details button.
    • Set instance details. Here, you can select how many instances to deploy and select a Network (EC2-classic or VPC). If the VPC network is selected, please make sure that your virtual network is configured to provide internet access to the instance being deployed.

      The main differences between EC2-classic and VPC are described in Amazon EC2 and Amazon Virtual Private Cloud (VPC). Find more information about VPC in the Amazon VPC documentation. - Change other options if required, then click Next: Add Storage . - Add storage to your instance. By default, AMIs on CentOS have 10 GB storage and AMIs on Windows have 30 GB storage (which is the minimum value). It is recommended to increase your disk storage from the default values - your disk will be automatically resized when the instance is deployed.

      To change disk storage after deployment, check the Amazon AWS documentation: Expanding the Storage Space of a Volume.You can also add more storages to your instance and change the storage volume types to increase performance. Find more information about the storage type and pricing in the Amazon AWS documentation: Amazon EBS Product Details.

      Click Next: Tag Instance - Add Tags for the instance. For example, you can define a tag with key = Name and value = Webserver.

      Learn more about tagging your Amazon EC2 resources.

      Click Next: Configure Security Group - Configure the security group. A security group is a set of firewall rules that control the traffic for your instance. It is recommended that you configure the security group depending on services you are going to serve, based on Knowledge Base article KB213932745 .

      Click Next: Review Instance Launch - Review your instance launch details. You can go back to edit changes for each section. Click Launch to assign a key pair to your instance and complete the launch process.

  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 opened AWS Management Console, open your instances list (using the Instances link in the left menu) and select the instance.
  8. ( Recommended ) 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 allocated to your instance. After Elastic IP attachment, reboot the instance and perform additional actions to configure Plesk (see the Changing IP Address section).

    Please find more information about Elastic IP on Amazon AWS documentation: Elastic IP Addresses .9. To get your Plesk instance admin password:

    Linux

    Log in via SSH as an ec2-user with the private key of the Keys Pair you deployed the instance with:

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

    Then, run the command:

        $ sudo /usr/local/psa/bin/admin --show-password

    Windows

    Log in via RDP as the Administrator user with the password taken from the AWS console with the "Get Windows Password" action. Then, run this command in cmd:

    "%plesk_cli%\admin.exe" --show-password
  9. Log in to Plesk at https://<external IP>:8443 using the login "admin" and admin password.

  10. Configure your server IP - there is an autodetected internal IP in the configuration form. Important: Never add your external (public) IP to your Plesk implementation - there must only be an internal IP registered in Plesk.

    On Plesk 12 ' Bring Your Own License ' or Web Host or Web Pro Editions , there is an option to select the internal IP as dedicated or shared. The internal IP should be shared if you want to host different customers on your Plesk (this option can be changed later under the Tools & Settings > IP Addresses ).12. Specify a hostname.

    It is recommended 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) consider mail auto-generated by Amazon hostnames as spam.13. Change your password.14. If you chose the Bring Your Own License product, activate the license of the Plesk instance as described in the Plesk 12 Installation and Upgrade Guide .15. ( Recommended ) Switch the server to serve any subdomain's DNS records in separate DNS zones for every subdomain:

    Linux

    # /usr/local/psa/bin/server_pref -u -subdomain-dns-zone own

    Windows

    "%plesk_cli%\server_pref.exe" -u -subdomain-dns-zone own`

Changing IP address

After every stop/start, your instance changes the external and internal IP pair. As a result, some additional steps are needed. The same steps are required 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 should be configured to use the internal IP, and all A-type DNS records pointing to the local services should point to the external IP.

Linux

  1. Connect to the instance via SSH as an ec2-user.
  2. If this is an initial IP configuration (for example, after associating an Elastic IP and rebooting) and there are no domains in Plesk yet, use 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 on a Plesk implementation that already hosts domains:

    • Log in to Plesk and go to Tools & Setting > General Settings > DNS Template settings .
    • Check that all "A" records from the server-wide DNS template point to the new external IP, and synchronize the changes to all zones by clicking Apply DNS Template Changes and selecting All zones .

    Keep in mind that all unchanged PTR and A -type DNS records that point to the old public IP in all DNS zones will be changed to the new public IP.

    You can find additional details on the DNS Template synchronization procedure in the Administrator's Guide: Performing Mass Operations over DNS Zones .

  4. Reconfigure all external DNS servers used by the hosted domains to match the machine's new external IP.

Windows

  1. Connect to the instance via RDP.

  2. Run the following command in cmd:

    "%plesk_bin%\amazon\amazon_repair_ip.cmd" <OLD_EXTERNAL_IP>

    (where <OLD_EXTERNAL_IP> is the previous public IP, which can typically be taken from the Server DNS template(if it wasn't changed)):

    "%plesk_bin%\dbclient.exe" --direct-sql --sql="select distinct(val) as IP from dns_recs_t where type = 'A'"
    IP
    184.73.194.188

    Keep in mind that all PTR and A type DNS records that point to the old public IP in the server DNS template (in all DNS zones) will be changed to the new public IP.  3. Reconfigure all external DNS servers used by the hosted domains to match the machine's new external IP.

Upgrade a Plesk EC2 instance based on previous AMI version to Plesk

If you have already deployed a Plesk instance based on previous version AMIs (BYOL or PowerPack) and want to upgrade to Plesk:

  1. Upgrade your Plesk as described in the Installation, Upgrade, Migration, and Transfer Guide for Plesk 12.0 .

  2. Add utilities from the attached archives:

    Linux : Download the archive ami_linux_utils.zip and unpack its contents to /usr/local/psa/bin/ 

    Windows : Download the archive ami_win_utils.zip and unpack its contents to C:\Program Files (x86)\Parallels\Plesk\admin\bin\amazon 

  3. If your Plesk is not configured or its IP was changed, refer to the Changing IP address section above.

Plesk transfer to Amazon EC2 instance

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

Known Issues and Limitations

  • Subdomains cannot be resolved without the manual subdomain's A DNS record being modified to the external IP, or switching on the subdomain's DNS zone.

    This behavior can take place when a subdomain's A record points to local IP address when a subdomain is created. As a workaround, switch the server to serve subdomain's records as separate DNS zones using the following commands:

    Linux

    /usr/local/psa/bin/server_pref -u -subdomain-dns-zone own

    Windows

    "%plesk_cli%\server_pref.exe" -u -subdomain-dns-zone own`
  • The Tomcat component is not shipped with the AMI.

  • Some spam filters (including the default Plesk greylisting) consider mail auto-generated by Amazon hostnames as spam. Therefore, you may need to change the hostname.
  • If an external IP address is added to the interface/Plesk/domain and the nginx service is enabled, websites may point to the "Default Plesk Page".

    Resolve this issue by switching domains to the internal IP addresses from the Plesk user interface: go to Plesk->Subscriptions->Change Hosting Settings.

Have more questions? Submit a request
Please sign in to leave a comment.