How to create SMSPLATFORM server for customer (13 Nov 2019)
Posted by Account Administrator on 29 October 2019 11:20 AM

Description how to create a new Hosted SMS Master for customer <customer_id>.

1. Get Customer ID

Go to -> Customers and get the Customer ID. It will be used in configuration.

2. Setup VM in Google Cloud

2.1 Go to Compute Engine / Images

- Select image "debian-10-buster-v20191014" and click "Create instance".

2.2 Instance Creation

- Set Instance name as smsplatform<customer_id> without spaces, f.e. smsplatform1335
- Select Region (USA or EUROPE) then Zone
- Select Machine type n1-highmem-4
- in Boot disk, click the [Change] button, then increase from 10GB to 50GB the size (at bottom of page) and click [Select] button
- In Firewall check Allow HTTP traffic and Allow HTTPS traffic
- Click link Management to extend menu
-- in Disks section, click [+ Add new disk] and set Name = db, Type = SSD persistent and Size = 100GB, then click [Done]
-- in Networking, in Network tags add following tags one by one: http-server, https-server, sms-platform

you can click [CREATE] button

Wait until VM smsplatform<customer_id> is created

3. Set External IP for smsplatfrom<customer_id>in Google cloud

- Go to  VPC Networking and select External IP adresses
- Change Ephemeral to Static for smsplatform<customer_id> created (you can find it In use by column) and set Name as smsplatfrom<customer_id>
- Click [Reserve]

4. Setup the VM smsplatform<customer_id> from SSH (go to VM instances and click SSH)

4.1 apt repositories: run following commands one by one from prompt

sudo -s

echo "deb [trusted=yes] stretch main" > /etc/apt/sources.list.d/simberry.list
echo "deb [trusted=yes] buster main" > /etc/apt/sources.list.d/upm.list
echo "deb [trusted=yes] stable main" > /etc/apt/sources.list.d/yarn.list
echo "deb [trusted=yes] buster-pgdg main" > /etc/apt/sources.list.d/pgdg.list

apt update && apt upgrade && apt install aptitude

/* Setup disk */
mkfs -t ext4 /dev/sdb

/* Create new folder*/
mkdir /var/lib/postgresql

/* Get UUID for sdb and record for next usage */
ls -l /dev/disk/by-uuid/

root@smsplatform1520:/etc#ls -l /dev/disk/by-uuid/

total 0
lrwxrwxrwx 1 root root 10 Oct 7 14:40 4e6cbef2-05f4-4055-a411-c64243bd967d -> ../../sda1
lrwxrwxrwx 1 root root 11 Oct 7 14:40 C466-93C4 -> ../../sda15
lrwxrwxrwx 1 root root 9 Oct 7 14:47 fc8a9a72-cebe-4d8d-9fe0-f4e3940e5eed -> ../../sdb

/* add new entry in /etc/fstab */
vi /etc/fstab

f.e. UUID=3d205092-dbbe-4076-a13b-aba6456c5ff6 /var/lib/postgresql ext4 rw,discard,errors=remount-ro 0 0

check with
root@smsplatform1520:/etc# more fstab
# /etc/fstab: static file system information
UUID=846a21cd-4034-4054-8c6f-0ef0d0f87557 / ext4 rw,discard,errors=remount-ro 0 0
UUID=A5B1-3693 /boot/efi vfat defaults 0 0
UUID=fc8a9a72-cebe-4d8d-9fe0-f4e3940e5eed /var/lib/postgresql ext4 rw,discard,errors=remount-ro 0 0

mount -a /dev/sdb

/* IMPORTANT, check the /dev/sdb is mounted */

/* just hit ENTER to all question and keep default and/or empty value as is and wait for end of configuration */
aptitude install simberry-smsmaster

echo "host upm upm md5" >> /etc/postgresql/11/main/pg_hba.conf
service postgresql restart

4.2 Set the External IP (if no domain proxy setup required)

 - For mobius: edit file /var/www/mobius/mobius-api/.env and replace ONLY value of EXTERNAL_IP from loopback IP with external IP (last line of file)

4.3 Record the HSR password (from ssh)

- more /etc/upm/config.yml

tools: &tools
type: pgsql
host: localhost
database: upm
user: upm
password: MmHraKlIsWv3


5. Create Hosted SMS Router

IMPORTANT: If Customer has already a SMS Router then you must delete it prior to create the new one

Go to Super SIMBERRY, Hosted SMS Router clcik Add new' HSR and fill in the form as:

Enable the HSR
Name = smsplatform<customer_id>
Router IP = External IP
Host = smsplatform<customer_id>
Database name = upm
Database user = upm
Database Password = recorded password from previous step
Select the customer (as per customer_id)
Set description as sms platform V2 <customer name>
Set Price (per 1000 sms) to 0.8 and others to 0

Click [OK]

6. Set the DNS

From Godaddy add new DNS entries:
- type A for Host smsplatform<customer_id> pointing to External IP
- type A for Host smsplatform<customer_id>-int pointing to Internal IP

 That's it ! the SMS Master should be running under customer account

(1 vote(s))
Not helpful

Comments (0)
Post a new comment
Full Name: