awsprestashop

Integrate PrestaShop with AWS CloudFront

NOTE: We are in the process of modifying the file structure and configuration for many Bitnami stacks. On account of these changes, the file paths stated in this guide may change depending on whether your Bitnami stack uses native Linux system packages (Approach A), or if it is a self-contained installation (Approach B). To identify your Bitnami installation type and what approach to follow, run the command below:

 $ test ! -f "/opt/bitnami/common/bin/openssl" && echo "Approach A: Using system packages." || echo "Approach B: Self-contained installation."

The output of the command indicates which approach (A or B) is used by the installation, and will allow you to identify the paths, configuration and commands to use in this guide. Refer to the FAQ for more information on these changes.

Approach A: Bitnami installations using system packages

Follow the steps below:

  • Create an AWS CloudFront Distribution using the AWS Console. Specify the domain for the PrestaShop application.

    PrestaShop configuration

  • Once the CloudFront Distribution has been created, note the auto-generated domain name, as shown below:

    PrestaShop configuration

  • Log in to the PrestaShop administration panel. Navigate to the “Advanced Parameters -> Performance” page and browse to the “Media Servers” section. Add the domain name for the CloudFront Distribution created previously.

    PrestaShop configuration

  • Browse to the PrestaShop application and check if the images are being served from the CloudFront domain, by viewing any image URL.

Approach B: Self-contained Bitnami installations

Follow the steps below:

  • Create an AWS CloudFront Distribution using the AWS Console. Specify the domain for the PrestaShop application.

    PrestaShop configuration

  • Once the CloudFront Distribution has been created, note the auto-generated domain name, as shown below:

    PrestaShop configuration

  • Log in to the server console using SSH.

  • Edit the /opt/bitnami/apps/prestashop/conf/httpd-app.conf file and set the AllowOverride All configuration value.

  • Remove the current /opt/bitnami/apps/prestashop/htdocs/.htaccess file and create an empty one with write privileges using the commands below:

    $ touch /opt/bitnami/apps/prestashop/htdocs/.htaccess
    $ sudo chown daemon /opt/bitnami/apps/prestashop/htdocs/.htaccess
    
  • Log in to the PrestaShop administration panel. Navigate to the “Advanced Parameters -> Performance” page and browse to the “Media Servers” section. Add the domain name for the CloudFront Distribution created previously.

    PrestaShop configuration

  • Browse to the PrestaShop application and check if the images are being served from the CloudFront domain, by viewing any image URL.

Last modification September 28, 2020