Top Nav

Force HTTP On Nginx

Simple configuration line to redirect HTTPS requests to HTTP:

0

Enable Compression On Plesk With Nginx

To enable compression on a Plesk server with Nginx handling static content, had to add the following to .htaccess:

This configuration is explained here: https://www.a2hosting.com/kb/developer-corner/apache-web-server/data-compression-using-the-mod-deflate-module

And then in Plesk under:

Subscriptions -> acme.com -> Websites & Domains -> Web Server Settings -> Additional nginx directives

added the following:

The Nginx configuration is explained here: http://www.nginxtips.com/how-to-configure-nginx-gzip-compression/

0

Upgrade CURL

The Yoast SEO plugin in WordPress has started advising users to upgrade curl to the latest version. On CentoOS this can be done easily using the city-fan.org repo here:

http://www.city-fan.org/ftp/contrib/yum-repo/

For a CentOS 6 server, here are the steps:

 

 

0

404 On sitemap_index.xml With Yoast SEO After Site Migration

After moving and renaming a site, we were getting 404 errors for the sitemap generated by Yoast SEO at:

http://acme.com/sitemap_index.xml

After digging around it turned out the solution was to reset permalinks by going to:

Settings -> Permalinks

and clicking the Save button without making any changes.

0

Using PHP composer.phar With Non-default PHP Install

Composer for PHP is an increasingly popular tool for managing packages within a PHP application.  Here’s a link for more information:

https://getcomposer.org/

On many of our Plesk servers we have multiple PHP versions install. The default at /usr/bin/php is provided by the Linux distribution and then there are additional version installed at /opt/plesk/php. Plesk lets us easily select the PHP version for each hosted website. But you can run into problems with composer using the wrong PHP version. A typical composer command might be:

or

To make our alternate PHP version work we need to instead do something like this:

So we override the default PHP by adding our preferred version to the front of the path.

0