If you want to save the hassle of upgrading Drupal 7 core from say, 7.4 to 7.7, you can install Drush and then use it from SSH to back up your site and then update core with the follwoing command:drush update
Just make sure you’re in the directory of the Drupal installation you want to update.
Linux Archive
Windows Network – make your life easier and move to Linux
Traditionally a Linux server was a nightmare to administer. You needed to know the ins and outs of how the hardware and software worked and then had to remember complicated commands to get the system to do anything. With Windows it was much simpler – everything is done by wizards and windows which are easily found by navigating around the window based system – much simpler and you didn’t have to remember exact complex commands as everything was contained within the wizards. You also didn’t need an exact understanding of how things worked – just how to modify things to get them to do what you want. But how have things changed?
Well, our company is still using the same Linux server we were using 4 years ago – the second hand server only cost £75 back then and of course the Linux distro on it was free – with other networking bits and some hardware failure that means we’ve provided a small business network at a cost of around £50 per year. Any manager would be happy with that. But what about the administration – has my life been much harder keeping this bargain network up and running? Simply put – no.
I was just downstairs on the customer services floor and noticed one of the printers had stopped. This usually happens with that particular printer when it has jobs in the queue but hasn’t had any paper in it for a few days and the printer tells the linux server it’s gone offline. With a Windows server all you would have to do is to find a spare PC, load up a Remote Desktop session and check out the problem. With Linux – even easier.
In this case all I needed to do was get my iPhone out of my pocket, load up Safari, log into Webmin on the server using our wireless network and with a few clicks taps put the printer back online. Before I’d even had chance to put my phone back in my pocket the printer was spitting stuff out again.
How can anyone claim Windows is easier to administer than Linux?
Windows 7 – my thoughts
My company is a fairly small one that has a very simplistic network, a few broadband connections and PCs with mainly Windows Home based machines because they do everything we need them to. This means that we just upgrade the OS when a PC is at the end of it’s useful life or when we get new staff. As a result of our expansion over the last year nearly all of our staff are on Windows Vista. The only exceptions are me (Head of IT) and Mike (Graphic design). Due to our jobs you’d think that we’d be at the top of the list for an upgrade but due to us having much faster PCs to begin with and having a better level of computer knowledge so we can keep them running better for longer, so we’ve stuck with our now aging XP machine. Until about 3 months ago that is.
At that point my Windows XP laptop was starting to suffer from various hardware problems – fans starting to seize and cause shutdowns, network failures for no reason, nasty wirring from the harddrive on occassions. This led my boss to give me a shinny new Vaio (VGN-FW48E if you’re interested) with Shiiny Vista. I would have been happy to stick with XP as that bit everything I wanted and had become stable and reliable to the point where it just ran and ran, day in day out. Unfortunately everyone in the office is on Vista and keep asking “how do i…” and the reply “how should I know – I haven’t got a new PC” apparently doesn’t count as quality IT support, plus XP is quite old now and although I was happy with Windows 98 at the time, things change and you eventually have to get up to date.
So – Windows Vista – what’s it like. Well…. everything has moved around to make it simpler for novices, making it annoying for me since I knew where everything was, plus now I can’t have access to all the advanced settings we used to have. UAC is a bit annoying – it’s like Health & Safety – just because some people are idiots who can’t but one foot in front of the other without having an accident, we all have to suffer.
What else? Ah yes – it’s looks have been overhauled and it does look very good. Gone are the playgroup colours and images, it’s now a lot sleaker looking and modern. But…. if you’re after something that looks good – why Windows? A Mac or even most Linux distros look well better than Windows, can perform the same tasks and in the Linux case – are free. But hey-ho, it’ll do for now.
Anyway, after a month or two of playing with Vista it became time to receive my free upgrade to Windows 7 that came with my laptop when I bought it. The actual upgrade was smooth enough – uninstall this, run that, re-install that. Then it was time to go – so what’s it like. Well, there is yet another facelift but as mentioned before – it’s not all about looks, personality counts too. So what else has changed?
I like the taskbar and quicklaunch changes – that’s a very nice improvement. However, as I have Firefox pined to the taskbar, it took me ages to find out how to pin it back to the start menu and as a massive fan of keyboard shortcuts (Win + down + enter to get Firefox up) this was really annoying.
So, what are my overall thoughts after my swift upgrades from XP through Vista and onto 7? Well, Microsoft – listen up! You’re not a government – you don’t have to force your “Health & Safety” policies on us all! After digging around you can turn all this crap of and find the advanced tab we were looking for, but don’t make it so hard! Turn on the security by default for the novices but have an Experienced user account for the computer professionals that easily lets us use our PCs the way we want.
Default VirtualHost in Apache 2.2 won’t change
Ah, more problems configuring a 1and1 Dedicated Server. This time it was getting up the proper holding page I wanted for any unused domains. By “Unused” I mean domains that are pointed at the server but have no website attached to them and therefore have no VirtualHost container within httpd.conf.
I’ve read through the manual and various other tutorial sites several times and still couldn’t find where I was going wrong. Instead of getting my simple company branded holding page I got 1and1′s holding page (but hosted on my server). I eventually gave up on trying to re-write my httpd.conf and instead did a search for the text “http://www.oneandone.co.uk” which was contained within the HTML document used in the holding page. You can search the drive using:
grep -R “http://www.oneandone.co.uk” /var/www/*
Among a few other files the main one I noticed was a file contained in the /etc/httpd/conf.d folder containing the apache configuration for Pleask and since this is loaded into httpd before any of my directives, this was causing the VirtualHost container I had created as default to be overwriten by a Plesk one which is higher up the series of config files.
Since I don’t give a crap about Pleask I just moved the file out of the conf.d folder and restarted apache and all was fixed!
Windows Vista vs Fedora Core 8
A few weeks ago I was taking a look at Windows SBS 2003 vs Fedora Core for using in the office as a primary all singing, all dancing server and for my particular needs, Linux won. Since then I have had the chance to spend a few days having a first look at Windows Vista and Fedora Core 8. This was not an intentional thing, I’d downloaded Fedora to install on the box I’d set aside for the new server and instead of going for the minimalist text based installation, I installed it as a usable desktop machine as well. At the same time I was given a couple of laptops running Windows Vista Business to set up for a remote user, plus a spare that I’m hanging on to so I can support Vista. This means I’ve had a chance to play with fresh installs of both, trying them out for the all major things an OS does:
- Setup and configuration
- Intuitivity of UI, usability and increasing productivity
- Software installation and built in functionality
As with the previous article, this isn’t meant to start a massive OS war in the comments section. I like both Windows and Linux and my choice of OS is only determined by the job that particular installation will be performing: I wouldn’t try and use Linux as a home entertainment/gaming machine and I wouldn’t use Windows as a web server. It’s just an evaluation for a particular task: a desktop machine for a Web Developer to use during the day, i.e.
- Browsing the web, checking email and various other standard Internet tasks
- Coding and testing of said code (usually on a separate machine)
- Dealing with other standard document types (.doc, .xls, .pdf etc)
- Listening to the radio online or MP3s when it’s quiet
As far as this goes, it’s a pretty even match. Anyone doing my job can easily install either Windows or Fedora and have it up and running within the office network without any issues. The Fedora installation procedure has come a long way in recent versions and it’s much simpler for the novice than it used to be. Windows is also a breeze and even though this one came pre-installed, looking at the various screenshots and reviews, the most trouble a novice would have would be getting the PC to boot from the right media.
So, UI, usability and productivity. This is again a tie in my book. Both operating systems are based around principles we’ve been working with for nearly 20 years such as Menu (Start or otherwise), Task Bar, Windows etc…. Which ever OS you use, they’re all there in one place or another and the only complication is finding the bit you’re looking for. For users such as myself where getting to know new software interfaces and systems it’s not something I worry about. I’m going to skip productivity at the moment as this is something that is affected by a number of factors:
- The software you’re using to do a particular job
- Dealing with bugs and cliches when or if they crop up
- Intergration with other systems used in your particular environment
The only one I will touch on is the last point. In the SME and in particular within my job role, we tend not to use a whole raft of Windows and Office technologies all interconnected with various Server and Client technologies. From this point of view, the need to be on a Windows platform is minimised and the technologies we employ all have open source equivalents that can be used in a mixed environment (Samba etc).
After a week of testing, I’ve come to a few conclusions:
- Fedora is a very good operating system but unless you have a specific need, there’s not too much to tempt me away from the safety net you get by running everyone on Windows. If you need to upgrade and want to save a bit of cash, take a look though.
- Windows Vista has some good user improvements and a very refreshing UI. Unfortunately after 6 or so years I was hoping for more of a leap from XP than a new paint job. If we get new machines running Vista then that’s fine but otherwise, I’m not forking out for it
Windows SBS vs Fedora Core
Before I start this is not intended to be the usual argument between the Microsoft and Linux camps but more a desription of my findings when I had to evaluate the two products for use within our office as the main server. Our office network is currently of the usual standard you’d find in a small 5-10 person company that doesn’t have an in-house IT person:
- All internet traffic is routed through the ADSL router with no management and for the large part, static IP addresses
- Printers shared on which ever PC they were configured from first
- PCs with no password on the user account
- A random mixture of different versions of Windows and Office
I know this shouldn’t be the case with me being the in-house IT “professional”, but my main job is to develop and maintain several enterprise quality websites. This leaves me with very little time to devote to my additional role as IT Manager and Sys Admin so up until now as long as everyone good do their job on that particular day and as long as none of the office IT equiptment had smoke and flames billowing out of it then I considered that part of my job a success.
Unfortunately the MD has thrown a spanner in the works by setting us all a set of goals that will allow our company to function at it’s best and also to grow over the next year or so. This is normally fine by me as it’s the kind of mission critical memo that I lovingly file away in the “Deleted Items” folder before getting on with some serious Ajax coding. This time is a little different though as he’s made our bonuses dependant on the goals being acheived. There’s a few bits and bobs in here that I’m not going to include here but for the most part they boil down to:
- Reliable uptime of printers, file storage and internet connection for all office PCs
- Backup of all files and email that can be recovered with 1 working hour
- Document collaboration for both onsite and offsite staff
Now my initial reaction was to head off to Dell and spec up a shinny new server running Windows Small Business Server 2003 to take advantage of the combination of Exchange and SharePoint but after taking into account some of the PCs are running old versions of Office (there may even be an odd Works and Outlook Express installation) and a few Windows XP Home, by the time everything was upgraded to XP Pro and Office 2003/2007 plus the server it was a bill upwards of £2000!
For a small business of 6 employess that is a bit steep by anyones standard so I did the obvious and headed off into the Linux world. I’m not a die hard linux fan by any means. I like it a lot – where it’s appropriate, but I don’t use it on my desktop – I’m on XP Pro. Neither will I use windows all the time – I don’t have a single IIS or SQL installation (L.A.M.P all the way!) but Linux is cheaper if you can do it yourself. That’s where businesses of our size have to find the trade off: you don’t want to be paying a consultant or your IT staff more than it would have cost to get a Windows server up and running.
In the end I weighed up the pros and cons and made the following decision: Linux this time based on the following:
- Fedora Core 8 running on a P4 1Gb box
- Leave the email running on our Web Hosts SMTP/POP3 servers
- Configure all the usual DNS, DHCP, Samba, Firewall and routing servers so that they worke just as though we’d forked out £2000 on Windows SBS
- Install OpenOffice and O3Spaces (or similar) on every machine
So thats the plan. The moral of this (as usual) long winded rambling and unnecessary story? Find the solution that fits your needs and budget. Time to implement it and then report back!
1and1 Dedicated server and PEAR
I’ve recently had to do a complete reinstall on our 1and1 Root Linux server which is easy enough in itself as it’s just a case of going into the Control Panel and hitting Server Re-Image alogn with your choice of operating system. I went for Fedora Core 6 and within an hour everything was up and running. Within another hour I had my files uploaded (4Gb including images), MySQL databases loaded and my custom httpd.conf loaded. After that I thought the only hard bit would be the extras I had installed but with a quick “yum install ImageMagick” and “yum install webmin” then using Webmin to set up the firewall properly, everything was good to go.
With the sites back up I just needed to do a few quick checks to see if various bits of the website were working. Everything was fine except for PHP sending out emails. I knew that newer versions of Fedora were supposed to use QMail and not Sendmail so I headed off into the system to see if I could track down the problem. After a bit of messing around it seemed the mail server was fine (even with the MTA set as QMail) but nothing would be sent out using PHP. By saving the MTA to Sendmail I could get emails out using the mail() function but not using PEAR’s Mail package. Enabling ErrorReporting on one of my scripts threw up the errors:
Warning: main(Mail.php): failed to open stream: No such file or directory in
/var/www/html/email.php on line 15Fatal error: main(): Failed opening required ‘Mail.php’
(include_path=’.:/usr/local/share/php/pear’) in
/var/www/html/email.php on line 15
I then loaded up a phpinfo() script and noticed the following line:
–without-pear
For some reason they’ve decided to be overly cautious and install PHP without PEAR support so even though PEAR was showing as being installed and commands such as “pear install Mime” were working, something with PHP was a bit pear shaped (get it, arf arf!). It turns out that the solution is simply to open up /etc/php.ini and add the following line:
include_path=”.;/usr/share/pear”
Everything seems to be working now, a bit more testing might be in order though
Access Network Shares over the Internet
Note: I tend to ramble and build up to the point by painting a wonderful picture in words… Straight onto The Point
I tend to have a slightly complicated setup at work as far as my files go. For the most part, it’s the same as anyone else’s. Email in my email client, documents in My Documents and shared stuff on the central network share. Bu the files I spend most of my time on are stored on another server. The setup is something like this:
- Desktop running Windoze XP with a Network Share mapped to X:
- Linux box running Redhat with Samba and a username/password protected share with all my web files on it
- Dreamweaver accesses the network share and FTPs to a range of production servers when ready
There’s a couple of reasons for storing everything on a central Linux box and not on a local drive:
- They get included in an automated backup routine that backs up all remote and local files into one archive to be moved offsite on my laptop
- The root directory of the Samba share is also the root directory of the Apache installation so I can test stuff locally
When away from the office I tend to FTP to the production server I want and make any changes, FTP them back and then either email myself a reminder to download them when I get into the office or Remote Desktop in and download them straight away. This has always worked and although it’s a bit of bind, noone likes working on the weekend so it means I don’t fire up my laptop to do little bits of bug fixing or whatever on a quiet Sunday.
This morning though I got an email off the MD saying I could do with a new desktop and he’d a catalogue through with a few offers in. I put the kettle on and headed over to www.dell.co.uk to see which ones he was on about. Unfortunately by the time I’d added the options I wanted (RAM, Dual Screen) it was about twice what it was to begin with. I’m now trying to convince him on a nice single monitor spec but with a 22″ wide screen TFT instead, but that’s a bit off point (I haven’t even got to the point yet, but hey!).
While I was waiting to see if he was willing to re-mortgage his house just to buy me a new PC, I thought I’d have a look at improving the rest of my work setup and that’s when I decided to find out if I could access the network share from home as well. I so couldn’t be bothered with a VPN so after a bit of Googling about other options I decided the easiest optikon was to set up a SSH tunnel and send all SMB (port 139) traffic through that.
The Whole Point Of This
Here’s a step by step guide of how you do this in case you want to access Network Shares accross the Net. If some things are called slightly different things on your machines, don’t worry, that’s just because I couldn’t be bothered to look at what they were called, I’m just doing it from memory.
- Boot up the PC that you want to access the Network Share from, i.e. accross the Internet (call it the client)
- Go to Start > Control Panel > Network Connections
- Open any of your connections and go to Properties. Click on “File & Print Sharing” and hit Unistall
- Reboot (only time, honest)
- Download and save Putty
- Open it up and enter the address of the server which has the network share on it*
- Go down to SSH > Tunels and in the Source box put 139, then in Destination put yourdomain.com:139 and hit Add
- Go back to Session and Save. This just makes it a double click to load up next time
- Connect, enter your username and password for the server
- Go to My Computer and go Tools > Map Network Drive
- Choose any drive letter you want and then in Folder put \\127.0.0.1\sharename (plus any username and password info you need
You should now have access to your remote Network Share from wherever you are! The speed will depend on the internet connections at both ends plus how busy the net inbetween is. For loading up and editing the 12K PHP files I use, it’s perfectly fine. I’ve also copied accross a 22M zip file but was writing this so didn’t see how long it took. I’m now copying across a 540M zip file to see how long that might take (I’m guessing about 20 times faster than doing it through Remote Desktop) [took about 3 and 1/2 hours on 512kb connection].
I haven’t mentioned security here. SSH means that while copying files across you’ll be pretty safe but I’ve gone the whole hog and blocked SSH acess to everywhere but my home IP just to make sure (no, this isn’t my work or home server). It’s up to you how far you go on the security.
* I’m assuming you’ve got a share running, a SSH server running and can open up SSH traffic to it through your firewall as well as all the necessary security/authentication
1and1 Root Server in German
We’ve got two of the Dedicated Root Servers from 1and1 and one of them has been in German since it was set up. This would be great except the only German I can remember is how to ask for beer.
If you’ve got one and would like it to talk to you in English instead, here’s what you do:
- Install Yum or some other method of getting updates or RPMs
- Install system-config-language
- Run system-config-language
- Choose English and hit OK
All your system messages should be in English now.
AJAX Online Document Storage
I was asked at work to create a simple filestore online to store various files that needed to be accessed by various members of staff around the country. The basic requirements were:
- Password protection
- Checkin and checkout facility for each file
- Basic usernames to track who has what
- Windows explorer style folder structure
- Upload new files, create folders and delete files or folders
Since I’ve been getting in AJAX recently I thought I would do the entire thing using it, obviously with PHP doing the background stuff. There was no real advantage of using AJAX, it was just a new project and was easily done in AJAX.
I’ve finished and tested it all now and everything is working quite well. I’ve just got to comment all the code and then I’m going to stick it all online for download if anyone wants it.
Edit: 17/07/2007
AJAX Document Store Code