Plesk Server Upgrades – Incoming

Plesk-12-Banner

So that we can continue to provide high levels of performance to all our hosting clients we are planning a number of upgrades to both server hardware and control panel software for 2015.

Plesk 9 – We know many of you love this old panel but unfortunately it’s time to say goodbye to it. All Plesk 9 servers will be upgraded to Plesk 11.5 during Q1 2015. Plesk 11.5 provide higher performance, security and a multitude of new features over Plesk 9. The server hardware will be completely replaced with current high performance hardware.

Plesk 10 – The remaining Plesk 10 servers will be upgraded to Plesk 11.5 during Q1 2015. The server hardware will be completely replaced with current high performance hardware.

Plesk 11/11.5 – Besides security and panel updates, these servers will remain as they are.

Plesk 12 – From Q2 2015 we will be rolling out Plesk 12 for all new accounts. We will offer free migrations from Plesk 11/11.5 to Plesk 12 when requested.

We are committed to ensure we have the highest performance and security available for all of our clients. We will update you directly when your server is affected with specific upgrade dates. If you have any questions please do not hesitate to contact the Helpdesk.

How to redirect HTTP traffic to HTTPS using an .htaccess file

Redirecting HTTP to HTTPS using .htaccess

So you have installed your SSL Certificate and now you want to use it. Paste the following code to the beginning of your .htaccess file to redirect all non-https to https.

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]

Find all WordPress folders with 777 permissions

How to find all folders with 777 permissions


As the owner of a dedicated server provided shared hosting services, you will find that many of your clients will install applications such as WordPress. So far so good. However, once they start getting stuck with file and folder permissions, they generally go crazy and set everything to 777 in order to fix the problems. Great, they get their site working! Now begin your problems.

With these liberal file and folder permissions together with some not-so-well written plugins, it is only a matter of time before the hackers and crackers target these weak WordPress sites and start injecting all manner of redirects and mail spammers on your server.

Using ‘find’ to locate those weaknesses

So, here is a nifty solution to find all those weak WordPress installations. The following find will list all WordPress installations that contain folders with 777 permissions:

find /var/www/vhosts/*/httpdocs/wp-content -perm 0777 -type d | grep -v "wp-content/"

Give this a whirl on your Plesk server and take a look at the list, navigate to each folder and tighten up the permissions as below:

cd /var/www/vhosts/dodgydomain.co.uk/httpdocs
find . -type d -exec chmod 755 {} \;
find . -type f -exec chmod 644 {} \;
chmod 750 ../httpdocs

These permission changes eliminate all unnecessary 777 permissions.

Ok, let’s automate the whole process

What? You have lots of these? Then here is a nifty script to automate the process for you:

df=`find /var/www/vhosts/*/httpdocs/wp-content -perm 0777 -type d | grep -v "wp-content/" \
| sed "s/wp-content//g"`

for line in $df;
  do
    echo $line
    cd $line
    find $line -type d -exec chmod 755 {} \;
    find $line -type f -exec chmod 644 {} \;
    chmod 750 $line
  done

This makes things a little more difficult for any would-be injection attempts. If your directory structure is different to the standard Plesk structure simply modify the find command as required.

Useful Find Examples

Find all HTML files that contain the text “Loading”

# find . -name *.html -exec grep -il "Loading" {} \;

Find all files modified in last 7 days

# find . -mtime -7

Find all .PHP files modified in last 7 days

# find . -name *.php -mtime -7

Find and Remove all PHP files modified in last 7 days

# find . -name *.php -mtime -7 | xargs rm

Find all  files modified in last 10 days that contain text “Loading” and move to /trash

# find . -type f -mtime -10 -exec egrep -l "Loading" {} \; -exec mv -f {} /trash \;