• Home
  • Programming
    • API
      • Google
    • Javascript
    • Php
    • Server
  • CMS
    • Magento
    • Yahoo! Store

FreePBX SMTP voicemail with Gmail

Monday, 12 June 2017 15:45
Tim Ramsey
0 Comments
  1. Add the following lines to /etc/postfix/main.cf file:
    1
    2
    3
    4
    5
    relayhost = [smtp.gmail.com]:587
    smtp_sasl_auth_enable = yes
    smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
    smtp_sasl_security_options = noanonymous
    smtp_use_tls = yes
  2. Create the file /etc/postfix/sasl_passwd with the following contents:
    1
    [smtp.gmail.com]:587 user.name@gmail.com:password
  3. Restrict permissions on the postfix file:
    1
    chmod 400 /etc/postfix/sasl_passwd
  4. Hash the file into a .db that Postfix will read:
    1
    postmap /etc/postfix/sasl_passwd
  5. Change the owner of the sasl_passwd to the postfix user:
    1
    chown postfix /etc/postfix/sasl_passwd
  6. Reload postfix:
    1
    /etc/init.d/postfix reload

EasyApache4 install extension

Thursday, 01 June 2017 01:58
Tim Ramsey
0 Comments
1
yum install -y ea-php54-php-mbstring.x86_64 ea-php55-php-mbstring.x86_64 ea-php56-php-mbstring.x86_64 ea-php70-php-mbstring.x86_64
1
yum install -y ea-php54-php-iconv.x86_64 ea-php55-php-iconv.x86_64 ea-php56-php-iconv.x86_64 ea-php70-php-iconv.x86_64
1
yum install -y ea-php54-php-intl.x86_64 ea-php55-php-intl.x86_64 ea-php56-php-intl.x86_64 ea-php70-php-intl.x86_64
1
yum install -y ea-php54-php-zip.x86_64 ea-php55-php-zip.x86_64 ea-php56-php-zip.x86_64 ea-php70-php-zip.x86_64
1
yum install -y ea-php70-php-fileinfo.x86_64
 

Hex2Bin function

Wednesday, 17 May 2017 18:29
Tim Ramsey
0 Comments
One host I know of refuses to upgrade anything and this is a hex2bin function in case you get :
1
PHP Fatal error:  Call to undefined function:  hex2bin() in
1
2
3
4
5
6
7
8
9
10
if (!function_exists('hex2bin')){
    function hex2bin($h) {
        if (!is_string($h)) return null;
        $r = '';
        for ($a = 0; $a < strlen($h); $a += 2) {
            $r .= chr(hexdec($h{$a}.$h{($a + 1)}));
        }
        return $r;
    }
}
   

Install PostGres 9 on cPanel Server

Tuesday, 02 May 2017 02:08
Tim Ramsey
0 Comments
I currently installed v9.6   1. Add it to repo
1
yum install http://yum.postgresql.org/9.6/redhat/rhel-6-x86_64/pgdg-redhat96-9.6-3.noarch.rpm
2. Install Packages
1
yum install postgresql96-server.x86_64 postgresql96-devel.x86_64 postgresql96.x86_64
3. Add to exclude from yum update – edit /etc/yum.conf
1
2
#add the following to the end of "exclude="
postgresql*
3.a Create symlinks where cPanel Expects to find it
1
2
ln -s /var/lib/pgsql/9.6/data /var/lib/pgsql
ln -s /var/lib/pgsql/9.6/backups /var/lib/pgsql
4. Install postGres in cPanel
1
/scripts/installpostgres
There is more information about back-up/etc here – https://documentation.cpanel.net/display/CKB/Install+or+Update+PostgreSQL+on+Your+cPanel+Server 5. Install symlinks
1
2
cd /usr/pgsql-9.6/bin/; for f in *; do echo $f; [ -e /usr/bin/$f ] && mv /usr/bin/$f /usr/bin/$f.8; ln -s $(pwd)/$f /usr/bin/$f; done
cd /var/lib/pgsql; ln -s 9.6/backups; ln -s 9.6/data; ln -s 9.6/pgstartup.log
6. Initialize and configure to run at startup
1
2
3
service postgresql-9.6 initdb
chkconfig postgresql-9.6 on
/etc/init.d/postgresql-9.6 start
7. Configure in WHM
1
2
3
WHM > Configure PostgreSQL > Install Config
WHM > Configure PostgreSQL > Create Users
WHM > Configure PostgreSQL > Change password (Generate new one)
8. Install/Update phpPgAdmin
1
/usr/local/cpanel/bin/updatephppgadmin
9. Restart
1
/etc/init.d/postgresql-9.6 restart
10. Add to /etc/chkserv.d
1
postgresql:1
11.Restart tailwatchd
1
/scripts/restartsrv_tailwatchd
 

Page 9 of 15

  • Previous
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • Next

Categories

  • CMS
    • Magento
    • Shopify
    • Yahoo! Store
  • Programming
    • API
      • Google
    • Javascript
    • Php
    • Server
    • SVN
  • VOIP

Recent Posts

  • How to write to Google Sheet with API in PHP
  • How to Migrate FreePBX server to a new server
  • Unifi Controller Java CPU 100%
  • Update Unifi Controller on Linux
  • Code Signing Desktop App