download page installation instructions seem incomplete.

Status
Not open for further replies.

qtph

New Member
Oct 30, 2022
26
0
1
If https://www.fusionpbx.com/download still current please add freeswitch credentials instructions and update centos/resources/switch/package-release.sh:

Code:
-yum install -y https://files.freeswitch.org/repo/yum/centos-release/freeswitch-release-repo-0-1.noarch.rpm epel-release
+yum install -y https://$(< /etc/yum/vars/signalwireusername):$(< /etc/yum/vars/signalwiretoken)@files.freeswitch.org/repo/yum/centos-release/freeswitch-release-repo-0-1.noarch.rpm epel-release

probably similar changes for other platforms.
 

cemotyz09

Member
Apr 23, 2020
83
7
8
CentOS isn't the targeted platform, that said it's possible to have it run on CentOS. You can submit pull requests for CentOSm. I've had it running since fusionpbx v4.5 so i can't remember what change I've made but it is possible.
 

qtph

New Member
Oct 30, 2022
26
0
1
I noticed that Ubuntu installation flow is very very different from CentOS installation flow. In particular, freeswitch is complied from sources and does not require registering an account to be able to load freeswitch rpms.
 

cemotyz09

Member
Apr 23, 2020
83
7
8
It used to work, freeswitch suggests using debian so i believe that's what the developer actually test. I'd look at the debian fusionpbx install scripts or check freeswitch documentation how to get the token needed. I know that's at least part of your issue. It states "freeswitch:daemon user not found" so freeswitch isn't installed otherwise you wouldn't have that issue.
 

qtph

New Member
Oct 30, 2022
26
0
1
Freeswitch debian repository is protected by the same token. Ubuntu installer does not use freeswitch packages and needs no access token.
 

hfoster

Active Member
Jan 28, 2019
684
81
28
34
If CentOS isn't the targeted platform I would like to ask why it exists on the page at all...
I have to agree here. Really the only one on the page should be Debian, and then a link to the github to show the 'unsupported' alternative options. FreeSWITCH used to be a lot more open about other platforms and the Fusion side is 'just' PHP so theoretically good for almost any distro.

Debian is using the source at the moment:


Code:
# FreeSWITCH Settings
switch_branch=stable                        # master, stable
switch_source=true                          # true (source compile) or false (binary package)
switch_package=false                        # true (binary package) or false (source compile)
switch_version=1.10.8                       # which source code to download, only for source
switch_tls=true                             # true or false
switch_token=                               # Get the auth token from https://signalwire.com
                                            # Signup or Login -> Profile -> Personal Auth Token
# Sofia-Sip Settings
sofia_version=1.13.8                        # release-version for sofia-sip to use
 

qtph

New Member
Oct 30, 2022
26
0
1
Could anyone tell what needs to be done to bring CentOS up to speed? Its config.sh seems extremely outdated compare do debian one, twice as small.
 

hfoster

Active Member
Jan 28, 2019
684
81
28
34
Meticulously go through the scripts, and duplicate what's there, swapping out CentOS specific alternatives where the packages aren't available, or file locations are slightly different. Mark is updating it, so there is some activity. I'm sure he would be very happy of some pull requests adding in parts that are missing.

It's worth noting, the benefits of CentOS aren't really apparent in FusionPBX. There's no RHEL repos backporting FreeSWITCH bugs, or FusionPBX backporting packages, so you're essentially just using an ancient OS without the ABI stability.
 

cemotyz09

Member
Apr 23, 2020
83
7
8
the config.sh should be able to just be copied from the debian version. I've done that and just changed from source to the package version. It is just variables being listed. I believe the only changes I've made are to postgresql.sh and php.sh to update to the newer versions. I'm using centos 8 though.
 

qtph

New Member
Oct 30, 2022
26
0
1
the config.sh should be able to just be copied from the debian version. I've done that and just changed from source to the package version. It is just variables being listed. I believe the only changes I've made are to postgresql.sh and php.sh to update to the newer versions. I'm using centos 8 though.
Thank you, this is a very helpful suggestion to try. Regarding changes to php.sh and postgresql.sh you can just do git diff on your setup and it should show your changes, shouldn't it?
 
The installation instructions seem to have changed a lot over the past year, and the documentation seems to be only partly updated and thus causing confusion (or is it a freeswitch 'feature' - see the updated updated update on the docs :p). I for one would prefer to install freeswitch from the signalwire packages, can we still do this? Yes there's the token confusion, but once that's sorted it's plain sailing.

Yes, it's nice to compile from the actual source, and the installer is pretty much point and click - but more control over it would be nice, option to install from .debs' and perhaps options for which modules would be installed/compiled. Yes we can go in to the script sources, and edit accordingly but...

Can we still install from packages? What's the best way?

Brings me back to a thread from earlier in the year where the concensus seemed to be that better documentation would increase the usage base. Great to see so much active work on fusion recently though.
 

markjcrane

Active Member
Staff member
Jul 22, 2018
499
177
43
49
The reason I use the compile instead of the package for FreeSWITCH is to prevent having to do the extra steps that the signalwire token requires. How many people will not want to go through the extra effort? I'm guessing a 70 to 80% drop out rate if the token is required. That is why I use the compile currently. Other alternative is to setup our own Repo to detour the requirement of the token to avoid discouraging so many people from installing.

By the way you can add the token its in the resources/config.sh file there you would define the token and tell it to use the package. Also the script is as simple as it can be. A little exploring the files in the install and you would learn a lot.
 
  • Like
Reactions: timerider

qtph

New Member
Oct 30, 2022
26
0
1
Has anyone who managed to install on CentOS like rpm based distributions contributed changes back?
 

cemotyz09

Member
Apr 23, 2020
83
7
8
Thank you, this is a very helpful suggestion to try. Regarding changes to php.sh and postgresql.sh you can just do git diff on your setup and it should show your changes, shouldn't it?
Late i know. I recently had to do a fresh install. I will try this but it was a bit more involved than just php and postgresql script changes.
 

cemotyz09

Member
Apr 23, 2020
83
7
8
Code:
diff --git a/centos/resources/config.sh b/centos/resources/config.sh
index 22da8da..b518759 100755
--- a/centos/resources/config.sh
+++ b/centos/resources/config.sh
@@ -1,19 +1,60 @@

 # FusionPBX Settings
-system_username=admin           # default username admin
-system_password=random          # random or as a pre-set value
-system_branch=master            # master, stable
+domain_name=ip_address                      # hostname, ip_address or a custom value
+system_username=admin                       # default username admin
+system_password=random                      # random or a custom value
+system_branch=master                        # master, stable

 # FreeSWITCH Settings
-switch_branch=stable            # master, stable
-switch_source=false             # true or false
-switch_package=true             # true or false
+switch_branch=stable                        # master, stable
+switch_source=false                          # true (source compile) or false (binary package)
+switch_package=true                        # true (binary package) or false (source compile)
+switch_version=1.10.8                       # which source code to download, only for source
+switch_tls=true                             # true or false
+switch_token=                               # Get the auth token from https://signalwire.com
+                                            # Signup or Login -> Profile -> Personal Auth Token
+# Sofia-Sip Settings
+sofia_version=1.13.8                        # release-version for sofia-sip to use

 # Database Settings
 database_name=fusionpbx                     # Database name (safe characters A-Z, a-z, 0-9)
 database_username=fusionpbx                 # Database username (safe characters A-Z, a-z, 0-9)
 database_password=random                    # random or a custom value (safe characters A-Z, a-z, 0-9)
-database_repo=official                      # PostgreSQL official, system, 2ndquadrant
+database_repo=system                        # PostgreSQL official, system
+database_version=latest                     # requires repo official
 database_host=127.0.0.1                     # hostname or IP address
 database_port=5432                          # port number
 database_backup=false                       # true or false
+
+# General Settings
+php_version=7.4                             # PHP version 7.1, 7.3, 7.4
+letsencrypt_folder=true                     # true or false
diff --git a/centos/resources/nginx/fusionpbx b/centos/resources/nginx/fusionpbx
index 18cf7d2..2a50496 100755
--- a/centos/resources/nginx/fusionpbx
+++ b/centos/resources/nginx/fusionpbx
@@ -2,7 +2,6 @@
 server {
        listen 127.0.0.1:80;
        server_name 127.0.0.1;
-
        access_log /var/log/nginx/access.log;
        error_log /var/log/nginx/error.log;

@@ -15,22 +14,32 @@ server {
        }

        location ~ \.php$ {
-               fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
+               fastcgi_pass unix:/var/run/php-fpm/www.sock;
                #fastcgi_pass 127.0.0.1:9000;
                fastcgi_index index.php;
                include fastcgi_params;
                fastcgi_param   SCRIPT_FILENAME /var/www/fusionpbx$fastcgi_script_name;
        }

-       # Disable viewing .htaccess & .htpassword & .db
+       # Allow the upgrade routines to run longer than normal
+       location = /core/upgrade/index.php {
+               fastcgi_pass unix:/var/run/php-fpm/www.sock;
+               #fastcgi_pass 127.0.0.1:9000;
+               fastcgi_read_timeout 15m;
+               fastcgi_index index.php;
+               include fastcgi_params;
+               fastcgi_param   SCRIPT_FILENAME /var/www/fusionpbx$fastcgi_script_name;
+       }
+
+       # Disable viewing .htaccess & .htpassword & .db & .git
        location ~ .htaccess {
-                       deny all;
+               deny all;
        }
        location ~ .htpassword {
-                       deny all;
+               deny all;
        }
        location ~^.+.(db)$ {
-                       deny all;
+               deny all;
        }
        location ~ /\.git {
                deny all;
@@ -44,10 +53,18 @@ server {
 }

 server {
-       listen 80;
+       listen [::]:80;
        server_name fusionpbx;

-       if ($uri !~* ^.*(provision|xml_cdr).*$) {
+       #redirect letsencrypt to dehydrated
+       location ^~ /.well-known/acme-challenge {
+               default_type "text/plain";
+               auth_basic "off";
+               alias /var/www/dehydrated;
+       }
+
+       #rewrite rule - send to https with an exception for provisioning
+       if ($uri !~* ^.*(provision|xml_cdr|firmware).*$) {
                rewrite ^(.*) https://$host$1 permanent;
                break;
        }
@@ -59,7 +76,7 @@ server {
        }

        #algo
-       rewrite "^.*/provision/algom([A-Fa-f0-9]{12})(\.(conf))?$" /app/provision/?mac=$1;
+       rewrite "^.*/provision/algom([A-Fa-f0-9]{12})\.conf" /app/provision/?mac=$1&file=algom%7b%24mac%7d.conf last;

        #mitel
        rewrite "^.*/provision/MN_([A-Fa-f0-9]{12})\.cfg" /app/provision/index.php?mac=$1&file=MN_%7b%24mac%7d.cfg last;
@@ -67,7 +84,8 @@ server {

        #grandstream
        rewrite "^.*/provision/cfg([A-Fa-f0-9]{12})(\.(xml|cfg))?$" /app/provision/?mac=$1;
-       rewrite "^.*/provision/pb([A-Fa-f0-9-]{12,17})/phonebook\.xml$" /app/provision/?mac=$1&file=phonebook.xml;
+       rewrite "^.*/provision/([A-Fa-f0-9]{12})/phonebook\.xml$" /app/provision/?mac=$1&file=phonebook.xml;
+       rewrite "^.*/provision/(phonebook\.xml)?$" /app/provision/index.php?file=$1 last;
        #grandstream-wave softphone by ext because Android doesn't pass MAC.
        rewrite "^.*/provision/([0-9]{5})/cfg([A-Fa-f0-9]{12}).xml$" /app/provision/?ext=$1;

@@ -75,10 +93,9 @@ server {
        rewrite "^.*/provision/aastra.cfg$" /app/provision/?mac=$1&file=aastra.cfg;
        #rewrite "^.*/provision/([A-Fa-f0-9]{12})(\.(cfg))?$" /app/provision/?mac=$1 last;

-       #yealink common
+       #yealink
+       #rewrite "^.*/provision/(y[0-9]{12})(\.cfg|\.boot)?$" /app/provision/index.php?file=$1$2;
        rewrite "^.*/provision/(y[0-9]{12})(\.cfg)?$" /app/provision/index.php?file=$1.cfg;
-
-       #yealink mac
        rewrite "^.*/provision/([A-Fa-f0-9]{12})(\.(xml|cfg))?$" /app/provision/index.php?mac=$1 last;

        #polycom
@@ -92,6 +109,7 @@ server {

        #cisco
        rewrite "^.*/provision/file/(.*\.(xml|cfg))" /app/provision/?file=$1 last;
+       rewrite "^.*/provision/directory\.xml$" /app/provision/?file=directory.xml;

        #Escene
        rewrite "^.*/provision/([0-9]{1,11})_Extern.xml$"       "/app/provision/?ext=$1&file={%24mac}_extern.xml" last;
@@ -105,6 +123,9 @@ server {
        rewrite "^.*/provision/([A-Fa-f0-9]{12})-contacts\.cfg$" "/app/provision/?mac=$1&file={%24mac}-contacts.cfg";
        rewrite "^.*/provision/([A-Fa-f0-9]{12})-smartblf\.cfg$" "/app/provision/?mac=$1&file={%24mac}-smartblf.cfg";

+       #Snom
+       rewrite "^.*/provision/-([A-Fa-f0-9]{12})?$" /app/provision/index.php?mac=$1;
+
        access_log /var/log/nginx/access.log;
        error_log /var/log/nginx/error.log;

@@ -117,14 +138,25 @@ server {
        }

        location ~ \.php$ {
-               fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
+               fastcgi_pass unix:/var/run/php-fpm/www.sock;
                #fastcgi_pass 127.0.0.1:9000;
+               fastcgi_read_timeout 15m;
+               fastcgi_index index.php;
+               include fastcgi_params;
+               fastcgi_param   SCRIPT_FILENAME /var/www/fusionpbx$fastcgi_script_name;
+       }
+
+       # Allow the upgrade routines to run longer than normal
+       location = /core/upgrade/index.php {
+               fastcgi_pass unix:/var/run/php-fpm/www.sock;
+               #fastcgi_pass 127.0.0.1:9000;
+               fastcgi_read_timeout 15m;
                fastcgi_index index.php;
                include fastcgi_params;
                fastcgi_param   SCRIPT_FILENAME /var/www/fusionpbx$fastcgi_script_name;
        }

-       # Disable viewing .htaccess & .htpassword & .db
+       # Disable viewing .htaccess & .htpassword & .db & .git
        location ~ .htaccess {
                deny all;
        }
@@ -147,13 +179,24 @@ server {

 server {
        listen 443 ssl;
+       #listen 443 ssl http2;
        server_name fusionpbx;

-       #ssl                     on;
-       ssl_certificate         /etc/ssl/certs/nginx.crt;
-       ssl_certificate_key     /etc/ssl/private/nginx.key;
-       ssl_protocols           TLSv1 TLSv1.1 TLSv1.2;
-       ssl_ciphers             HIGH:!ADH:!MD5:!aNULL;
+       ssl_certificate /etc/dehydrated/certs/my.domain.com/fullchain.pem;
+       ssl_certificate_key /etc/dehydrated/certs/my.domain.com/privkey.pem;
+       #ssl_protocols           TLSv1.2 TLSv1.3;
+       ssl_protocols           TLSv1 TLSv1.1 TLSv1.2 TLSv1.3;
+       ssl_ciphers             DHE-RSA-AES256-SHA:AES256-SHA:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305HE-RSA-AES128-GCM-SHA256HE-RSA-AES256-GCM-SHA384;
+       ssl_session_cache       shared:SSL:40m;
+       ssl_session_timeout     2h;
+       ssl_session_tickets     off;
+
+       #redirect letsencrypt to dehydrated
+       location ^~ /.well-known/acme-challenge {
+               default_type "text/plain";
+               auth_basic "off";
+               alias /var/www/dehydrated;
+       }

        #REST api
        if ($uri ~* ^.*/api/.*$) {
@@ -165,7 +208,7 @@ server {
        rewrite "^/app/messages/media/(.*)/(.*)" /app/messages/message_media.php?id=$1&action=download last;

        #algo
-       rewrite "^.*/provision/algom([A-Fa-f0-9]{12})(\.(conf))?$" /app/provision/?mac=$1;
+       rewrite "^.*/provision/algom([A-Fa-f0-9]{12})\.conf" /app/provision/?mac=$1&file=algom%7b%24mac%7d.conf last;

        #mitel
        rewrite "^.*/provision/MN_([A-Fa-f0-9]{12})\.cfg" /app/provision/index.php?mac=$1&file=MN_%7b%24mac%7d.cfg last;
@@ -173,7 +216,8 @@ server {

        #grandstream
        rewrite "^.*/provision/cfg([A-Fa-f0-9]{12})(\.(xml|cfg))?$" /app/provision/?mac=$1;
-       rewrite "^.*/provision/pb([A-Fa-f0-9-]{12,17})/phonebook\.xml$" /app/provision/?mac=$1&file=phonebook.xml;
+       rewrite "^.*/provision/([A-Fa-f0-9]{12})/phonebook\.xml$" /app/provision/?mac=$1&file=phonebook.xml;
+       rewrite "^.*/provision/(phonebook\.xml)?$" /app/provision/index.php?file=$1 last;
        #grandstream-wave softphone by ext because Android doesn't pass MAC.
        rewrite "^.*/provision/([0-9]{5})/cfg([A-Fa-f0-9]{12}).xml$" /app/provision/?ext=$1;

@@ -181,10 +225,9 @@ server {
        rewrite "^.*/provision/aastra.cfg$" /app/provision/?mac=$1&file=aastra.cfg;
        #rewrite "^.*/provision/([A-Fa-f0-9]{12})(\.(cfg))?$" /app/provision/?mac=$1 last;

-       #yealink common
+       #yealink
+       #rewrite "^.*/provision/(y[0-9]{12})(\.cfg|\.boot)?$" /app/provision/index.php?file=$1$2;
        rewrite "^.*/provision/(y[0-9]{12})(\.cfg)?$" /app/provision/index.php?file=$1.cfg;
-
-       #yealink mac
        rewrite "^.*/provision/([A-Fa-f0-9]{12})(\.(xml|cfg))?$" /app/provision/index.php?mac=$1 last;

        #polycom
@@ -198,6 +241,7 @@ server {

        #cisco
        rewrite "^.*/provision/file/(.*\.(xml|cfg))" /app/provision/?file=$1 last;
+       rewrite "^.*/provision/directory\.xml$" /app/provision/?file=directory.xml;

        #Escene
        rewrite "^.*/provision/([0-9]{1,11})_Extern.xml$"       "/app/provision/?ext=$1&file={%24mac}_extern.xml" last;
@@ -221,10 +265,17 @@ server {
                root /var/www/fusionpbx;
                index index.php;
        }
+       location /vc {
+               root /var/www/html/;
+               index index.html;
+               access_log /var/log/nginx/verto-access.log;
+               error_log /var/log/nginx/verto-error.log;
+       }

        location ~ \.php$ {
-               fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
+               fastcgi_pass unix:/var/run/php-fpm/www.sock;
                #fastcgi_pass 127.0.0.1:9000;
+               fastcgi_read_timeout 15m;
                fastcgi_index index.php;
                include fastcgi_params;
                fastcgi_param   SCRIPT_FILENAME /var/www/fusionpbx$fastcgi_script_name;
@@ -232,15 +283,15 @@ server {

        # Allow the upgrade routines to run longer than normal
        location = /core/upgrade/index.php {
-               fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
+               fastcgi_pass unix:/var/run/php-fpm/www.sock;
                #fastcgi_pass 127.0.0.1:9000;
+               fastcgi_read_timeout 15m;
                fastcgi_index index.php;
                include fastcgi_params;
                fastcgi_param   SCRIPT_FILENAME /var/www/fusionpbx$fastcgi_script_name;
-               fastcgi_read_timeout 15m;
        }

-       # Disable viewing .htaccess & .htpassword & .db
+       # Disable viewing .htaccess & .htpassword & .db & .git
        location ~ .htaccess {
                deny all;
        }
diff --git a/centos/resources/php.sh b/centos/resources/php.sh
index 55261d5..92c932a 100755
--- a/centos/resources/php.sh
+++ b/centos/resources/php.sh
@@ -11,12 +11,14 @@ cd "$(dirname "$0")"
 verbose "Install PHP and PHP-FPM"

 #set the version of php
-#yum-config-manager --enable remi-php70
-#yum-config-manager --enable remi-php71
-yum-config-manager --enable remi-php72
+#dnf-config-manager --enable remi-php70
+#dnf-config-manager --enable remi-php71
+#dnf-config-manager --enable remi-php72
+dnf module reset php
+dnf module install php:remi-7.4

 #install dependencies
-yum -y install php-fpm php-gd php-pgsql php-odbc php-curl php-imap php-opcache php-common php-pdo php-soap php-xml php-xmlrpc php-cli php-gd
+dnf -y install php-fpm php-gd php-pgsql php-odbc php-curl php-imap php-opcache php-common php-pdo php-soap php-xml php-xmlrpc php-cli php-gd

 #send a message
 verbose "Configuring php/nginx/php-fpm and permissions"
diff --git a/centos/resources/postgresql.sh b/centos/resources/postgresql.sh
index cd26af6..633805d 100755
--- a/centos/resources/postgresql.sh
+++ b/centos/resources/postgresql.sh
@@ -14,10 +14,11 @@ verbose "Installing PostgreSQL"
 password=$(dd if=/dev/urandom bs=1 count=20 2>/dev/null | base64)

 # Install the repository
-sudo yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
+sudo dnf install -y https://download.postgresql.org/pub/repos/dnf/reporpms/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm
+sudo dnf -qy module disable postgresql

 # Install PostgreSQL:
-sudo yum install -y postgresql14-server postgresql14-contrib postgresql14 postgresql14-libs
+sudo dnf install -y postgresql14-server postgresql14-contrib postgresql14 postgresql14-libs

 #send a message
 verbose "Initalize PostgreSQL database"
diff --git a/centos/resources/switch/package-release.sh b/centos/resources/switch/package-release.sh
index 99d09c0..cf0d7d1 100755
--- a/centos/resources/switch/package-release.sh
+++ b/centos/resources/switch/package-release.sh
@@ -14,7 +14,7 @@ verbose "Installing FreeSWITCH"
 yum -y install memcached curl gdb

 #install freeswitch packages
-yum install -y https://files.freeswitch.org/repo/yum/centos-release/freeswitch-release-repo-0-1.noarch.rpm epel-release
+yum install -y https://$(< /etc/yum/vars/signalwireusername):$(< /etc/yum/vars/signalwiretoken)@freeswitch.signalwire.com/repo/yum/centos-release/freeswitch-release-repo-0-1.noarch.rpm epel-release
 yum install -y freeswitch freeswitch-lang-* freeswitch-sounds-* freeswitch-lua freeswitch-xml-cdr

 #remove the music package to protect music on hold from package updates
 

cemotyz09

Member
Apr 23, 2020
83
7
8
for the config.sh I copied it from the debian and changed it to package, for the nginx file I copied it from debian and made the changes to the php location. postgresql.sh and php.sh needed to change to the centos8 way of removing the original versions and using the ones supplied by the remi repo. package-release had to be updated for the token, also freeswitch-vanilla doesn't seem to exist in the current repo for centos8.
 

markjcrane

Active Member
Staff member
Jul 22, 2018
499
177
43
49
for the config.sh I copied it from the debian and changed it to package, for the nginx file I copied it from debian and made the changes to the php location. postgresql.sh and php.sh needed to change to the centos8 way of removing the original versions and using the ones supplied by the remi repo. package-release had to be updated for the token, also freeswitch-vanilla doesn't seem to exist in the current repo for centos8.

Consider sending a pull request.
 
Status
Not open for further replies.