plesk :: Curvve Media Blog

Fixing Plesk 11.5 error 500 NGINX & WordPress path url slash redirect error

Posted by | Servers | No Comments

You may have noticed that when visiting a WordPress site on a Plesk 11.5 server, the page redirects don’t always work. Depending on whether or not the URL has a trailing slash (/), you may get a 500 Internal Server Error message. 

The problem seems to be with the default templates that Plesk uses to create domains. Luckily, we can customize them and fix the issue in the URL rewrite lines. 

Create a custom NGINX Default Domain template

First, we need to create the custom paths and copy the original template files. 

mkdir /usr/local/psa/admin/conf/templates/custom/domain
cd /usr/local/psa/admin/conf/templates/custom/domain
cp /usr/local/psa/admin/conf/templates/default/domain/nginxDomainVirtualHost.php .

Edit our NGINX Default Domain VirtualHost PHP template

Now we edit the NGINX Default Domain VirtualHost PHP template and make some minor changes to the URL rewrite

nano nginxDomainVirtualHost.php

Find / Replace this block of code:

location ~ /$ {
    < ?php echo $VAR->domain->physicalHosting->proxySettings['directoryIndex'] ?>

With this:

location ~ / {
     index index.php index.cgi index.html index.xhtml index.htm index.shtml;
     try_files $uri $uri/ /index.php?$args;

Rebuild your domain configurations

Now we tell Plesk to rebuild the NGINX conf files for the domains on the server

/usr/local/psa/admin/bin/httpdmng --reconfigure-all

Restart Apache, NGINX and PHP-FPM

service php-fpm restart
service nginx restart
service httpd restart


Fix: Postfix Plesk SMTPD “connect from unknown []” localhost not found error

Posted by | Servers | No Comments

I've found that every time I update my Plesk 11 server, I can no longer send or receive email. I was able to find the following messages in my maillogs.

postfix/smtpd[1672]: connect from unknown[]
postfix/smtpd[1672]: fatal: host/service localhost/12768 not found: Name or service not known

The solution is actually very simple. Open your Postfix/ file

nano /etc/postfix/

Now search for the word “milter” and comment those lines out.

#smtpd_milters = inet:localhost:12768
#non_smtpd_milters = inet:localhost:12768

Restart postfix

service postfix restart


Guide to Apache PHP / FCGI performance tuning on Plesk linux servers

Posted by | Guides | 2 Comments

Tuning Plesk servers for optimal Apache PHP / FCGI performance can be a nightmare. Here is a great guide on getting you started. Special thanks to the LinuxDriver blog for some of these great tips.

This should go without saying: make sure to backup your configuration files before trying any new settings!

Step 1: Modify fcgid.cpnf

nano /etc/httpd/conf.d/fcgid.conf
LoadModule fcgid_module modules/

AddHandler fcgid-script fcg fcgi fpl

FcgidIPCDir /var/run/mod_fcgid/sock
FcgidProcessTableFile /var/run/mod_fcgid/fcgid_shm

FcgidInitialEnv RAILS_ENV production

FcgidIdleTimeout 3600
FcgidIdleScanInterval 480
FcgidBusyTimeout 1800
FcgidBusyScanInterval 480
FcgidZombieScanInterval 12
FcgidErrorScanInterval 12
FcgidProcessLifeTime 0

# Change the rate at which new FastCGI processes are spawned under load. Higher=faster
FcgidSpawnScoreUpLimit 10

# Higher number = spawning more FastCGI processes decreases the spawn rate (controls runaway
FcgidSpawnScore 1

# Higher number = terminating FastCGI processes decreases the spawn rate (controls runaway)
FcgidTerminationScore 2

# Increase the FastCGI max request length for large file uploads (needed for some sites)
FcgidMaxRequestLen 1073741824

FcgidMaxRequestsPerProcess 100000
#FcgidMinProcessesPerClass 3
FcgidMaxProcessesPerClass 4
FcgidMaxProcesses 16
FcgidIOTimeout 1800

Modifying your PHP.conf

Next, let's edit our php.conf

nano /etc/httpd/conf.d/php.conf
AddHandler php-script .php
AddType text/html .php
DirectoryIndex index.php

Step 3: SWTune – Optional

Now we are going to create a special SWTune.conf configuration file. I've had mixed success with this, so please experiment with this. I believe this will be more effective on lower resource systems. You may choose to skip this step.

nano /etc/httpd/conf.d/swtune.conf
HostnameLookups off
KeepAlive Off

StartServers 1
ServerLimit 2
MinSpareThreads 32
MaxSpareThreads 96
ThreadLimit 64
ThreadsPerChild 32
ThreadStackSize 2097152
MaxClients 64
MaxRequestsPerChild 0

Step 4: CPU and Memory configuration

Finally, this next shell command will determine the best configuration settings based on your processors and amount of memory.

num_cpus=$(awk '/^processor/{count++}END{print count}' /proc/cpuinfo)
sed -i 's%[#]*HTTPD=.*%HTTPD=/usr/sbin/httpd.worker%g' /etc/sysconfig/httpd
sed -i 's%HTTPD_BINs.*%HTTPD_BIN /usr/sbin/httpd.worker%g' /etc/psa/psa.conf
sed -i "s/(ServerLimits*).*/1$(( $num_cpus * 2 ))/" /etc/httpd/conf.d/swtune.conf
sed -i "s/(MaxClientss*).*/1$(( ( $num_cpus * 2 ) * 32 ))/" /etc/httpd/conf.d/swtune.conf
service psa stopall
service psa restart

Notes:- The earlier mentioned sequences or patterns will adapt the host limitations and Optimum Customers in respect to the CPU quantity.

Increase MySQL max connections for Centos Plesk Servers

Posted by | Servers | No Comments

A brief Overview on MySQL

While connecting to MySQL server you may get many errors this means that your other available connections are being used by other clients.

With the help of max_connections system variable you can control number of permitted connections. But 100 is its default value. And if you want to increase number of connections, you can set high value for this system variable.


To start this procedure you must have below mentioned decencies:

For root or a sudo user you must have SSH access
• Connecting via SSH to user server
• How do I enable root access?
• How do I disable SSH login for root user?


To increase the number of maximum connections of MySQL, edit the file /etc/my.cnf. And connect to server as root or sudo user via SSH, and type

vi /etc/my.cnf

Then you will see a section like this or may be somewhat different:


Under [mysqld] add following line:


Resulting configure file must resemble this:


To restart mysqld save the changes and type:

/etc/init.d/mysqld restart

Result will appear as-

Stopping mysql: [ OK ]
Starting mysql: [ OK ]

If stopping FAILS, there will be some mistake, recheck all settings and make sure you have correctly entered new settings.


If you want to check settings whether it was applied successfully or not, use any of the below mentioned methods:

1. See mysql> prompt by Log into MySQL

mysql -uadmin -p`cat /etc/psa/.psa.shadow`

2. Run Command

show variables like 'max_connections';

Remember to add semi column to the end.To exit Mysql, apply the quit command.

SSL certificate setup for pop3s, imaps, smtps on Plesk

Posted by | Guides | No Comments

For Parallels Plesk Panel version 9, 10, 11:

Settings -> SSL Certificates -> Add SSL Certificate

Fill in required preferences and click button {Self-Signed}

New self-signed SSL certificate will be created in server certificate repository.

To assign this SSL certificate for securing your Parallels Plesk Panel mark enabled new SSL certificate in the list and push Secure control panel if you have Plesk 8.2 or later, or Install if you have older Plesk version.
Also, see Plesk documentation how to setup self-signed certificates.

After you created or uploaded new certificate into Plesk and wish to use it for domains you should set it for every IP you need, so domains use it when you access them via HTTPS.
It can be done on page Server -> IP Addresses -> “choose IP” by selecting needed Certificate in “SSL Certificate” drop down menu.


I use 1 SSL cert for plesk control-panel, pop3s, imaps and smtps.

After generating the new certificate in the administrator repository. make it your default certificate and mark it again and press setup to install it on your plesk admin server on port 8443. then put the certificate at your main ip-adresse in your ip-pool(maybee this step is not necessary).

copy /usr/local/psa/admin/conf/httpsd.pem
/usr/share/courier-imap/pop3d.pem, /usr/share/courier-imap/imapd.pem and /var/qmail/control/servercert.pem

please have a look that the owner(very important) and the chmod rights are the same of pop3d.pem, imapd.pem and servercert.pem. like before otherwhise qmail will for example not work/start, because it can’t read the file.

restart courier(imap,pop3) and qmail(smtp) in the plesk server service control panel.

after this plesk control-panel 8443, pop3s, imaps and smtps should work without warning messages and with only 1 ssl cert, if you use for all services the same main address like me.

(You should also double check that your hostname is configured in the qMAIL config)

Now test your certificates:

openssl s_client -connect [host]:993

openssl s_client -connect [host]:995

openssl s_client -connect [host]:465

openssl s_client -connect [host]:8443

where for e.g. host=localhost
Contact Us

Have a question? Send us a message. We'll get back to you soon.