Archive for the ‘Tutorials’ Category
IIRF WordPress – URL Rewriting for IIS6.0
Last Updated on Tuesday, 17 November 2009 12:03 Written by Simon Nicol Tuesday, 6 October 2009 11:36
Firstly – appologies to everyone who visited this blog over the last couple of days because my URL Rewriting was all wonky. Now it’s working again thank God (and a few handy websites) and back to normal. Thanks for your patience.
If you need to find out how to install IIRF on Windows have a look at this post first. It’s a complete walk-through from start to finish that will get IIRF up and running on IIS6 in no time at all. (This post is now pretty much redundant as the walk-through goes in to far more detail for both WordPress and Drupal installations than this post does.
This post is about how to get IIRF working on IIS6 running the fabulous WordPress.
Obviously you will need to change the domain name from CaspianIT to your own domain. I found parts of this code on a blog posting by John Sheehan, thank’s John! I did find that the code on John’s blog didn’t quite work for me, but there was some code on one of the comments on other blogs that when combined worked perfectly. You can read John’s blog posting here.
*Update*
I thought I would come back to show you the latest modifications to my IsapiRewrite4.ini file, this is the script that is running right now to deliver this very page you are reading right now – this is what it does and I think it will probably be suitable for majority of bloggers needs – thus the update.
RewriteCond %{HTTP_HOST} ^(caspianit\.co\.uk).*$ [I]
RedirectRule ^/(.*)$ http://www.caspianit.co.uk/$1 [I,R=301]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^/(.*)$ /index.php/$1 [L]
The above script will change any page from an http://caspianit.co.uk request to a http://www.caspianit.co.uk
The reason I decided to go with the addition of the www instead of without is because the administration pages won’t work without the www! Yes I could put further conditions that would check for the ‘wp-admin’ and then not to rewrite the URL, but rather than complicate things further it’s easier just to go with the ‘www’ bit. Another reason is because if you’re using the XMLSiteMap plugin, it will write all our URL’s with www. attached to the URL.
One the second line the [I,R=301] does this: The I (must be a capital ‘I’) tells IIRF to no be case sensitive (which is quite ironic having to be a capital I – lol) and the R=301 tells the search engines that this is a permanent Redirect (301) to this URL. Using the R=301 will help your rankings in the search engines because Google et all will quite happily crawl both the http://www.yourdomain.com/yourpage AND http://yourdomain.com/yourpage and treat them as two completely separate pages – and then mark you down for having duplicate content – doh!
For the vast majority of you who don’t have a .co.uk domain name (or at least is you have a .com or similar) change the first line to the following:
RewriteCond %{HTTP_HOST} ^(yourdomainname\.com).*$ [I]
And that should do it. Obviously there are many different configurations but the script above should suit most WordPress installations. I think IIRF is great, it’s not only FREE it’s also powerful and it doesn’t have ridiculous licensing constraints on it. It may take a tiny bit of effort to set up but really it’s not a lot more than other ISAPI Re-writers and it doesn’t cost $99!
I hope this works for you.
Simon
Tags: .htaccess, free url rewriter, IIRF, ISAPI Rewrite, mod_rewrite, wordpress | Posted under Articles & Reviews, Tutorials | No Comments
How to reset the bios on an Acer TravelMate 4060
Last Updated on Tuesday, 23 June 2009 01:20 Written by Simon Nicol Friday, 5 June 2009 05:21
Ask the Experts:
It’s quite simple. If you’ve forgotten the password to get into the BIOS all you have to do is open up the largest panel on the bottom of the TravelMate, it’s the same one that covers the RAM and WiFi card, just toward to back of the Laptop you will see a small chrome covered battery. Just wedge this out working round the bit of plastic on the bottom of the case that would otherwise make this an easier task.
Once the battery has been removed, just wait for a few seconds and then pop it back in. Voila! You should now be able to boot your system up and change the settings in the BIOS or do whatever it is you wanted to do.
Posted under Laptop Repair, Tutorials | No Comments
To host own DNS or not – is it a good idea?
Last Updated on Sunday, 21 June 2009 05:44 Written by Simon Nicol Tuesday, 19 May 2009 01:33
There comes a time when learning about networking when we really start looking in to DNS and the possibility of self hosting. This could be for a web server, a mail server or both. In fact once you have a rock solid understanding of DNS there’s not a lot you won’t be able to do, so it really is worth taking a bit of time to have it completely understood.
I have decided to write a series of articles and tutorials to help other network engineers on their way to mastering DNS. Before we begin (if you’re in a major hurry you can skip straight to the articles, but I recommend reading this bit if you have the time) it’s important to understand some fundamentals about DNS.
DNS is extreamily fast to execute. All that is happening is the processor is reading from a look-up table of domain names and getting a number associated with it -The IP address. This process doesn’t take long at all, in fact it’s so fast, a single server is quite sufficient for handling around 10,000 DNS requests per second, so unless you’re a huge company or an ISP or have an extremily complex network topology just 1 server is quite enough.
By default DNS is a UDP packet not a TCP. The difference in a nutshell being UDP stands for Unsigned Data Packet, this means there is no ‘handshake’ which in turn means your server is not going to wait around for any communication to be ‘Ack’nowledged. This means that DNS is served on a best effort basis, if the server is busy when a DNS request comes in or the ADSL line is busy – it will simply be ignored.
Hosting your own DNS is it a good idea?
No.
No, is about as succinct an answer possible. It’s fine to try out when learning about DNS and doing some tests but unless you fit very specific criteria (explained later), it really isn’t worth it, let me give you the reasons why…
Most ISP’s will charge you extra for having a static IP address. Here in the UK having a static IP address will usually cost you an extra £10 per month, which is £120 a year which is quite a lot really.
Hosting your own DNS you will also need to have two DNS servers. Yes that’s right you need two of them, one to respond for local queries and the other to respond to queries coming from the Internet. I think I’ll quickly go into a little more detail, but don’t let it bog you down if you find it gets too complicated.
If you are developing a website, let’s call it mydomain.com and you are hosting your own DNS. You also have a static IP address, lets hypothetically say it’s 209.85.171.100 ok. You are at home or in a small networked office which has one or two servers and you have decided to use one of them as a web server.
From a command prompt if you ping mydomain.com from within your local network (LAN) and you receive the external IP address of your website 209.85.171.100 that would be bad. The reason it’s bad is because the IP address of 209.85.171.100 is a public IP address not a local IP.
Any address that is not a part of the local area network range (10.xxx.xxx.xxx or 192.168.xxx.xxx – I think 176 is also local) gets routed straight through your default gateway (router). The packet leaves your router looking to resolve the DNS query mydomain.com, in order to do so it finds the root servers for the .com domain’s then it looks up the name servers for ‘mydomain’. The name servers are found and the IP address resolves back to 209.85.171.100. which is your WAN address (your Internet or public IP address you get when you connect to the Internet). This is bad and it’s called a ‘loop back’. It’s not only bad networking having to search the planet for your domain only to return to the address the request came from, it’s also happens to be a security breach and you will find most routers will block this sort of behaviour as it will think it’s under attack.
This means that on your local area network you will need to have a local DNS server. What a local DNS will do is answer requests for mydomain.com and reply with the local IP address of your web server – NOT your public IP address (WAN IP).
Something I’ve found that trips up the slightly less experienced network engineers is this: If you are hosting a website locally, you MUST have a DNS server to reply with local addresses. All DNS queries on your local network must go through your DNS server and ONLY your local DNS server. Do NOT think it’s OK to have a secondary DNS server that points to your ISP’s as a fail over. The reason for this is simple. What happens if for example, you were to ping mydomain.com from a command prompt? You would get a reply from your local DNS server with an IP address like 192.168.xxx.x – which is good, but what would happen if you were to ‘ping’ mydomain.com and your local DNS server was busy? It would see that there was a secondary DNS server listed and so without a second thought it would go off and ask your ISP’s DNS servers to resolve mydomain.com – BAM! loop-back problem! Not only that, the external value (your WAN IP address) 209.85.171.100 would then be stored in your local DNS cache. This is called cache polution and when that happens any time you try to access your domain mydomain.com your DNS cache will reply with 209.85.171.100 – even if your local DNS server is no longer busy! The only way to clear this cache polution is by using the command ‘ipconfig /flushdns’ from the command prompt.
So there you are. You will often find that DNS problems are most often caused by misconfiguration of LOCAL servers NOT servers ‘out there’. Getting local DNS right will save you a lot of grief. DNS is nothing to be afraid of and when you really know how it works, the world is your oyster.
When do you think it’s ok to host your own DNS?
I would say if you had at least two fast ADSL lines or more. You should have a DNS server for each line that you have coming in to answer requests coming in from the Internet. If you host your own DNS and your ADSL line is busy because someone on your network is surfing the web at the time or your DNS server is busy, you will miss the request.
You would also need to have a static IP address for each ADSL line you have coming in.
What do you recommend?
I recommend using DDNS. That’s Dynamic DNS it’s well worth getting to know how to use.
Unless you’re hosting a lot of websites, your best bet is to have your DNS externally hosted. I use dyndns.com but there are many DNS services available and you can use any one you like.
With dyndns.com I have 5 public name servers for my domain’s that are grographically dispersed available. RFC regulations state that you should have at least two and preferably three, so with 5 the chances of a DNS request for my domain going unresolved are slim.
Dyndns charge – I think, $27.50 for a year which is around £18, this may seem quite expensive but really it isn’t (if you know of other services that cost less and are highly reliable, please leave me a comment)
There is a way to have a brand new domain publicly available over the whole world instantly! No need to wait for between 24 hours to 3 days. I explain how to do this in a DNS mastery tutorial which I’ll write later in this series.
Posted under Tutorials | No Comments
Installing cURL on Windows – WordPress e-Commerce
Last Updated on Wednesday, 11 November 2009 08:34 Written by Simon Nicol Wednesday, 13 May 2009 12:01
I’m using the recently downloaded wp-e-commerce.3.6.12 plugin for WordPress. This post walks through the steps I took to get cURL up and running on a Windows 2003 server (but the process should work for all win32 platforms).
1. Go to http://curl.haxx.se/dlwiz/ This is the download wizard page that will walk you through the version you need.
2. Download msvcr70 from http://www.dll-files.com/dllindex/dll-files.shtml?msvcr70
3. This is a good link, if a bit complicated to figure out http://www.phpbuilder.com/lists/php-windows/2001051/0335.php
Help with configuring cURL
Tip for Installing cURL with AppServ development server on Windows
If you are running AppServ as a WAMP development environment on a Windows machine, you may experience difficulty installing cURL. Here are some helpful steps:
First go to the PHP directory and copy the following libraries to the windows/system32 dir.
ssleay32.dll
libeay32.dll
Open the php ini file and remove the ; from extension=php_curl.dll
Reboot your server.
A PHP script that with automatically log you in to a website can be found here:
<?php
// Set username and password values below…
$username = ‘username’;
$password = ‘password’;
// Initialize cURL
$ch = curl_init();
// Set the URL
curl_setopt($ch, CURLOPT_URL,“http://www.theubm.com/index.php”);
// Accept cookies
curl_setopt($ch,CURLOPT_COOKIEFILE,1);
// Submit our POST values (EG: username and password)
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, “username=$username&password=$password”);
// Execute…
$output = curl_exec($ch);
// Display the result
echo $output;
?>
http://www.dreamincode.net/forums/showtopic77899.htm
Tags: wordpress | Posted under Hints n' Tips, Tutorials | No Comments
Hot Topics
- Creating a Drupal 6 custom login form – Step by Step tutorial.
- WordPress Contact Form 7 & WP-Mail-SMTP problem solved
- imagecache wrong path – SOLVED!
- 7129/6105195 Edward Leedskalnin’s anti-gravity – How he built Coral Castle.
- How to take Ownership of a Drive, Folder or File in Windows 7
- WordPress widgets not saving or dragging?
- Firefox – update favicon.ico (SOLVED)
- IE emulator for FireFox
- Site off-line The site is currently not available due to technical problems. Please try again later. Thank you for your understanding. (SOLVED!)
- Access denied – Drupal 6.x
Archives
- November 2011
- September 2011
- August 2011
- June 2011
- January 2011
- December 2010
- November 2010
- October 2010
- May 2010
- April 2010
- March 2010
- February 2010
- January 2010
- December 2009
- November 2009
- October 2009
- September 2009
- August 2009
- July 2009
- June 2009
- May 2009
- April 2009
- January 2009
- December 2008
- August 2008
- June 2008