3cx on google "always free" tier?

Discussion in '3CX Phone System - General' started by gulib, Aug 3, 2017.

Thread Status:
Not open for further replies.
  1. gulib

    Joined:
    Aug 3, 2017
    Messages:
    24
    Likes Received:
    2
    I've seen the 3cx PiaF implementation on google free trial, but that one requires a larger cpu than what is offered in the always free tier. Is it possible to somehow reduce the footprint by removing services that I wont use?
    Google's Always Free (available since March 2017) has the following specs
    • 1 f1-micro instance per month (US regions only, excluding Northern Virginia)
    • 30 GB-months HDD, 5 GB-months snapshot
    • 1 GB network egress from North America to all region destinations per month (excluding China and Australia)
    I like to play with the PBX but barely use it for anything useful...maybe 20-60 minutes per month of calls and less than a 1 in 100 chance of 2 simultaneous calls happening.

    Is this possible?
    thanks,
    -gulib
     
    StefanW likes this.
  2. gulib

    Joined:
    Aug 3, 2017
    Messages:
    24
    Likes Received:
    2
    so not possible I take it?
    -gulib
     
  3. cobaltit

    cobaltit Active Member

    Joined:
    Mar 22, 2012
    Messages:
    734
    Likes Received:
    112
    It's a free tier so try it. That's the whole point of the free tier to be able to try things for free.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. gulib

    Joined:
    Aug 3, 2017
    Messages:
    24
    Likes Received:
    2
    I tried, and the first thing that fails is that it can't run the linux distribution recommended on the 3cx on free TRIAL. This I why I asked if there is anything that can be done to reduce the size of the installation.
    gulib
     
  5. cobaltit

    cobaltit Active Member

    Joined:
    Mar 22, 2012
    Messages:
    734
    Likes Received:
    112
    Are you saying that it can't run the 3CX created ISO or vanilla Debian?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. StefanW

    StefanW Head of Customer Support and Training
    Staff Member 3CX Support

    Joined:
    Jun 2, 2009
    Messages:
    1,199
    Likes Received:
    79
    personal I love seeing that the prices come down in the cloud market and bringing it closer to everybody's reach.

    Just checked in my gcloud portal and on some of the locations it is already available
    (Your first 744 hours of f1-micro instance usage are free this month. <-- which are more then the h per month)
    https://cloud.google.com/free/docs/...=1.141623984.384303809.1495028034#always-free

    If you just like playing with the 3CX system then go for it on the micro instance. For productive use this VM is to small! The mem. is to small and linux intend to kill services when it runs out of RAM (management console service (includes presence information) is our biggest eater). Saving on the food print is something we are working on but been said, we are already quite low...

    Just ensure you install on debian 8 and not default 9 and run the apt-get commands as outlined here:
    https://www.3cx.com/docs/manual/installation-linux/#h.ouj85lkkv33m

    I tried and the offer was not void when selecting "Debian GNU/Linux 8 (jessie)" as image... If you like to use Debian 9 check here:
    https://www.3cx.com/blog/docs/linux-version-9-stretch/
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  7. gulib

    Joined:
    Aug 3, 2017
    Messages:
    24
    Likes Received:
    2
    Hi StefanW,

    thanks for testing that. I went back and realized it was me misunderstanding the allowed Persistent Disk Space. Once I increased the size I was able to install.
    Having said that...I have installed and resinstalled, deleted and recreated several instances but have not yet been able to even see the 3CX control center.

    I have been trying to follow the instructions provided here
    https://www.3cx.com/blog/voip-howto/google-compute-engine-part-1/
    https://www.3cx.com/blog/voip-howto/google-compute-engine-part-2/

    so here is how its going. First of all, there are several mistakes on those articles, double hyphens '--' have been replaced by em dashes (long dashes) '—'.
    also single and double quotes have been replaced by curly single and double quotes.... so if you copy paste commands from those articles things don't work.

    I created the micro instances, and ran the fixed up commands. I am not very good with linux so I will give you a few details of what I did in case I broke something obvious.

    Every single time I had a (Y/n) option I chose "Y".
    After installing the iptables-persistent it asked if I wanted to save ip4 and ip6 files, I tried both yes and no in different install attempts.


    the clean and working commands are the following:
    -------------
    sudo su -
    apt update
    apt upgrade

    apt-get install tcpdump

    wget -O- http://downloads.3cx.com/downloads/3cxpbx/public.key | apt-key add -
    echo "deb http://downloads.3cx.com/downloads/3cxpbx/ /" | tee /etc/apt/sources.list.d/3cxpbx.list
    apt update
    apt-get install -y $(apt-cache depends 3cxpbx | grep Depends | sed "s/.*ends:\ //" | tr '\n' ' ')

    apt-get install iptables-persistent
    iptables -A INPUT -p tcp --dport 80 -j ACCEPT
    iptables -A INPUT -p tcp --dport 443 -j ACCEPT
    iptables -A INPUT -p tcp --dport 5015 -j ACCEPT
    iptables -A INPUT -p tcp --dport 5090 -j ACCEPT
    iptables -A INPUT -p udp --dport 5090 -j ACCEPT
    iptables -A INPUT -p tcp --dport 5060:5061 -j ACCEPT
    iptables -A INPUT -p udp --dport 5060 -j ACCEPT
    iptables -A INPUT -p udp --dport 9000:9500 -j ACCEPT
    iptables-save >/etc/iptables/rules.v4

    shutdown -r now

    sudo apt-get install 3cxpbx
    -------------
    at this point supposedly i would have been able to login to the web config with my google provided external ip and port 5015....but the browser would just say "connecting". I also tried port 80 with http and https. It was as if nginx wasnt even running.

    after running the command
    /usr/sbin/3CXWizard —cleanup
    and choosing text based setup I was able to go through the whole thing. Creating the FQDN with Lets Encrypt took several attempts as it would repeatedly give me error 400. Eventually it worked.

    So now I am at the following point. http port 80 works fine and I get the NGINX welcome message, but the 5000, 5001 (recommended on the text install) and the 5015 ports don't work at all neither http nor https. Browser is just stuck on connecting.

    I checked processes, at least what made sense to me and got these
    ------
    root@cloud3cx:/usr/sbin# ps -A | grep 3CX
    359 ? 00:00:01 3CXMediaServer
    360 ? 00:00:24 3CXTunnel
    522 ? 00:00:03 3CXSLDBServ
    555 ? 00:00:22 3CXPhoneSystem
    557 ? 00:00:11 3CXAudioProvide
    660 ? 00:00:25 3CXIVR
    root@cloud3cx:/usr/sbin# ps -A | grep nginx
    456 ? 00:00:00 nginx
    457 ? 00:00:00 nginx
    458 ? 00:00:00 nginx
    459 ? 00:00:00 nginx
    460 ? 00:00:00 nginx
    ----

    I also checked iptables

    root@cloud3cx:~# iptables -S
    -P INPUT ACCEPT
    -P FORWARD ACCEPT
    -P OUTPUT ACCEPT
    -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
    -A INPUT -p tcp -m tcp --dport 443 -j ACCEPT
    -A INPUT -p tcp -m tcp --dport 5015 -j ACCEPT
    -A INPUT -p tcp -m tcp --dport 5090 -j ACCEPT
    -A INPUT -p udp -m udp --dport 5090 -j ACCEPT
    -A INPUT -p tcp -m tcp --dport 5060:5061 -j ACCEPT
    -A INPUT -p udp -m udp --dport 5060 -j ACCEPT
    -A INPUT -p udp -m udp --dport 9000:9500 -j ACCEPT
    -A INPUT -p tcp -m multiport --dports 5000,5015 -m tcp --tcp-flags FIN,SYN,RST,ACK SYN -m conntrack --ctstate NEW -j ACCEPT
    -----
    and finally I checked what sites nginx was running

    root@cloud3cx:~# find /etc/nginx/sites-enabled/ -type f -print0 | xargs -0 egrep '^(\s|\t)*server_name'
    root@cloud3cx:~# grep server_name /etc/nginx/sites-enabled/* -RiI
    /etc/nginx/sites-enabled/3cxpbx: server_name xxxyyyzzz.3cx.pl;
    /etc/nginx/sites-enabled/3cxpbx: server_name xxxyyyzzz.3cx.pl;
    /etc/nginx/sites-enabled/default: server_name _;
    /etc/nginx/sites-enabled/default:# server_name example.com;
    -----------

    both, using the IP and using the 3cx FQDN, I can reach http://:80
    I cannot reach https nor any 3CX page.
    this, i think, tells me the google cloud part of the installation seems to be correct. the server is accessible from outside.
    So now I need to find out why nginx is not answering on the 5015 port so that I can start configuring. 3CX services seem to be up.
    I have rebooted the server several times.
    I did several installs today aug 8, 2017, so the versions installed are whatever the apt get commands downloaded now according to the commands provided above on debian 8.



    so thats where I stand.....any ideas, suggestions, experiments I can try?
    thanks in advance for any help you can provide.
    gulib
     
  8. craigreilly

    craigreilly Well-Known Member

    Joined:
    Feb 1, 2012
    Messages:
    2,962
    Likes Received:
    180
    so I get this several times:
    can't read /var/lib/3cxpbx/Bin/nginx/conf/nginx.conf: No such file or directory

    when running the "install 3cxpbx"
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  9. gulib

    Joined:
    Aug 3, 2017
    Messages:
    24
    Likes Received:
    2
    are you trying to run the cleaned up code i included? or what exactly are you referring to?
    I was able to run all the commands with no errors yet my system is not working. This
    is what I need help with.

    as far as your error...try running this....reboot and then the install command
     
  10. gulib

    Joined:
    Aug 3, 2017
    Messages:
    24
    Likes Received:
    2
    Thank you! Thats what it was, I copied the instructions from the iptables instructions and it seems to be working correctly.
    I added this rule:
    ----------
    name:3cx
    Network: default
    Priority: 1000
    Direction: Ingress
    Action on match: Allow
    Source filters
    IP ranges: 0.0.0.0/0
    Protocols and ports

    tcp:5015
    tcp:5090
    udp:5090
    tcp:5060-5061
    udp:5060
    udp:9000-9500
    tcp:5000
    Equivalent REST
    ----------

    It works, I have been able to make calls. Hopefully I didnt punch a huge security hole into the machine.

    thank you,
    gulib

     
Thread Status:
Not open for further replies.