No PGP for Horde Mail in Plesk

When checking mail, I noticed the PGP option was not available. It should look like this:

So, I followed this:
https://support.plesk.com/hc/en-us/articles/115002313594-How-to-install-GnuPG-PHP-extension-for-Plesk-PHP-

But still missing.

https://www.poftut.com/install-use-gpg-encrytion-linux-order-encrypt-decrypt-files-folder/

MySQL shows warning: Using unique option is deprecated and will be removed in a future release

Error when exporting a dump in plesk databases (See:https://docs.plesk.com/en-US/onyx/reseller-guide/website-management/website-databases/exporting-and-importing-database-dumps.69538/):

Warning: Using unique option prefix database instead of databases is deprecated and will be removed in a future release. Please use the full name instead.

Cause

key_buffer and myisam-recover are deprecated in Mysql 5.5. myisam-recover option is renamed as of MySQL 5.5.3 to myisam-recover-options .
Resolution

1. Log in to Plesk server via SSH

2. Correct /etc/my.cnf or /etc/mysql/my.cnf as below:
Change pass to password
See – https://serverfault.com/questions/670648/mysqldump-complains-about-chosen-databases-regardless-of-command-line

How to install SSH2 extension for PHP on Plesk?

Check settings in plesk: Tools and Settings > General > PHP Settings. Click on a php version:

Through the OS vendor (CentOS 7 PHP 5.4.16 OS Vendor)

Connect to the server via SSH;

Install the pre-compiled extension packages: .rpm-based distribution (CloudLinux, CentOS, RHEL):

# yum install -y epel-release
# yum install -y php-pecl-ssh2

.deb-based distribution (Debian, Ubuntu):

# apt install -y php-ssh2

Restart apache:

# service httpd restart

Reload the handler

# plesk bin php_handler --reread

You can check with php -m

# php -m
ssh2

Check with php info file:

Check command line:

# php -i | grep ssh2
/etc/php.d/ssh2.ini,
Registered PHP Streams => https, ftps, compress.zlib, compress.bzip2, php, file, glob, data, http, ftp, phar, ssh2.shell, ssh2.exec, ssh2.tunnel, ssh2.scp, ssh2.sftp, zip
PHP Warning:  Unknown: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in Unknown on line 0
libSSH Version => libssh2/1.4.3
ssh2
libssh2 version => 1.4.3
banner => SSH-2.0-libssh2_1.4.3

Check in Plesk. Tools and Settings > General > PHP Settings > Click on 5.4.16 by OS vendor FPM application

Plesk PHP 5.6

Install Development packages:

# yum install plesk-php56-devel gcc libssh2-devel

Install all ssh2:

# /opt/plesk/php/5.6/bin/pecl install ssh2-0.13

Register extension in configuration file:

# echo "extension=ssh2.so" > /opt/plesk/php/5.6/etc/php.d/ssh2.ini

Update PHP handlers information:
# plesk bin php_handler --reread
The information about PHP handlers was successfully updated.

Restart PHP-FPM:
Find the plesk version:

#  plesk bin php_handler --list | grep -E plesk.*fpm | awk -F" " '{ print $1 }'
plesk-php56-fpm
plesk-php70-fpm
plesk-php71-fpm
plesk-php72-fpm

Restart the applicable servie for your environment, In this case, plesk-php56-fpm

# service plesk-php56-fpm restart

You can check with a phpinfo file here:

Plesk PHP 7.0 and Above

Note: In following instructions ‘7.0’ should be replaced with ‘7.1’ to install the extension for PHP 7.1.
Connect to the server via SSH

Install all required packages: .rpm-based distribution (CloudLinux, CentOS, RHEL):

Note: Following steps describe the installation of developer packages for PHP 7.0. For PHP 7.2, for instance, plesk-php72-devel or plesk-php72-dev must be installed.

# yum install -y plesk-php70-devel gcc libssh2-devel

.deb-based distribution (Debian, Ubuntu):

# apt install -y plesk-php70-dev gcc libssh2-1-dev

Build the extension:
Install the extension:

# /opt/plesk/php/7.0/bin/pecl install ssh2-1.1.2
downloading ssh2-1.1.2.tgz ...
Starting to download ssh2-1.1.2.tgz (32,057 bytes)
.........done: 32,057 bytes
6 source files, building
running: phpize
Configuring for:
PHP Api Version:         20151012
Zend Module Api No:      20151012
Zend Extension Api No:   320151012
libssh2 prefix? [autodetect] :

Hit enter and you should see he the build successful

building in /tmp/pear-build-rootSbcR3r/ssh2-1.1.2
running: /tmp/ssh2/configure --with-php-config=/opt/plesk/php/7.0/bin/php-config --with-ssh2
checking for grep that handles long lines and -e... /usr/bin/grep
......

Build process completed successfully
Installing '/opt/plesk/php/7.0/lib64/php/modules/ssh2.so'
install ok: channel://pecl.php.net/ssh2-1.1.2
configuration option "php_ini" is not set to php.ini location
You should add "extension=ssh2.so" to php.ini
...

Register extension in configuration file:

# echo "extension=ssh2.so" > /opt/plesk/php/7.0/etc/php.d/ssh2.ini

Update PHP handlers information:

# plesk bin php_handler --reread
The information about PHP handlers was successfully updated.

Restart PHP-FPM:

# service plesk-php70-fpm restart

Now you can go to Tools and Settings > General > PHP Settings > 7.0.32 FPM application (or any of the activated 7.0.32 links). And you should see:

Other sources:
https://support.plesk.com/hc/en-us/articles/213930085-How-to-install-SSH2-extension-for-PHP-
https://www.simplecloudhosting.net/cloud/index.php?rp=/knowledgebase/47/How-to-Install-the-PHP-SSH2-Extension.html

Web server reconfiguration fails plesk. mod_python and mod_wsgi Apache modules are enabled at the same time.

Plesk upgrade produces error: Job for httpd.service failed because the control process exited with error code. See “systemctl status httpd.service” and “journalctl -xe” for details.

 

See: https://support.plesk.com/hc/en-us/articles/115002784134-Web-server-reconfiguration-fails-on-Debian-Ubuntu-with-Plesk-Curl-failed-Timeout-was-reached

 

 

Add SSL to multiple subdomains in Plesk

Add a domain like this for the primary domain:

*.domain.com

The add the wildcard domain to that domain.

According to the following link, once you update the wildcard SSL for the domain/subscription “*.domain.com ” it will affect all subdomains.
https://support.plesk.com/hc/en-us/articles/213921605-Is-it-possible-to-create-and-use-wildcard-SSL-certificates-in-Plesk-

Plesk Optimization for 504 Gateway Time-out

A website is not accessible with “504 Gateway Time-out”

Log files show:


# tail -n1 /var/log/httpd/error_log
[Tue Sep 04 19:11:38.300358 2018] [mpm_event:error] [pid 1192:tid 139861305055360] AH00484: server reached MaxRequestWorkers setting, consider raising the MaxRequestWorkers setting

/var/www/vhosts/domain.com/logs/error_log
[proxy_fcgi:error] [pid 50203:tid 139860761302784] (70007)The timeout specified has expired:

https://support.plesk.com/hc/en-us/articles/115000064929-A-website-is-not-accessible-with-504-Gateway-Time-out-The-timeout-specified-has-expired-client-203-0-113-2-54693-AH01075-Error-dispatching-request-to

How to Update the Default Plesk SSL (not domain ssl)

You can update the SSL through Plesk under Tools & Settings -> SSL/TLS Certificates.

To change the default Plesk certificate and do not reassign certificates for all domains manually, do the following:

  1. In Plesk open Tools & Settings > SSL/TLS Certificates > Add > proceed with adding new certificate.
  2. Return to Tools & Settings > SSL/TLS Certificates > select the certificate created in previous step > Make Default .

Set up Sendgrid on Plesk

This is used to set up Sendgrid in Plesk for Azure email functionality.

  1. Set up a sendgrid account and set up the first email:
  2.  Ssh to the Azure server and make the following modifications:

Find your Postfix config file, typically /etc/postfix/main.cf, and add the following:

smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_sasl_tls_security_options = noanonymous
smtp_tls_security_level = encrypt
header_size_limit = 4096000
relayhost = [smtp.sendgrid.net]:587

Now you need to specify your credentials (optionally, use apikey as username and an API Key as password) in the separate file /etc/postfix/sasl_passwd (you’ll likely need to create it):

[smtp.sendgrid.net]:587 yourSendGridUsername:yourSendGridPassword

Next, make sure the file has restricted read and write access only for root, and use the postmap command to update Postfix’s hashtables to use this new file:

$ sudo chmod 600 /etc/postfix/sasl_passwd
$ sudo postmap /etc/postfix/sasl_passwd

Finally, restart Postfix:

$ sudo systemctl restart postfix

Send your email and then verify in sendgrid.

If you are getting no mechanism available error messages it generally indicates that you are missing some SASL authentication libraries.

Install the missing module dependency using apt-get (i.e., Debian, Ubuntu):

$ apt-get install libsasl2-modules

Or using a yum (i.e., RedHat, Fedora, CentOS):

$ yum install cyrus-sasl-plain

Troubleshooting
If port 587 is not working for you please try 2525 in your postfix config. You may also need to edit /etc/postfix/master.cf to remove # from

#tlsmgr unix - - n 1000? 1 tlsmgr

Other integrations with MTA’a – https://sendgrid.com/docs/Integrate/Mail_Servers/postfix.html

Enable TLS version 1.2 on Plesk

Enabling TLS 1.2 and disabling other versions on Plesk.

In order to use the steps outlined below, you will need to upgrade Plesk to it’s most recent version. You can do so within the System Overview section of the Home screen in Plesk Panel or by running

# /usr/local/psa/admin/bin/autoinstaller

Once you have completed the upgrade you can run the command in the link below to enable TLS1.2 and disable older versions of TLS.

https://support.plesk.com/hc/en-us/articles/115000422229-How-to-enable-disable-particular-TLS-version-in-Plesk-on-Linux-