This article explains how to enable the following, on a Plesk Webspace:

  • Enabling PHP 7 with FPM
  • Serving your Website via nginx (Only)

In addition, this article provides the WordPress Permalink directives required for use (with Plesk).

Important Note:

Before you can proceed with this configuration, you need to ensure that you have updated the Plesk Panel, and added the PHP 7 update to the system, before you can utilize both PHP 7 with FPM; please review the Updating The Plesk Panel section below for more information.

Why Would We Set The (Plesk) Webspace Like This?

Enabling PHP 7, and running it in FPM mode with nginx, will allow for a drastic increase in responsive performance for your website – which in turn will allow for a greater traffic base.

With Plesk, out-of-the-box, nginx will sit in front of the Apache service and Proxy requests to it. While this scenario is sufficient for most cases, configuring the Webspace to be served only via nginx will be more efficient for a higher traffic or more resource intensive website.

Important Note:

It should be pointed out however, that nginx does not honour/read .htaccess file; this can lead to issues with certain website functions or plugins/modules (in certain scanarios).

If you require the need to add directives, that would usually be in a .htaccess file, you will need to convert those into a compatible nginx format and add them to the Additional nginx directives for that Webspace.

The conversion/creation of any required directives, to a nginx format, would not be directly supported by us, rather your Web Developer should investigate what is required and create the directives – we can however attempt to assist where possible.

Enabling PHP 7 with FPM

Please follow the steps below:

  • Login to your Plesk Panel
  • Click Websites & Domains
  • Click Hosting Settings
  • Under Web scripting and statistics, for PHP support:
    • PHP version: Choose 7.x (which ever version is available on your server)
    • Run PHP as: Choose FPM application served by ngnix
  • Click OK, to save the changes
Simak Juga Gan  Cara Mudah dan Ciamik Setting Plugin Yoast SEO

The Webspace will now be running with PHP 7, via FPM and nginx.

 

Serving Your Website Via NGINX (Only)

To stop serving your content via the Apache service, and force the Webspace/Website to be served via nginx only, please follow the steps below:

  • Login to your Plesk Panel
  • Click Websites & Domains
  • Click Apache & nginx Settings
  • Scroll to nginx settings, then untick Proxy mode (if available)
  • Click OK, to save the changes

The Webspace will now be served via nginx (only).

WordPress Permalinks Configuration (for NGINX, on Plesk)

Where you are using WordPress, and in the scenario below, you will need to add the respective Permalink nginx configuration directives for the Pretty URLs to function correctly:

  • WordPress is installed at the root location of the Website
  • WordPress is set to use Permalinks i.e. it removes index.php from the URL

If the above apples to your WordPress installation – which would be a typical installation, you will need to add the below directives to the Additional nginx directives section for your Webspace:

# !!!
# !!! WordPress Permalinks
# !!!

if (!-e $request_filename) {
rewrite ^.*$ /index.php last;
}

You can add that code as follows:

  • Login to your Plesk Panel
  • Click Websites & Domains
  • Click Apache & nginx Settings
  • Scroll to Additional nginx directives
  • Enter the code in the box provided:
    • Ensure you place the code after any existing text/content
  • Click OK, to save the changes

 

The following screenshot shows an example of this:

 

The WordPress website should now function correctly with valid Permalinks – you can test this by:

  • Visting the Homepage of the WordPress installation, and ensuring the images load
  • Visting a sub Page or Post, and ensuring it loads with images
  • Visting the Dashboard login screen, usually /wp-admin

Note:

Simak Juga Gan  Cara Mudah Membuat Blog (Web) Wordpress Self Hosting

This configuration applies specifically to NGINX, on Plesk, and may not apply to other server environments or deployments.

 

Updating The Plesk Panel

You can update the Plesk Panel, and Add/Remove components, as per the following steps:

  • Login to your Plesk Panel
  • Click Tools & Settings
  • Under the heading Plesk, click Updates and Upgrades:
    • Install or Upgrade Product: Allows you to upgrade the Plesk Panel installaton.
    • Add/Remove Components: Allows you to to add/remove items – including PHP interpreter versions

Important Notes:

  • BEFORE carrying out ANY updates, ensure you BACKUP the server and your content
  • When applying updates via the steps above, follow any information on screen and ensure you do not make changes to the Plesk system – or restart the server, while updates are taking place
  • You may need to restart the server – after the updates have applied, for changes to take effect

source: https://help.blacknight.com/hc/en-us/articles/115000451205-Running-A-Plesk-Webspace-Via-NGINX-And-PHP-7-FPM

Loading...