UK Sales: 0800 035 6364 | sales@2020media.com | We'll Call You

Question: how can I change ASP.NET version for site

http://msdn.microsoft.com/en-us/asp.net/aa336650.aspx

Using Conditional Statements and mod_rewrite

What happens when you start getting people hotlinking to your images (or other files)? Hot linking is the act of including an image, media file, etc from someone else’s server in one of your own pages as if it were your own. Obviously, as a webmaster, there are plenty of times when you don’t want people doing that. You’ll almost certainly have seen examples where someone has linked to one image on a website, only for a completely different, “nasty” one to be shown instead. So, how is this done?

It’s pretty simple really. All it takes are a couple of RewriteCond statements in your .htaccess file.

RewriteCond statements are as they sound - conditional statements for RewriteRules. The basic format for a RewriteCond is RewriteCond test_string cond_pattern. For our purpose, we will set the test_string to be the HTTP_REFERER. If the test string is neither empty nor our own server, then we will serve an alternative (low bandwidth) image, which tells the person who is hotlinking off for stealing our bandwidth.

Here’s how we do that:

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?somesite.com/.*$ [NC]
RewriteRule \.(gif|jpg|png)$ http://www.somesite.com/nasty.gif [R,L]

Here, the RewriteRule will only be performed if all the preceeding RewriteConds are fulfilled. In the second RewriteCond, [NC] simply means “No Case”, so it doesn’t matter whether the domain name was written in upper case, lower case or a mixture of the two. So, any requests for gif, jpg or png files from referers other than somesite.com will result in your “nasty” image being shown instead.

The [R,L] in the RewriteRule simply means “Redirect, Last”. So, the RewriteRule will visibly redirect output to “nasty.gif” and no more RewriteRules will be performed on this URL.

If you simply don’t want the hot linkers to see any image at all when they hot link to your images, then simply change the final line to RewriteRule \.(gif|jpg|png)$ - [F]. The - means “don’t rewrite the requested URL”, and the [F] means “Forbidden”. So, the hot linker will get a “403 Forbidden message”, and you don’t end up wasting your bandwidth.

Article appears in full on www.workingwith.me.uk

About 2020Media Quotas

Each account has a disk and bandwidth quota. This is in place to protect your account and others from potentially large volumes of traffic and/or email sent to a single web or email address that could materially affect our system servers.

The service is NOT 'down'

If you are a 2020Media customer and seeing this message, your service with us has exceeded a quota level set on your account. Please raise a support query at our customer portal.

If you receive a message saying you have exceeded your quota, there are usually three options

  1. Remove some content. In case you are offering large files for download; check the logs to be sure where the traffic goes.
  2. Upgrade your present service to a package giving you more resources.
  3. Wait until the end of the month, or bandwidth calculation period, where your quota will be reset.

If it just a temporary burst of traffic, contact our sales team and they may be able to give you a bandwidth boost without needing to change your contract.

You can reduce the bandwidth you use in many ways, and it doesn't have to involve fewer visitors. Optimise and crop images so the file size is reduced. Optimise your html by using css and a decent editor (not Frontpage or Word, which leave loads of comments and other fluff in your html files). Finally, ban undesirable robots from eating your bandwidth using robots.txt and your .htaccess file.

How to disable password expiry in Windows 2008

1)   Load Group Policy Editor ( Start --> Run --> gpedit.msc )

2)   Expand sections as follows -

Computer Configuration --> Windows Settings --> Security Settings --> Account Policies --> Password Policy

Set 'Maximum password age' to 0 to totally disable expiry.

Disable Password Expiry
Disable Password Expiry in Windows Server 2008

You can also change the setting on password complexity here if you find Microsoft's default setting too restrictive.

2020Media offers a full range of Windows Server 2008 Hosting with MSSQL included.

Contact us for a quote.

Some notes on installing and configuring Inagios, the Iphone Nagios interface

inagios running on an IphoneThese are not official instructions, but we hope they may be of help to others who are experiencing installation problems.

What is Inagios?

Inagios is a simple iPhone interface to your Nagios front-end server. Like many internet service providers and web hosts we use Nagios for monitoring our network.

Notes on the install

The code for Inagios can be downloaded from the link above. These notes relate to inagios-beta-20080318. There are two components provided:

  • A sample httpd.conf file
  • Contents of the html directory as used at Inagios.com

NB: There is NO "installer" as such.
At the time of writing (October 2008), instructions are sparse:

You will need the following installed:

+ Apache 2
+ mod_perl 2
+ HTML::Mason
+ MySQL

There is a bug that manifests itself if you are loading a large Nagios site, where handful of services do not show up properly.

We found there were a number of additional steps that were required to get a working interface so we could view our Nagios site on the Apple Iphone.
We decided to get it working without SSL to start with, and to simplfy as much as possible and then debug to get a working website. We enabled SSL towards the end, as it seemed ssl connections may have been hardcoded into the scripts.
We copied the supplied httpd.conf into our apache conf.d folder and commented out a lot of the lines in the httpd.conf file - for instance the SSL section and the "SSLRequireSSL" Directory section. Note that various Module sections are already commented out at the top. You'll need to uncomment these and make sure Apache restarts. We'd recommend uncommenting one at a time and restarting Apache each time.
In fact we left the Perl Modules in the section called "Better performance" commented out til the end as we thought they would be loaded automatically by the script as it ran. This caused problems as this didn't seem to happen.
You'll need to make sure you have mod_perl 2 installed, and the mod_apreq2 Apache module.
Install the Perl modules like this:

perl -MCPAN -e 'install Bundle::HTML::Mason'
perl -MCPAN -e 'install XML::Simple'
etc

You'll probably find a number of additional modules are needed, just install as they show up as missing in the error logs. Alternatively, if you look through the various files provided you can see mention of additional perl modules - check they are installed.

Modification of hard-coded variables

There are a number of files you'll need to modify to suit your own environment.
inagios.com.conf: The ServerName and DocumentRoot, plus the SSL cert info<
iNagiosWebApp.pm: The Database name, username and password lines 42-44
login.js: the ServerHost variable on line 27
trimCacheDB.pl: Line 25 As you can see from above, you'll need to create a MySQL user and database for the script.

Tips

Make sure you test in Safari web browser. It'll work fine on your desktop - you don't need an Iphone to test.

Nicola Worthington, Developer of inagios
Nicola Worthington

Use Safari's Developer mode. In login.js at line 108 you'll see console.log (..) commented out - if you uncomment this, in the Safari Developer mode you can see the data from this item.

We'd like to say a big thank you to the developer Nicola Worthington of this application - it looks great in the iphone and we appreciate the effort that went into developing it. Apologies if we've forgotten anything - the install was done over a few days and with the help of lots of coffee.

Other useful gadgets for the iphone: ping, Lookup, TouchTerm (SSH app) and VNC

Page 2 of 4

2020Media is a leading provider of small business Wi-Fi hotspots. If you want to offer free Wi-Fi to your customers or users, our service could be exactly what you are looking for. Our Hotspots are managed in the cloud, ultra-reliable and give you loads of information about behaviour patterns of your users. Read More   Read more...
2020Media introduces Moodle Hosting - UK servers and UK Moodle experts setup your site ready to use. Read more...
Special Offer for Longer Registration Periods Register or renew a .com, .net or .org domain name for 5 years we'll include 1 year free*. Read more...
2020Media is now offering zero-click installation of the popular TYPO3 content management system. Read more...

Our blog is regularly updated with news, tips and industry opinion.

Clients

  • AggieWestons
  • baker-and-mckenzie
  • arts-council-england
  • Big Finish
  • barratt-developments-logo
  • City-of-Lincoln-council-logo
  • brora-logo
  • DenisMacShane
  • Construction-Industry-Council
  • colchester