Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?

##Sendy on OpenShift

You can deploy Sendy on a free OpenShift using the following instructions.

##Steps

Thise are instructions for setting up the sendy server, you will still need to set everything else up as described in get started [https://sendy.co/get-started].

  1. Signup for a free Redhat OpenShift [https://www.openshift.com/] account
  2. Add a application and select a PHP cartridge, I used non scaling PHP 5.4.
  3. Add a MySQL cartridge, I used MySQL 5.5
  4. (Optional) Add the phpMyAdmin 4.0 cartridge. This will be useful if you're moving from another server and need to import a .sql file.
  5. On your mac, using terminal, checkout the git repository. You can get your ssh:// link in the console [https://openshift.redhat.com/app/console/applications] then click the application and you'll see your link on the right.

git clone ssh://YOUR_SSH_LINK.git

  1. Copy contents of the Sendy zip you got when you downloaded it to the folder that was just created by git. Don't forget to copy all the hidden files too (like .htaccess).
  2. Open your includes/config.php file and replace it's contents with what I have below. Don't forget to change YOUR_SENDY_URL_GOES_HERE.com with your domain name. I use cloudflare to point a sub-domain to openshift. Here are instructions [http://stackoverflow.com/a/26337432/1078829] on how to do it
<?php
   //----------------------------------------------------------------------------------//
   //                               COMPULSORY SETTINGS
   //----------------------------------------------------------------------------------//

   /*  Set the URL to your Sendy installation (without the trailing slash) */
   define('APP_PATH', 'http://YOUR_SENDY_URL_GOES_HERE.com');

   if(!defined('DB_HOST')) {
       define('DB_HOST', getenv('OPENSHIFT_MYSQL_DB_HOST'));
       define('DB_PORT',getenv('OPENSHIFT_MYSQL_DB_PORT'));
       define('DB_USER',getenv('OPENSHIFT_MYSQL_DB_USERNAME'));
       define('DB_PASS',getenv('OPENSHIFT_MYSQL_DB_PASSWORD'));
       define('DB_NAME',getenv('OPENSHIFT_GEAR_NAME'));
   }
   /*  MySQL database connection credentials (please place values between the apostrophes) */
   $dbHost = DB_HOST; //MySQL Hostname
   $dbUser = DB_USER; //MySQL Username
   $dbPass = DB_PASS; //MySQL Password
   $dbName = DB_NAME; //MySQL Database Name


   //----------------------------------------------------------------------------------//
   //                                OPTIONAL SETTINGS
   //----------------------------------------------------------------------------------//

   /*
       Change the database character set to something that supports the language you'll
       be using. Example, set this to utf16 if you use Chinese or Vietnamese characters
   */
   $charset = 'utf8';

   /*  Set this if you use a non standard MySQL port.  */
   $dbPort = DB_PORT;

   /*  Domain of cookie (99.99% chance you don't need to edit this at all)  */
   define('COOKIE_DOMAIN', '');

   //----------------------------------------------------------------------------------//
?>
  1. Add all the sendy files to git, commit them, and push them to the server using terminal again.
git add .
git commit -m 'Added Sendy'
git push
  1. Add your domain (or sub-domain in my case) to openshift by going to the console [https://openshift.redhat.com/app/console/applications], clicking the app and clicking change alias next to your temporary openshift sub-domain.
  2. Sendy should be ready. Load it up in the browser and go through the instalation.

Note: I got an error about sendy not being able to access Amazon's servers when I first loaded it but I think that was because it hadn't completely started up, I refreshed it and everything worked great.

Let me know if this was helpful or needs some tweaking in the comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.