Category: Plesk

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

 

Read More »

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:

 

Read More »

Fixing “504 Gateway Timeout” Errors On Plesk With Nginx

If your Plesk server is configured to run Nginx in from of Apache then you may encounter “504 Gateway Timeout” errors when executing long running PHP pages.  Nginx is acting as a reverse proxy for Apache. The “proxy_read_timeout” configuration setting in Nginx controls how long Nginx will wait for Apache to return a response. The default is 60 seconds which may be too short if you have a script that takes several minutes to run. To increase this timeout, just edit /etc/nginx/nginx.conf and add the highlighted line:

Don’t forget to restart Nginx after making the change.

Read More »

To Many PHP Session Files

I seen several servers with high traffic PHP sites hosted on Plesk servers building up an excessive number of PHP session files in /var/lib/php/session. Typically we discover this problem when the server runs out of inodes on the root filesystem. Plesk provides a cronjob that runs hourly to clean up PHP session files:

For low traffic sites this script work just fine. But for high traffic sites with thousands of sessions per hour the script is too slow and can’t keep up with the rate that files are created. The problem is the script check each files using the “fuser” utility to determine if the file is in use. This is a slow process. So on these high traffic servers I’ve found it necessary to remove the “fuser” check. Edit /etc/cron.hourly/plesk-php-cleanuper and change this line:

to:

Now the session cleanup will run smoothly.

Read More »

Plesk Upgrade Fails Due To /root/.my.cnf

Had a Plesk upgrade fail with the following errors:

After extensive Google searches finally found the answer – the server had a /root/.my.cnf file with credentials, which were valid, but the simple presence of that file breaks the Plesk upgrade. Removing/renaming the file makes the upgrade, or rather, the bootstrap repair, run fine.  That bootstrap command, by the way, can be run to repair the failed upgrade:

Then running the autoinstaller again finishes any unfinished upgrade tasks.

Read More »

Categories

Get a free consultation from Reliable Penguin

Submit the form—or for immediate service call 866-649-7984.