Knowledgebase
Deploying Shortlink Proxy Server on Alibaba
Posted by Account Administrator on 23 October 2019 03:36 PM

 

  1. Log into Alibaba cloud at https://home-intl.console.aliyun.com/.
    Username/password given by customer

  2. Navigate to [=] -> Products -> Elastic computing -> Simple Application Server

  3. Click “Create Server” and select
    Region = China (Hong Kong)
    OS Image = Debian 8.9
    Instance plan = $3.4/mo (or whatever is the cheapest)
    Click “Buy now”

  4. After the server is provisioned, click its panel.
    You should see the server management page.
    Click “Connect” on the left, then click “Connect” button.
    You will get a terminal window:

    Welcome to Alibaba Cloud Elastic Compute Service !

    You have mail.
    Last login: Wed Oct 23 15:25:08 2019 from 47.89.61.137
    admin@iZj6c24msyh0q6ggkaq970Z:~$

  5. Type “sudo -s” to become root:

    admin@iZj6c24msyh0q6ggkaq970Z:~$ sudo -s
    sudo: unable to resolve host iZj6c24msyh0q6ggkaq970Z
    root@iZj6c24msyh0q6ggkaq970Z:/home/admin# 

  6. Install nginx by executing the following command: apt install nginx
    It is fails with package not found then update apt: apt update
    and run again command: apt install nginx

  7. In the text below, change <smsplatorfm IP> with the IP address from the SMS Master (smsplatform VM) instance:

    server {

     listen 80 default_server;

            server_name _;

            error_log /var/log/nginx/shortlink.error.log;

            access_log /var/log/nginx/shortlink.access.log;

            location / {

                    proxy_pass http://<smsplatorfm IP>:4598;

                    proxy_http_version 1.1;

                    proxy_set_header Upgrade $http_upgrade;

                    proxy_set_header Connection 'upgrade';

                    proxy_set_header Host $host;

                    proxy_cache_bypass $http_upgrade;

            }

    }

  8. Copy the above text, then from terminal window type: cat > /etc/nginx/sites-enabled/default, paste the text and press Ctrl-D
    double check the file (in the example below the IP set is 35.197.120.7:

    admin@iZj6c24msyh0q6ggkaq970Z:~$ cat /etc/nginx/sites-enabled/default
    server {
    listen 80 default_server;
    server_name _;

    error_log /var/log/nginx/shortlink.error.log;
    access_log /var/log/nginx/shortlink.access.log;

    location / {
    proxy_pass http://35.197.120.7:4598;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection 'upgrade';
    proxy_set_header Host $host;
    proxy_cache_bypass $http_upgrade;
    }
    }
    admin@iZj6c24msyh0q6ggkaq970Z:~$

     

  9. Execute “service nginx restart”. The console window should look like this:

    admin@iZj6c24msyh0q6ggkaq970Z:~$service nginx restart
    admin@iZj6c24msyh0q6ggkaq970Z:~$

  10. At the bottom of the terminal window you should see [ Debian    Publi IP: <IP of Server> ]
    Record the public for next step

  11. From SIMBERRY Google Cloud, open a terminal session to the smsplatform VM:
    Type “sudo -s” to become root
    Edit file “/var/www/mobius/mobius-api/.env” (mcedit, vi, ...)
    Go to last line, bottom of the file and set EXTERNAL_IP=<Publi IP shortlink proxy server>
    Save and quit.

  12. You are done ! No need of restarting any of the 2 servers


(0 vote(s))
Helpful
Not helpful

Comments (0)
Post a new comment
 
 
Full Name:
Email:
Comments: