Categories
HowTo Guides Plesk

Handy htaccess file tips

Ok – here is some handy .htaccess bits

If you want to redirect all visitors to a single page, apart from specific IP address (eg your IP or your customers) the following .htaccess file can be used. Simply repeat the REMOTE_ADDR line if you want more IP addresses :

<IfModule mod_rewrite.c>
  RewriteCond %{REMOTE_ADDR} !^82\.16\.14\.130
  RewriteCond %{REMOTE_ADDR} !^82\.87\.43\.123
  RewriteCond %{REQUEST_URI} !/comingsoon.html$ [NC]
  RewriteCond %{REQUEST_URI} !\.(jpe?g?|png|gif) [NC]
  RewriteRule .* /comingsoon.html [R=302,L]
</IfModule>

What about if you want to use Google’s ‘site moved’ facilities, and you already have your 301 redirect in place? When you try to validate your domain with Google it will fail! So… using this .htaccess file, you can redirect all traffic to your new domain, but still let Google access your validation file :

<IfModule mod_rewrite.c>
  RewriteEngine on
  RewriteCond %{HTTP_HOST} yourolddomain.co.uk [NC]
  RewriteCond %{REQUEST_URI} !^/google1d5jdk4533a39485.html$
  RewriteRule ^(.*)$ http://www.yournewdomain.co.uk/$1 [R=301,L]
</IfModule>

If you have any .htaccess tips – please leave a comment, and I’ll add them to the list.

Categories
Windows Server

SBS 2008 Remote Web Workplace doesn’t work first time

So, another odd one. Users report that upon visiting remote.domain.com they are initially presented with the below error page, but if they try again immediately RWW loads as normal. If the user goes directly to https://remote.domain.com/owa this works first time every time.

Cannot connect to the remote web workplace site. To continue contact your network administrator

Looking through the event log, I keep seeing ‘TraceListener cannot be created.” and according to web.config – the logs are supposed to be stored within “”C:\Program Files\Windows Small Business Server\Logs\WebWorkplace” which on this server did not exist. Upon creating this WebWorkplace folder I have since been unable to recreate the above error – so hopefully all is fixed!

Categories
Plesk

How would you improve Parallels Plesk Control Panel

I’ve used Plesk for over 6 years now, and have grown to rely heavily upon this web server control panel to manage my 3 production web servers – currently hosting around 400 sites.

The interface has always remained fairly consistent, despite the odd hiding of reporting buttons and moving of icons – but several things have always bugged me…

  • Why can’t I enable FTP backup for all clients in batch, or enable for all domains by default
  • Why can’t I report or notify on success or failure of backups
  • I missed out on switching to Power User view when initializing the server – now I seem to be stuck with the Reseller mode

Let me know in the comments how you would change Plesk.

Categories
CentOS HowTo Guides Linux Plesk

1and1 default Plesk partition – resizing guide

1and1 have been regularly criticized for their unusual partitions on default installations of their dedicated servers – but this is the first time I have been affected. One of our dedicated servers started producing Postfix SMTP errors – caused by low disk space.

Upon investigation, the default partitions on my 1&1 Plesk 10.4 server came set at 4Gb, and my ‘var’ partition was full. The used space is all genuine files, so my only option was to increase the partition. On Windows this is quite a complex procedure, requiring additional applications – however following a simple guide made this a 5 minute procedure. Here are the steps that I took

Categories
HowTo Guides Linux Plesk

Plesk API vulnerability – allow anonymous hacker

Great… Nice start to the day, received an email from Parallels regarding a vulnerability within all Plesk Panel versions below 10.4 which allow anonymous access to the server!

http://kb.parallels.com/en/113321

In a nutshell – if your server is running below 10.4 – you are at risk and MUST update. I have 3 Plesk servers, 10.4 / 9.5.4 / 8.6.0 – so I was able to carry out the “Micro updates” (MU), versions other than this required a manual patch (unless you opt to go upto the highest subversion to get the MU).

Categories
HowTo Guides Linux Plesk

Protecting your Plesk server against the TimThumb hack

Plenty of WordPress themes, and many plugins, scripts and add-ins now make use of the great TimThumb script to modify images on-the-fly. I have used the script numerous times on my own sites, and for clients – either within a custom written Theme/Plugin or pre-attached within a theme. This results in a lot of different versions of the script over the year – which caused a bit of a panic when I read Cleaning Up the TimThumb Hack | WP Theming outlining the possible threat that an out of date script would cause.

The handy walk-through put together by Devin helped me find firstly; where my scripts were buried, and secondly; which versions required updating (in the end, I updated them all to the latest release)