EDIT:
This article is old. Please use playSMS version 1.4.3 instead. Previous version of playSMS contains security vulnerabilities and have been fixed in 1.4.3.
Same method described in this article can still be used to install playSMS 1.4.3, you just need to change 1.4.2 to 1.4.3.
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 🙂
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:
[code lang=text]
apt update && apt -y upgrade
[/code]
Wait until the upgrade finished. It should take a few minutes only.
Install required Linux packages:
[code lang=text]
apt -y install nginx mysql-server php-fpm php-cli php-mysql php-gd php-imap php-curl php-xml php-mbstring
[/code]
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:
[code lang=text]
mkdir -p /home/vhosts/my.textng.com/html
mkdir -p /home/vhosts/my.textng.com/logs
[/code]
Setup Nginx to enable my.textng.com site:
[code lang=text]
cd /etc/nginx/sites-available
nano my.textng.com.conf
[/code]
Copy this to my.textng.com.conf
and save it:
[code lang=text]
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;
}
}
[/code]
Enable my.textng.com:
[code lang=text]
cd /etc/nginx/sites-enabled
ln -s ../sites-available/my.textng.com.conf .
[/code]
Restart Nginx:
[code lang=text]
systemctl restart nginx
[/code]
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:
[code lang=text]
mysqladmin create playsms
[/code]
Add new MySQL user called playsms
and set it to manage playSMS database. Login to MySQL server from CLI:
[code lang=text]
mysql
[/code]
From inside MySQL shell:
[code lang=text]
CREATE USER 'playsms'@'localhost' IDENTIFIED BY 'changethislater';
GRANT ALL PRIVILEGES ON playsms.* TO 'playsms'@'localhost' WITH GRANT OPTION;
FLUSH PRIVILEGES;
quit
[/code]
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:
[code lang=text]
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
[/code]
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"
Here is how it looks like:
Save the file and ready to install playSMS using provided install script.
Run the install script:
[code lang=text]
./install-playsms.sh
[/code]
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:
[code lang=text]
playsmsd /etc/playsmsd.conf check
[/code]
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
Nice tutorial.
I could not come to a default page to browse the server and login to playSMS with default username and password. Instead it shows default php code
<?php
/**
* This file is part of playSMS.
…..
…..