Using SQL Management Studio in Windows 7
If you happen to be using SQL Management Studio in Windows 7 and need to connect to a SQL 2005 instance not running on the standard port of 1433, you might be having some problems connecting. For some reason this mix seems to require the SQL port to be manually defined when connecting to any named instance.
The fix is to specify the port in the server name used in the Connection prompt. So if your SQL instance was called SQL02 and running on port 3433, you’d use “MySql2005Server,3433 \SQL02″.

If you don’t know the port that SQL server is running on (maybe you have an external vendor supporting SQL), you can connect to the server from a Windows XP machine and run,
netstat -a | find /i "mysqlserver"
This will show you the network connection from your machine to the SQL server and the port being used.
Using PHP exec() with IIS6
There are a few work arounds I’ve found since having to use PHP under IIS6 and Windows 2003. Every now and again I come across something that just doesn’t work the same way with this variation of web server, OS and PHP.
I needed to double-check the DNS hostname being reported from users on an internal website. Our DNS is a little scratchy when it comes to scavenging and keeping itself tidy, so often a DNS lookup of the client IP will give an incorrect name. This happens especially for laptops that hop off and on wireless APs.
So to compare against DNS (and because it’s an internal site) I thought to query the machines NetBIOS name with,
exec("nbtstat.exe -A 123.123.123.123",$r);
and that quickly fails with an error about “failing to fork”. Essentially this means, PHP can’t do what you want.
It boils down to file permissions. you need to run cmd.exe and nbtstat.exe with that single command. Both those files are secured against non-system users – probably rightly so too.
To resolve, just allow your IUSR_SERVER user to have read and execute permissions on both those files. Your exec() command should now be working.
REMEMBER: You are responsible for the security of your server. If you really don’t need to let programs run on your web server, then don’t.
Watching your Network Usage
I’m sure everyone else knows about the iftop tool, but it was new to me. I needed to confirm that traffic from DRBD was using a particular interface and iftop does the job by showing traffic sources, speed and culmulative data counts per interface.
Missing Network Interfaces in Ubuntu Under VMware ESXi
Every now and again I clone a VM and add it to another host. ESXi prompts you for a new UID when you start the VM and I always remove the virtual network card(s) from the machine and re-add them later. I do this to make sure I don’t have two machines with the same MAC addresses on the network. But if you do this with Ubuntu, the new NIC(s) don’t get picked up by the OS. This is almost certainly not specific to VMware or their ESXi product, it’s just the environment I’m using.
This problem seems to be caused by a lack of automatic hardware probing at boot, probably for a good reason but I’m no Linux kernel guru so won’t make a judgement there. The root of the issue is located in the file /etc/udev/rules.d/70-persistent-net.rules where you’ll see the old interfaces still listed alongside the new ones. Simply remove the old NIC(s) and ensure the new ones have the MAC addresses you expect and the correct ethx labels. Give the system a reboot and you should be happy.
Steps to resolve a missing network interface in Ubuntu 10.04 Lucid Lynx (and possibly earlier):
- sudo nano /etc/udev/rules.d/70-persistent-net.rules
- Delete the lines with the old interfaces after comparing with your VMs newly assigned MAC addresses.
- Confirm the interface names are what you expect at the end of each line.
- Ctrl-X to save and exit.
- sudo shutdown -r now
- Run ifconfig to confirm the interfaces are up with the correct IPs.
- If the interfaces are up, check your /etc/network/interfaces config to adjust IP settings as required.
Installing VMware Server 2.0.2 in Ubuntu 10.04
After updating my trusty old server to Ubuntu Lucid Lynx 10.04 the installation of VMware Server 2.0.1 started giving problems. Resinstalling VMware didn’t help as I was repeatedly getting compilation problems in vmmon and vmnet modules. Luckily I stumbled across the following process from one of the VMware forum pages which pointed to a great work-around from the radu cotescu site.
So I take no credit for this but simply repeat it here so that the search gods may recognise it’s usefulness and +1 it’s importance.
Start by downloading VMware Server 2.0.2 from the official VMware site. If you haven’t already got a few licenses, get one now. (They’re free so you might as well get a few) I’m going to assume the downloaded file is in your home directory.
You also need to update the header files for your current kernel so that the configuration scripts from VMware can build the appropriate modules.
sudo apt-get install linux-headers-`uname -r` build-essential
Now just run the following commands.
cd /usr/local/src sudo wget [http://codebin.cotescu.com/vmware/vmware-server-2.0.x-kernel-2.6.3x-install.sh] sudo tar xvzf raducotescu-vmware-server-linux-2.6.3x-kernel-592e882.tar.gz cd raducotescu-vmware-server-linux-2.6.3x-kernel-592e882/ sudo cp /home/<your_username>/VMware-server-2.0.2-203138.i386.tar.gz.sudo tar xvzf VMware-server-2.0.2-203138.i386.tar.gz sudo chmod +x vmware-server-2.0.x-kernel-2.6.3x-install.sh ./vmware-server-2.0.x-kernel-2.6.3x-install.sh
If you have a previous installation of VMware Server, you’ll be prompted that it’ll be removed as part of the install. Don’t worry, any guest VMs you had should still be there afterwards. The script will run through the usual prompts and you’ll see references to the patched files from Radu Cotescu. After a few minutes you should have a working install of VMware Server 2.0.2 on your Ubuntu 10.04 server.
LDAP in PHP on IIS6
If you’re struggling to get the LDAP extension to work in PHP and IIS6 then you may want to read on. In my situation both the web server and PHP were confirmed to be working fine and reading the correct php.ini. But even with the correct line enabled in the php.ini file, LDAP would refuse to show in phpinfo() output.
After some searching of my own, it turns out that IIS6 on Windows Server 2003 (possibly XP too) will not properly read the PATH variable. So if you add the path to your PHP directory to the end of PATH, the DLLs required are still not found. This looks to affect IIS6 specifically as filesystem calls to the same DLLs did find them.
The solution – add the path to your PHP install to the start or earlier in the PATH variable and restart IIS. In my experience you will now see the LDAP options appear in your phpinfo() output.
Running WordPress & PHP Behind ISA Proxy
Some things work well on their own but when mixed make your life hard. Things like Linux and PHP work very well. Microsoft ISA proxy also does a good job in a corporate MS environment. But making the two work together in a controlled environment can be an exercise in frustration.
In this post I’ll pass on the methods I found to get PHP and your Linux boxes talking out through a corporate ISA proxy server. You can then bring in RSS feeds, updates and other things in WordPress and use apt-get to update Ubuntu. Read more >>
Using 7zip in Cron Jobs Fails
For those people tearing their hair out trying to use the 7z util in a cron job, have a look in the Ubuntu forums for the solution. Strangely as soon as you start sending the output to a log file, the 7z part of your script will work.
I struck the problem in the Hardy version of Ubuntu Server.
MySQL Replication on Ubuntu with DRBD
I’ve been looking around for some easy and open-source ways to handle database replication for a handful of small but important MySQL databases. A few options were viable but usually included too many config changes for things like creating a new database. DRDB on a Linux server seems to be one of the fastest and easiest methods to handle database synchronisation for DR purposes, so this is the subject of this post. The content is a combination of two main sources from Mark Schoonover and the Ubuntu server guide and the gotchas I found along the way.
This post will show you how to create two MySQL servers that automatically replicate all their databases using DRBD. With Heartbeat installed on a third machine you’ll have basic fail over protection as well (we’ll do this in another post). Only one of the database servers will be active at any one time. Read more >>
MS Exchange Local vs Hosted vs Google for 10,000 Users
After looking at some comments around Exchange Hosted Services, I thought I might do a quick (and very dirty) comparison between that and Google for 10,000 users. (This is no way reflects on the three options and may not resemble your reality).
MS Exchange Hosted Services would cost US$90k/month for company with 10k email users and selecting roughly half the options available (Communicator and Hosted Archive being two). That sounds really pricey vs local in-house servers and admins? I have no specific Exchange knowledge but say 20 servers across 5 virtual hosts, plus storage and backups is roughly NZ$350-400k as a one-off cost. Plus a team of seven admins to run it @ NZ$80k pa each is a five year cost of around $2.8 million, but lets say $3.2M to round it up to include a few software licenses and some power,cooling and floor space.
Google’s offering that I compared MS against is their Premier Edition of Apps. It’s US$50 per user per year and offers the usual email, calendar, resource booking, etc much like Exchange. I was expecting a few missing features but was surprised to see BlackBerry Enterprise Server (BES) synching and user and group provisioning APIs. It integrates with LDAP and offers Single Sign-On (SSO) so most of your users won’t see too much of a change – especially if they keep on using the Outlook client. The main issue for some businesses may be the 99.9% uptime guarantee – that’s 8h 45m down time per year. I’m sure there are a few features that Exchange holds over Apps but in many situations the cost may outweigh the benefit or it’s just not needed. Using Google Apps also unties you from MS Outlook and possibly MS Office, so this option may open the door to other savings.
So over 5 years for the 10k user company we have the following options:
In-house MS Exchange with 20 VMs, storage and 7 admins = NZ$3.2M
MS Exchange Hosted Services with a mid-tier option seclection @ US$90k/month = NZ$7.4M (at today’s exch rate of 0.72)
Google Apps Premier Edition @ US$50 per user per year = NZ$3.5M
Now one stands out there and not for a particularly good reason. The MS EHS option does include Communicator and Hosted Archiving as an option but I don’t see the extra value over staying with what you have or sending it all to Google. Add to both the off-site options, the project costs of actually implementing this and your own Exchange would have to be in a bad way or have some serious pain to go either way.
What are your thoughts on this one? Are my locally run Exchange costs way off for 10k users and are there any NZ based companies of a similar size (NZ Post’s 2100 users are on the way to Google Apps) that have taken either remote option? Is Google half the service or twice the value of the MS offering?
My last thought would be – just how reliable is that internet connection of yours?
Blog Categories
Recent Stuff
Similar Posts
Twitter Updates
- Working on 3G this morning via tethered ICS. Thank goodness for VPN and RDP among other acronyms
- RT @rmi: Competition is something that happens to people who can't afford to buy government. It doesn't affect telcos.
- We're new in the "Glen" but just found the local chippy is great. And downpour waited until we were driving home from picnic dinner. Nice
- @daihenwood I've got an older Nexus S with ICS. iPhone seems criplled now. Recommend a Google native experience cmpd to Galaxy S2,etc
- RT @AnonyOps: #Germany protests, #Greece burns, #Syria bleeds. #America watches the #Grammys.



