Tulip

  1. First of all, we need to make sure that the server uses PHP 7.1 CLI:
    sudo apt update && apt upgrade

    sudo apt install python-software-properties

    sudo add-apt-repository ppa:ondrej/php

    sudo apt update

    sudo apt install php7.1 apt install php-pear php7.1-curl php7.1-dev php7.1-gd php7.1-mbstring php7.1-zip php7.1-mysql php7.1-xml php7.1-bcmath php7.1-mcrypt

    sudo update-alternatives --set php /usr/bin/php7.1

  2. Create your webspace and add an empty database linked to it
  3. Add the Git repo to webspace.
  4. Copy contents of .env.example into a new file called .env
  5. For APP_NAME, give it the name of your client
  6. For APP_KEY, generate a new key locally using php artisan key:generate from the root of the project and add it here.
  7. Add your database details to the DB_ section of the file.
  8. Add mail details to the MAIL_ section of the file. Please note that these are transactional emails for tasks such as forgotten password. So they should not be the same as your Sparkpost details for sending out newsletters.
  9. For ELASTICSEARCH_INDEX, use the same name as the APP_NAME but hyphenated and lowercase.
  10. For SPARKPOST_SECRET, add a new Subaccount in Sparkpost and generate and use the API Key.
  11. For CLIENT_NAME, use the same value as the APP_NAME
  12. Edit the values below CLIENT_NAME to suit your needs.
  13. Install supervisor to monitor Laravel Queue worker:

    sudo apt-get install supervisor

    # nano /etc/supervisor/conf.d/YOUR-CLIENT-worker.conf

    [program:YOUR-CLIENT-worker]


    process_name=%(program_name)s_%(process_num)02d

    command=php /var/www/vhosts/YOUR-CLIENT-WEBSPACE/httpdocs/artisan

    queue:work --tries=5

    autostart=true

    autorestart=true

    user=YOUR-CLIENT

    numprocs=10

    redirect_stderr=true

    stdout_logfile=/var/www/vhosts/YOUR-CLIENT-WEBSPACE/httpdocs/storage/logs/worker.log




    sudo supervisorctl reread

    sudo supervisorctl update

    sudo supervisorctl start YOUR-CLIENT-worker:*

    Make sure the ‘user’ value matches the user assigned to the subscription and the right path is specified under ‘command’ and ‘stdout_logfile’.
  14. Go to Git repo (within Plesk) and add ‘Additional Tasks’:

    composer install --no-interaction --no-dev --prefer-dist
    php artisan migrate --force
    php artisan queue:restart

  15. Add webhook to the repo in Github and select ‘Automatic Deployment’ in Plesk.
  16. Click on ‘Pull Updates’ – this should pull updates if any, install a fresh database and additional composer PHP packages. If you don’t see a vendor directory in the root of the project after this, there is a problem somewhere – likely with the PHP versions.
  17. Create a scheduled task in Plesk:

    php /var/www/vhosts/YOUR-CLIENT-WEBSPACE/httpdocs/artisan schedule:run >> /dev/null 2>&1

    Make sure the path matches that of your project.
    Under ‘Run’, select cron style and add the following so that it runs every minute:

    * * * * *

    You can push ‘Run Now’ to test it – if it doesn’t return an error, push ‘OK’ to save it.
  18. Visit your project in the browser and register. By default, the first user becomes the super admin who does not need to be activated to start using the system. Any subsequent users who register will need approval from an admin.
  19. In Sparkpost, add and verify the sending domain, tracking domain, bounce domain and verify them using the auto-generated keys.
  20. Add webhook in Sparkpost and test it:

    https://NEWSLETTER.YOUR-PROJECT.COM/api/sparkpost/webhooks
  21. Install the provided provided documentation SQL file. Ensure you have searched and replaced 'https://NEWSLETTER.YOUR-PROJECT.COM' with the actual URL of your newsletter project.