Local Home Network DNS – how hard can it be?

So I wanted to do something I thought would be fairly straightforward.  I have a home network with a PlusNet-provided Technicolor Gateway router and behind that I currently have my (Windows 7) laptop and my HP Proliant Microserver running Lubuntu.

In addition to a media server I want to use my Lubuntu box as a development environment for multiple websites, but I want to be able to access each website from the laptop.

Running multiple sites is easy enough with Apache’s Virtual Hosts feature, and I can configure the /etc/hosts file on my server to let me access them locally.  However I want to be able to do the actual work /testing on my laptop (for starters) and have an easy to remember name for each of the virtual hosts.

So here’s what (I think) I need to do:

  1. Install Apache (and PHP/MySQL) and configure the virtual hosts – check.
  2. Set up a DNS server on my server
  3. Configure the laptop to query that server for DNS (preferably through the router config so it applies to the whole network…) let’s come to that later.

Piece of cake, right?  Read on for completion of step 2.

Continue reading “Local Home Network DNS – how hard can it be?”

Adding DNS Server to Lubuntu 12.04 with Webmin

I’m trying to set up my Lubuntu box as a test server for some web development (PHP) work and have decided this means running a DNS server so I can set up my own domain names (site1.local, site2.local etc).

A quick Google suggests installing and configuring a DNS server manually could be painful, and it looks as though the simplest way to do this would be to use Webmin*, a web based interface for administering Unix-like systems.

Unfortunately when I followed the Webmin install instructions I got an error telling me that:

W: Failed to fetch http://webmin.mirror.somersettechsolutions.co.uk/repository/dists/sarge/Release Unable to find expected entry ‘contrib/source/Sources’ in Release file (Wrong sources.list entry or malformed file)

W: Failed to fetch http://download.webmin.com/download/repository/dists/sarge/Release Unable to find expected entry ‘contrib/source/Sources’ in Release file (Wrong sources.list entry or malformed file)

Looking at the messages you can see it is failing to find some files called “sources”, which explains why the solution I found at SuperUser worked.  Just tell apt-get to stop looking for sources!  When you add the repositories in the install instructions, it looks like Linux is adding the corresponding source repositories, when all we really want are the binaries to run the program.  So you can either manually edit /etc/apt/sources.lst and comment out the offending lines (which should be at the end of the file and prefixed with deb-src) – or you can use Ubuntu’s “Software Sources” utility and just remove them.

Now you can run apt-get install webmin again and it should be fine.

* Actually, the simplest way is probably to just edit the HOSTS file on my laptop(s) as I’ve done previously, but I’m trying to do this in some way ‘right’.

Solved: New WAMP Install Won’t Parse PHP

I spent ages trying to figure out why my new installation of WAMP Server 2 wouldn’t parse my PHP and was spitting it out exactly as-is in the source file. I hoked around in the VirtualHost configuration, because the PHPMyAdmin that comes with WAMP Server was working fine so it had to be something wrong in the VirtualHost that I just configured that was stopping .php files being sent to the PHP parser, yes? No.

As it turns out, it’s much simpler than that. Apache was sending the file to PHP to be parsed, but PHP was ignoring my code. Why? WAMP Server 2 comes with “short open tags” turned off (this may be a general PHP or PHP 5 thing, though not sure). Click WAMP -> PHP -> php.ini to edit the aforementioned file and find the line:

short_open_tag = Off

Replace Off with On et voila.

The ‘more correct’ though long-winded solution is to replace all your <? opening tags with <?php if you’re really keen (though that’ll also mean replacing <?= with <? echo). Me, I think I like my short tags.

WordPress / Fantastico Server Move

I recently moved this site to a new host because of ongoing problems with my previous hosts. Thanks to some intermittent database errors I’d decided it would be prudent to do my first backup in some time at the start of last week. By the end of that week they’d deleted my account, so I suppose I should be grateful their database server was so f**ked. Nevertheless, the move caused a few issues when my new hosts told me the complete backup I uploaded to them was corrupt. I can only assume (because some backups were corrupt and others weren’t) that it was due either to encrypting the archives using AES in Winzip or decrypting them in 7zip.

Anyway, that meant manually creating the accounts, setting up the mail accounts and subdomains in them, extracting the root folders (public_html, mail etc) individually and manually importing the SQL backup. Everything was relatively painless (if dull) however Fantastico wouldn’t recognise my WordPress installations (I had two). To persuade Fantastico that there really were a couple of WordPress blogs I had to do two things:

  1. Extract the \.fantasticodata\WordPress files from the zip (in this case it was called nerd.steveferson.com| ) and upload it to the same location in the FTP server. Of course that bar | made Windows barf, so you’d need to rename it (e.g. using an underscore instead) and replace the bar after uploading it via the FTP client (FileZilla didn’t seem to have a problem doing this).
  2. I think this is might be because the blog’s in the root of a subdomain, but I also had to upload a file called installed_in_root.php from \.fantasticodata to that location on the server.

Once I did this, Fantastico picked up the blog and allowed me to upgrade WordPress to 2.5.1 – no hassle.

What’re you lookin’ at?

Well I thought it was interesting so here’s the top 10 posts on nerd. by number of views (based on the last 500 page hits courtesy of Statcounter.com).

  1. Review: Why the Netgear WG311 v3 Sucks (72)
    Slightly dodgy network card that Netgear don’t seem that fussed about fixing. Bad on XP, it got worse on Vista (see number 4).
  2. Playing iPod Video on Your TV (45)
    Seems to be a lot of people looking for instructions for the iPod Classic. Here’s a tip: sell it.
  3. Server application unavailable: installing IIS on .NET 2.0 (44)
    Seems to be a common problem. Sadly Microsoft’s error message is about as relevant as ever.
  4. Installing Vista (AKA More Netgear WG311 Misery) (31)
    Even more messed up. Thank goodness for Linksys!
  5. Thunderbird/Outlook/Google Calendar Integration (25)
    How to integrate your Thunderbird calendar at home with your Outlook in work, via Google Calendar.
  6. Orange Answerphone (Voicemail) Number for PAYG (23)
    Such a simple problem. Who knew it would be so hard to find?
  7. Stop Monitor.exe Hogging CPU (20)
    Why can’t people just give you a standard installation instead of trying to do everything for you? Help sounds good, until their useful tools start killing your PC.
  8. How to run IIS Web Server in Windows XP Home (20)
    Microsoft’s official line is it can’t be done, but it’s not that tricky.
  9. Making Firefox Scroll With Syanptics TouchPad (19)
    Discovering the solution to making Firefox scroll on my Acer Aspire laptop.
  10. NAS or Home Server (17)
    I deliberate over whether I can justify spending the extra to build or buy a home server before eventually deciding that a Linkstation Live will meet my needs for less than half the price.

More aspnet_regiis Goodness – this time on Vista

Some time ago I published a blog describing the use of a command line tool called aspnet_regiis.exe to overcome a “Server Application Unavailable” message when I was trying to get ASP.NET working on IIS 6 on Windows XP.

Just now I’ve used the same tool to fix a similar (I think) problem on IIS7 on Vista. I was trying to get some practice with ASP.NET. I’ve already got IIS7 and I’ve already got the .NET Framework 2.0 installed. However it seemed, again, that IIS wasn’t aware of the Framework’s existence. When I tried to browse to a simple Hello World page I was greeted with an HTTP 404 (404.3 to be precise) informing me that:

“The page you are requesting cannot be served because of the extension configuration. If the p age is a script, add a handler. If the file should be downloaded, add a MIME map.”

Despite the different error messages it appeared to be a similar problem. Apparently it was. That wonderful little solution again:

  1. Start -> Cmd
  2. Navigate to your .NET Framework directory (e.g. C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727)
  3. Run the command “aspnet_regiis.exe -i”
  4. Wait…

Server application unavailable: installing IIS on .NET 2.0

I feel so dirty, but for a project I’m working on at the moment I have to use ASP.NET instead of PHP; “why?” is a question for another day. Anyway, I’ve installed IIS before so that wasn’t a big problem… or so I thought.

I already had the .NET 2.0 framework on my XP machine so went straight to installing IIS (5.1 comes with XP Pro). It installed easily enough and my hello world html file was served without any major problems (actually that’s not true, before I copied my own files across I tried to check the IIS default pages served ok only to discover, through more googling, that if I used IE instead of Firefox that annoying box asking me for a password would go away).

Now my ASP.NET issue. I got a Server application unavailable error message in big red letters when I tried to run any .aspx (ASP.NET) scripts and couldn’ t figure ou t for the life of me why. The Event Viewer, where IIS errors are logged, gave little more by way of help: Failed to initialize the AppDomain:/LM/W3SVC/1/ROOT

Err… What?! I worked out that it wasn’t affecting html pages, just ASP ones – and only .aspx ones at that, suggesting it was .NET-related.

As it turns out the problem was that I had installed .NET before IIS. It’s easy enough to fix, but it took 20 solid minutes of googling to find the solution in a Microsoft community newsgroup (and then realise that I’d have found it already if I’d just read to the bottom of a 4 year old forum post I’d already found).

Anyway, what you need to do if you’re getting this “Server application unavailable” message is navigate to your .NET directory (something like C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727) in a command prompt and run the command aspnet_regiis.exe -i which will register ASP.NET with IIS. If that still doesn’t work, there’s always PHP.net 😉