playSMS 1.4.2 on Ubuntu 18.04

This howto will show you how to install playSMS 1.4.2 on Ubuntu 18.04, the latest version as of today. By using Ubuntu 18.04 as base distribution you can test whether or not playSMS 1.4.2 work properly with PHP 7.2 and MySQL 5.7.

Let’s Start

Login to your DigitalOcean web panel. If you haven’t got one then register for free here: https://m.do.co/c/aeec1cef58b6

Shameless plug: Notice the referral link there ? Yes, please click it so that you can earn USD 10 credit on DigitalOcean (for testing this howto maybe?) and when you actually use and spent money on DigitalOcean then I’ll also get something from them too :)

Quick FAQ:

Q: Can I install on different server other than DigitalOcean ?
A: Yes of course, you need Internet and preferably CLI root access

Droplet

Create a new droplet. Just in case you don’t know what a droplet is, a droplet is equal to a server or a VPS at DigitalOcean.

Select Linux distribution Ubuntu 18.04 with the lowest VPS specification (the cheapest that is).

Once the server ready you may SSH to the server and start update and upgrade it:

apt update && apt -y upgrade

Wait until the upgrade finished. It should take a few minutes only.

Install required Linux packages:

apt -y install nginx mysql-server php-fpm php-cli php-mysql php-gd php-imap php-curl php-xml php-mbstring

Please note that we will be installing: Nginx, MySQL 5.7 and PHP 7.2.

Nginx

Next is to prepare Nginx to host playSMS domain, in this example I will use my domain my.textng.com.

Prepare virtual host directory:

mkdir -p /home/vhosts/my.textng.com/html
mkdir -p /home/vhosts/my.textng.com/logs

Setup Nginx to enable my.textng.com site:

cd /etc/nginx/sites-available
nano my.textng.com.conf

Copy this to my.textng.com.conf and save it:

server {
  listen 80;

  server_name my.textng.com;

  root /home/vhosts/my.textng.com/html;
  index index.html index.htm index.php;

  access_log /home/vhosts/my.textng.com/logs/access.log;
  error_log /home/vhosts/my.textng.com/logs/error.log;

  location / {
    try_files $uri $uri/ =404;
  }

  location ~ \.php$ {
    include snippets/fastcgi-php.conf;
    fastcgi_pass unix:/run/php/php7.2-fpm.sock;
  }
}

Enable my.textng.com:

cd /etc/nginx/sites-enabled
ln -s ../sites-available/my.textng.com.conf .

Restart Nginx:

systemctl restart nginx

Until now you will be able to browse your server (in my case browse http://my.textng.com). No HTTPS, I don’t plan to write SSL howto right now, but maybe later. You can always re-configure your Nginx to serve HTTPS, there are a few good manual to do so in the Internet I’m sure.

MySQL

Nginx done, lets do MySQL.

Create new database for playSMS:

mysqladmin create playsms

Add new MySQL user called playsms and set it to manage playSMS database. Login to MySQL server from CLI:

mysql

From inside MySQL shell:

CREATE USER 'playsms'@'localhost' IDENTIFIED BY 'changethislater';
GRANT ALL PRIVILEGES ON playsms.* TO 'playsms'@'localhost' WITH GRANT OPTION;
FLUSH PRIVILEGES;
quit

At this point please note that new MySQL user is playsms, with password changethislater and playSMS database name is playsms.

playSMS

Ok MySQL configured. Now lets get into playSMS.

Get the playSMS 1.4.2, save it in your home directory (in this howto its in /root), extract it and edit install.conf for playSMS installation:

cd ~
wget -c "https://sourceforge.net/projects/playsms/files/playsms/Version%201.4.2/playsms-1.4.2.tar.gz/download" -O playsms-1.4.2.tar.gz
tar -zxf playsms-1.4.2.tar.gz
cd playsms-1.4.2/
cp install.conf.dist install.conf
nano install.conf

On install.conf edit options according to your setups, for example in this howto:

  • DBUSER="playsms"
  • DBPASS="changethislater"
  • PATHWEB="/home/vhosts/my.textng.com/html"

Save the file and ready to install playSMS using provided install script.

Run the install script:

./install-playsms.sh

Confirmation configuration will be shown, check again and continue only when everything is correct.

Hit y or Y to continue the install script.

playSMS install script will download necessary files and copy files and folders to appropriate location according to install.conf configuration, and update the database.

Once done lets check whether your playSMS installed and configured properly or not:

playsmsd /etc/playsmsd.conf check

You’ll know its working when you see PIDS are not empty:

Done

Nginx, MySQL and playSMS has been installed and configured, you may try to browse your server and login to playSMS with default username and password:

Username: admin
Password: admin

Leave comments or join discussion at https://forum.playsms.org

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.