Top Nav

Archive | Plesk

Plesk & New Relic

New Relic is a great tool for managing website performance. Recently worked to setup a Plesk 12 server with New Relic. We wanted to have each virtual host on the website represented by an Application in New Relic as documented here:

https://docs.newrelic.com/docs/agents/php-agent/configuration/php-directory-ini-settings

We found a few useful points that we want to share:

1. The newrelic.appname must be removed from /etc/php.d/newrelic.ini.  If the appname is defined in this file then individual virtual hosts will not be able to override and provide there own appname. Just edit the file and comment out the line like:

2. Set the appname for each virtual host from Plesk by going to:

and adding a line like this:

to the “Additional configuration directives” field. Notice that the appname has two components separated by a semicolon. The first is the domain for the site and the second is the fully qualified server hostname. So for example you might do:

and then another site on the server might be:

Now in New Relic, you’ll see three applications. One for store.acme.com, one for blog.acme.com and one for the entire server called web1.acme.com.

2

Revoke MySQL DROP Privilege On Plesk Database User

Had a request from client to add database user on a Plesk server but to remove the DROP DATABASE privilege so that they could not accidentally delete their database. By default, database users created through Plesk do have the DROP DATABASE privilege. Plesk does not currently allow fine-grained control over database privileges so the only way to implement this change is to modify the privileges directly from a MySQL command line. After some testing we found these command will have the desired effect:

Of course replace “testdb” and “testdbuser” with your actual database and username.

0

Set X-Robots-Tag Header On Plesk/Nginx

On a Plesk server with Nginx enabled here are the steps to setup custom X-Robot-Tag headers has described here:

https://developers.google.com/webmasters/control-crawl-index/docs/robots_meta_tag?csw=1

In Plesk control panel:

1. Select the domain

2. Click Web Server Settings

3. Scroll down to nginx settings

4. If you have “Serve static files directly by nginx” checked (which I recommend), you’ll need to remove the file extensions to which you’re going to apply headers. In this example remove “pdf” from the list.

5. In the “Additional nginx directives” field enter:

6. Click OK button to save changes.

0

Plesk 11 – vhost.conf File For Nginx

We’re all familier with using a vhost.conf file on Plesk to provide custom Apache directives to an individual virtual host. Originally the file was located at:

Recent versions of Plesk have moved the file to:

And of course there is an SSL version of the file at:

The good news is there’s also now a file for Nginx at:

By default these files don’t exist and are not included in the configuration. So you’ll need to create the file and then run:

or

 

0

Increase Nginx Upload Limit On Server With Plesk Panel

From the Plesk Panel you can set the PHP upload_max_filesize at Website & Domains -> PHP Setting. But if you’re using Nginx then you may also need to configure Nginx to allow larger uploads. We saw errors like this in the /var/log/nginx/error_log:

To resolve the issue edit /etc/nginx/nginx.conf and set client_max_body_size by adding the highlighted line:

 

1