SMSTOOLS3 PLAYSMS UBUNTU 18.04
Hello There, again this is me, last time we trying to config some SMSGATEWAY and WEB SERVICE for that and…. failed i dont knows where is the problem even i tripled check log, maybe because my lack of knowledge, before that what im failed is SMSGATEWAY GAMMU and PLAYSMS, BTW Playsms is very easy to install and config, then i choose smstools3 to become my smsgateway, this is also super easy you know okay every part from my diary there is my environment
Im using Modem Wavecom 1306B
Ubuntu 18.04
-Mariadb-server
-Apache2
-Php7.2
Okay Let’s Start
First we install and config Playsms, why Playsms first? because its easy!!!
This is my refference https://blog.dgprasetya.com/gammu-install-configure-playsms/ and https://playsms.org/2020/03/20/install-playsms-1-4-3-on-ubuntu-18-04/
okay first im asuming this is fresh install ubuntu 18.04
lets start install!!
Web Server
#install apache2
sudo apt-get install apache2
#install php7.2
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt install php7.2 php7.2-cli php7.2-mysql php7.2-gd php7.2-curl php7.2-mbstring php7.2-xml php7.2-zip
#install database mariadb
sudo apt-get install mariadb-server
#configure it
sudo mysql_secure_installation
#make password if above step doesnt work
sudo mysql -u root
SELECT User,Host FROM mysql.user;
DROP USER 'root'@'localhost';
CREATE USER 'root'@'%' IDENTIFIED BY '123456';
#Give permissions to your user (don’t forget to flush privileges)
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION;
FLUSH PRIVILEGES;
quit;
#now user mariadb root has password '123456'
This is excited part we install Playsms Hooray
#Download playsms new version, dont use too old version
cd ~/Downloads
wget -c "https://github.com/antonraharja/playSMS/archive/master.zip" && unzip master.zip
#We've Downloaded playsms 1.4.4alpha
cd playSMS-master/;
cp install.conf.dist install.conf;
#edit install.conf so it looks like this or change with what you need
nano install.conf
# INSTALL DATA
# ============
# Please change INSTALL DATA below to suit your system configurations
# Please do not change variable name, you may change only the value
# MySQL database username
DBUSER=”root”
# MySQL database password
DBPASS=”123456"
# MySQL database name
DBNAME=”playsms”
# MySQL database host
DBHOST=”localhost”
# MySQL database port
DBPORT=”3306"
# Web server’s user, for example apache2 user by default is www-data
# note: please make sure your web server user
WEBSERVERUSER=”www-data”
# Web server’s group, for example apache2 group by default is www-data
# note: please make sure your web server group
WEBSERVERGROUP=”www-data”
# Path to playSMS extracted source files
PATHSRC=”$(pwd)”
# Path to playSMS web files
# note: please make sure your web root path, in this example its /var/www/html
PATHWEB=”/var/www/html/playsms”
# Path to playSMS additional files
PATHLIB=”/var/lib/playsms”
# Path to playSMS daemon and other binary files
PATHBIN=”/usr/local/bin”
# Path to playSMS log files
PATHLOG=”/var/log/playsms”
# Path to playSMS storage
PATHSTR=”/var/storage/playsms”
# Path to playSMS daemon configuration file
# note: this example will create playsmsd.conf in /etc
PATHCONF=”/etc”
# END OF INSTALL DATA
# ===================then install Playsms
sudo ./install-playsms.sh
#why we used sudo? because there is some privileged action needed, like make file in root folder.
#right after install change config.php in
sudo nano /var/www/playsms/config.php
#Search for ishttps and set it to false.
#because we use it in local development, if you use true it will turn to https, and not gonna work unless you use hosting and give it ssl
#start playsms service
playsmsd /etc/playsmsd.conf start
#Or Check whether start or not
playsmsd /etc/playsmsd.conf check
#then go to your localhost/playsms/index.php
#Default Login
user = admin
password=changemeplease
#ahh because we install it in development phase use 755 or 775 or 777 for /var so that playsms can acces the folder
Next we will be installed smsgateway SMSTOOLS3
from this refference https://github.com/playsms/book-playsms/blob/master/book-contents/en/Installation/Gateway-Installation/SMS-Server-Tools-3/SMS-Server-Tools-3-installation-from-source-on-Ubuntu.md
#We Are Gonna Be SUUUPEER UUSERRR!!
sudo su -
#Install required packages for building SMS Server Tools 3 from source in Ubuntu
apt-get install build-essential
#Get source package and extract it, iam download it from the web source
# from http://smstools3.kekekasvi.com and save it in /usr/local/src
cd /usr/local/src
#if you've download source move or paste to thar directory
#untar it
tar -zxvf .....
#Enter the extracted source codes directory and execute make to #compile followed by installing smstools3
cd smstools3
make
make install
mkdir -p /var/log/sms/stats
mkdir -p /var/spool/sms/{checked,failed,incoming,outgoing,sent,modem1,modem2}
#You can also set files and folders permission to world-writable
chmod 777 -R /var/spool/sms
or
chown www-data:www-data -R /var/spool/sms
-----------------------------------------
mv /etc/smsd.conf /etc/smsd.conf.dist
wget -c https://raw.githubusercontent.com/antonraharja/playSMS/master/contrib/smstools/smsd.conf
cp smsd.conf /etc/
#please check smsd.conf and adapt it with you environment
#in my case im using modem1 and mr anton has provide it with configuration for Wavecom modem so i didnt change anything in smsd.conf
#start smstools3/etc/init.d/sms3 start
Important:
- Modem name must be the same as SMSC name in playSMS
- Verify if SMS Server Tools 3 is running
tail -f /var/log/smsd.log
ps ax | grep -v grep | grep smsd
Finish installing aftera this we just configure playsms to use plugin smstools. configure it in smsc and gateway, okay thats all i’ll update with screenshot in gateway and smsc next time, see you