Install Sendy on AWS Lightsail instance running Bitnami WordPress

When following https://sendy.co/get-started I wasn’t sure where to copy Sendy installation files on my server (Step 2 of the Getting Started guide). The tutorial on Sendy website is generic and leaves the installation location and apache configuration on the user.

This blog post shows one way of installing Sendy on Apache webserver pre-packaged in Bitnami’s WordPress image for AWS Lightsail https://docs.bitnami.com/aws/apps/wordpress/

Where to copy Sendy files

Copy Sendy files into /opt/bitnami/apps/sendy/htdocs (you will first need to create the sendy/htdocs subdirectory)
Next create /opt/bitnami/apps/sendy/conf directory which will contain Apache configuration.

Apache configuration

Create file sendy/conf/httpd-prefix.conf with following content:

Alias /sendy/ "/opt/bitnami/apps/sendy/htdocs/"
Alias /sendy "/opt/bitnami/apps/sendy/htdocs"

Include "/opt/bitnami/apps/sendy/conf/httpd-app.conf"

Create file sendy/conf/httpd-app.conf with following content:

<Directory /opt/bitnami/apps/sendy/htdocs/>
    Options +FollowSymLinks
    AllowOverride All
    <IfVersion < 2.3 >
    Order allow,deny
    Allow from all
    </IfVersion>
    <IfVersion >= 2.3>
    Require all granted
    </IfVersion>
</Directory>

In case you’d be getting 404 errors and Sendy is installed at http://mydomain.com/sendy, try adding “RewriteBase /sendy” under “RewriteEngine On” to /opt/bitnami/apps/sendy/htdocs/.htaccess which will look something like:

ErrorDocument 404 "[404 error] If you're seeing this error after install, check this FAQ for the fix: https://sendy.co/troubleshooting#404-error"

Options +FollowSymLinks
Options -Multiviews

RewriteEngine On
RewriteBase /sendy
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule ^([a-zA-Z0-9-]+)$ $1.php [L]

# Link tracker
RewriteRule ^l/([a-zA-Z0-9/]+)$ l.php?i=$1 [L]

# Open tracker
RewriteRule ^t/([a-zA-Z0-9/]+)$ t.php?i=$1 [L]

# Web version
RewriteRule ^w/([a-zA-Z0-9/]+)$ w.php?i=$1 [L]

# unsubscribe
RewriteRule ^unsubscribe/(.*)$ unsubscribe.php?i=$1 [L]

# subscribe
RewriteRule ^subscribe/(.*)$ subscribe.php?i=$1 [L]

Ready to restart Apache server:

sudo /opt/bitnami/ctlscript.sh restart apache

Sendy should now be available at the URL specified in config.php (See Step #1 of Getting Started guide)

Useful links:
https://docs.bitnami.com/aws/infrastructure/lamp/administration/use-htaccess/
https://docs.bitnami.com/aws/infrastructure/lamp/administration/create-custom-application-php/
https://docs.bitnami.com/aws/faq/administration/control-services/

2 thoughts on “Install Sendy on AWS Lightsail instance running Bitnami WordPress

  1. I’m curious to know what the instructions are if my install is to be accessed from sendy.example.com and not example.com/sendy

Leave a Comment