Skip to main content

How To Configure Sendy on Ubuntu 16.04 with nginx

How To Configure Sendy on Ubuntu 16.04 with nginx




Introduction


Sendy is a self hosted email newsletter application that lets you send trackable emails via Amazon Simple Email Service (SES). You can host it on your vps. We are going to see how to host the Sendy on Ubuntu server having installed php , mysql and nginx

Prerequisites


Before you begin this guide you'll need the following:
  • VPS with ubuntu 16.04
  • PHP
  • MySQL
  • nginx

Step 1 — Get the licenced copy of sendy

Sendy is a commercial product. You have to purchase it before using it. You can purchase it from http://sendy.co
After purchasing they will send you a copy of the sendy to your email id.
Now transition to the next step by telling the reader what's next.


Step 2 — Configer Sendy

Extract the zip of sendy you get in the email
Update the config.php file
  • You will be able to find config.php file inside the include folder.
  • Update the varialbes inside config.php
    Set the App_PATH & Set the mysql credentials
    /*  Set the URL to your Sendy installation (without the trailing slash) */
    define('APP_PATH', 'url-you-want-to-use-for-your-sendy-server'); /* for example : sender.yourdomain.com */
    
    /*  MySQL database connection credentials (please place values between the apostrophes) */
    $dbHost = 'localhost'; //MySQL Hostname
    $dbUser = 'root'; //MySQL Username
    $dbPass = 'password'; //MySQL Password
    $dbName = 'sendy'; //MySQL Database Name
    



Step 3 — Configure Ubuntu Server for sendy

  • Create mysql database for the sendy. Here create the database the same name as you have written in the config.php
  • Upload the sendy to /var/www/html folder on ubuntu server
  • Change the permission of the upload folder inside the sendy to 777

Step 4 — Domain/Subdomain Setup To access sendy

Setup the url to access the sendy : Here url shoukd be same as you have defined in the APP_PATH.
For example 
your APP_PATH is : sender.mydomain.com
Then you have to first set the subdomain for this.
  • Create a subdomain named sender at your domain provider
  • Make A record with the subdomain pointing to your vps ip address
Now update your nginx host file
  • Go to /etc/nginx/site-available
  • Append this code to default
server {
    listen 80;
    listen [::]:80;
    root /var/www/html/sendy; 

    server_name sender.{yourdomain}.com;

    index index.php;
    location ~ \.php$ {
    try_files $uri =404;
               fastcgi_split_path_info ^(.+\.php)(/.+)$;
                fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                include fastcgi_params;
    }

    location / {
            if (!-f $request_filename){
                    rewrite ^/([a-zA-Z0-9-]+)$ /$1.php last;
            }
    }
    location /l/ {
            rewrite ^/l/([a-zA-Z0-9/]+)$ /l.php?i=$1 last;
    }
    location /t/ {
            rewrite ^/t/([a-zA-Z0-9/]+)$ /t.php?i=$1 last;
    }
    location /w/ {
            rewrite ^/w/([a-zA-Z0-9/]+)$ /w.php?i=$1 last;
    }
    location /unsubscribe/ {
            rewrite ^/unsubscribe/(.*)$ /unsubscribe.php?i=$1 last;
    }
    location /subscribe/ {
            rewrite ^/subscribe/(.*)$ /subscribe.php?i=$1 last;
    }
    location ~* \.(ico|css|js|gif|jpe?g|png)(\?[0-9]+)?$ {
            expires max;
            log_not_found off;
    }
}

Step 5 — Install the sendy

Install the Sendy
After you done the domain settings (Step 4) for the sendy you will be able access the sendy via APP_PATH url.
  • Open this url in browser : http://yourdomain.com/sendy
    It will install the sendy itself. It will ask you for your domain name and the licence key.

    You got via email already at time of purchase.
    • Open this url in browser : http://your_sendy_installation_url/_compatibility.php?i=1 It will display the error if any php dependacy is missing or not. ( Because sendy is not offically for nginx it will show some missing dependency but it is ok.)



Step 6 — Setup cron job to enable scheduling in sendy

Set the cron job using crontab
$ crontab -e
it will open the cronjob file

*/5 * * * * php /var/www/html/scheduled.php > /dev/null 2>&1
add this line to the file save and exit.


Tip for windows

if you are running sendy on windows you will be able to set every thing leaving just one thing.

That is cron of scheduling.

IN this case you have to creat a task in the task scheulder and call bat file having this code inside it




echo running sendy scheduler process >> out.log

Pushd "Path-to-your-php-executable-file" >> out.log

php.exe -f "Path-to-your-sendy-folder\scheduled.php"   >> out.log

echo executed: C:\laragon\bin\php\php-7.1.1-Win32-VC14-x86\php.exe 

 C:\laragon\www\sender\scheduled.php >> out.log

Comments

  1. I am commenting to let you know what a terrific experience my daughter enjoyed reading through your web page. She noticed a wide variety of pieces, with the inclusion of what it is like to have an awesome helping style to have the rest without hassle grasp some grueling matters.
    AWS Training in Bangalore|

    ReplyDelete
  2. I am glad to post a worthy article about the German Language Course and IELTS Coaching from KCR consultants, this may change your career growth and language skill.
    KCR CONSULTANTS
    KCR CONSULTANTS

    ReplyDelete
  3. your blog' s design is simple and clean and i like it. Your blog posts about Online writing Help are superb. Please keep them coming. Greets!

    Spark Training institute in Bangalore

    ReplyDelete
  4. Very Good
    This blog is interested
    https://www.digisnare.com/

    ReplyDelete

Post a Comment

Popular posts from this blog

Apache : setup basic auth with apache in windows

Authentication is any process by which you verify that someone is who they claim they are. Authorization is any process by which someone is allowed to be where they want to go or to have information that they want to have. I will show here how to set up basic auth on the apache with windows. Pre-requests  Windows VPS Apache server ( That's it ) ( In windows it might be difficult to setup the Apache alone. So instead use something ling xampp , wamp or laragon .) RestClient (  I personally use the postman , but you can use your preferable client)  Windows VPS provider Steps  Enable the necessary modules in the Apache Create the password file Set the auth directives in the virtual host file. Verify basic auth. Enable the  necessary   modules  in the Apache Open the httpd.conf file in the apache's conf folder. httpd.conf file Enable the necessary modules to make the basic auth workin...

Google blogger Ideas panel

Google blogger Ideas  I opened by blogger today, and..   I got this.  Google blogger Ideas  A panel suggesting a topic on which I can write my next blog. It's fetching unanswered question from web according to your previous post and topics. It was something, I was really looking for, after all it takes time to finding subject on which to write next and still being in the same niche.  Awesome feature Blogger! 

Sciter : GUI Application with Golang using HTML/CSS

GUI library for golang sciter This is the words from Sciter's Web site, Sciter brings a stack of web technologies to desktop UI development. Web designers and developers can reuse their experience and expertise in creating modern looking desktop applications. Various GUI frameworks offer different UI declaration and styling languages, such as QML and  XAML (Microsoft WPF) . On the contrary, Sciter allows using time proven, robust, and flexible HTML and CSS for GUI definition and GPU accelerated rendering.   Before using sciter I already tried other alternatives but none of them was satisfactory as an example first i tried andlabs / ui  library   i already have written a post on it. You can read it on post gui programming with golang .  But this library is still under construction and has no support for production apps. Secondly, I go for electron but the problem was my simple calc like the app was of size 150mb....