Linux

Office 2007 MIME types for Apache

An interesting bug came up in the OWN Forums over the weekend, when downloading Office 2007 Word (docx) document from an Apache hosted site, the file either comes up garbled (application/octet-stream) or opens up a zip folder. This is usually the case when you have a mime-type and content-type mismatch and can get even uglier.. so what’s the solution? You have to define new Office 2007 mime types in your web server (or more precisely, server-side mime type database) so it knows how to communicate the content properly to the web browser. Office 2007 uses the new zipped XML OpenDocument format. After Googling for a few minutes and not finding the solution on the first four pages of searches I came to my buddy David Overton’s page – Now I remember where I read about the new Office 2007 mime types! I’m sure David will be extatic to know his hard work (which applies to IIS6 by the way) is now going to help Apache users everywhere get Office 2007 documents easilly. Joke aside, truth is Apache is the dominant web server and there is at least 70% chance you’re browsing an Apache site (you are right now, it’s what powers Vladville!) or about 98% chance if you’re not in a corporate environment.

Office 2007 mime types from David Overton.

First you’ll notice that there are many different mime types associated with Office 2007 OpenDocument format for just Word documents and templates: .docx, docm, dotm, dotx:

.docm = application/vnd.ms-word.document

.docx = application/vnd.openxmlformats-
officedocument.wordprocessingml.document
.dotm = application/vnd.ms-word.template
.dotx = application/vnd.openxmlformats-officedocument.

wordprocessingml.template

You can hardcode in one of these at a time, however, there is a shortcut. Just open your /etc/mime.types and add this to the last line:

application/vnd.openxmlformats       docx pptx xlsx

Restart the Apache service and you’re set. This takes care of the top three popular Office 2007 formats. If you don’t have access to the system mime type configuration (you likely don’t) you can always override the settings using your .htaccess file. Enjoy and thank David! Here is the end result:

Office2007mime

Extra note: Above applies to Apache servers hosted on Linux, however, if you host your Apache server on Windows the server distribution is likely shipping a mime configuration database in a specific path, one that you may or may not be able to find easilly. No worries, you can always add the content types directly to the httpd.conf file which is very easy to locate in most popular Windows Apache distributions such as Vertrigo. To add the new mime type directly in Apache httpd.conf (for Linux fans, /etc/httpd/conf/httpd.conf):

AddType  application/vnd.openxmlformats  .docx .pptx .xlsx

Please note that httpd.conf definitions override the /etc/mime.types definitions and dependant on the directory configuration, htaccess can (and usually does) override both.

Compiz and Beryl Merge

Perhaps one of the best developments in the Linux GUI world in quite some time, two of the biggest projects that bring eye-candy to Linux are getting together! If you’ve never seen Beryl in action just search YouTube for it, it will blow you away.

And just in case you’re thinking – so what, what kind of an idiot is impressed by the shiny objects? Well, how do you explain Vista and every single Mac user? UI usability is big, and this is a sign that things like Gnome and KDE now get to stand shoulder to shoulder with the others.

Good morning Microsoft Linux

Many predicted it would come, for years.

Many agreed it would make sense for Microsoft.

Well, they have.

And for days my phone has been ringing around the clock with reporters wanting to hear my opinion because I sit on both edges of the Linux-Windows musical chairs. Is this good for Microsoft? Is this good for Linux? Is this good for Novell? I won’t bore you with 30 pages of my opinion on this but I will help you find all the answers you’ll ever need on this subject:

Try to find a single Linux fan that is happy with this move.

Go on. I’ll wait.

Back so soon? Found nothing? Get the idea yet? No?

Alright, now find a list of companies that will benefit from this deal.

Go on. I’ll wait. Microsoft… Novell… anybody else?

That second task is more telling than the first one. Microsoft, known for its long tradition of great partnerships, has done it again.

Good intro to MySQL

Needed to get some air and clear my head.. so I went to the local Linux User Group (www.golug.org) mostly because its one of the few places I can go to without looking like a human being. No shaving, no haircut, no problem – dirty jeans and “I read your email shirt” and I’m out the door.

Kevin Korb presented a very nice introduction to MySQL and SQL in general. He has a writeup here. Take a look at it, the paper is a pretty comprehensive description of the basics to get you started. MySQL is a powerful SQL server and yes, it runs on Windows too. Check it out.

NTFS Partitioning Tool

Need to repartition your NTFS volume - resize, delete, move, format or delete for free? Even on a server? Check out Gparted.

Not a day goes by without someone that just got their shiny new Dell server with a 160 GB hard drive… and a 12 GB C:\ partition. Resizing the NTFS partition then becomes an interesting task of finding a piece of software that is still up to date yet certified for resizing volumes on a server. The process becomes so ambiguous that most just blow up the whole machine for a repartition and reinstall. It’s a frustrating search with many wrong turns and steep fees but there is this great tool that you can use, for free, to do it yourself. Yes, it works on servers. Yes, it works on domain controllers. Yes, it works on NTFS. Using Linux to fix Windows, what a concept. Check out this review of Gparted and burn yourself an iso for free.

SBS vs. Linux: The Response from Email Battles

Brief response to the Email Battles story titled “Why Linux Servers Trump Windows SBS”  which in turn was a response to my earlier story about “Linux vs. SBS: Switch”; Their outright ignorance of what SBS provides not only demonstrates lack of understanding of the SBS platform but also misses the mark on the features that small businesses expect these days. At one point they even state:

“A Linux whitebox running only Postfix, qmail or Sendmail is relatively simple to manage. Need another mailserver? No problem. Just pull out your handy hard disk cloner. You'll be up-and-running in less than an hour. Same goes for firewalls, fileservers, and the rest.”

Sendmail, recently pulled from OpenBSD for perhaps the worst security record of any SMTP server ever written, is offered as an alternative. Sendmail, postfix, qmail, zmail and other Linux alternatives are very well compared with the Microsoft SMTP Service that ships with every Windows server. To turn them into a functional mail server you have to deploy a pop3/imap server, roll out your own webmail package, setup an SSL certificate on Apache, etc. Comparing that to an SBS solution (a 7 step wizard) is not simply a sad joke but the proof that for the most part Linux guys may be as clueless about Windows solutions as Microsoft is clueless about Linux and Open Source. I’m just the middle-man throwing some gasoline onto the fire!  

Here is my comment on the Email Battles post, I’ve talked to those guys a few times and they really are awesome folks but we have a long way to go in educating people just what the difference between the platforms is and what the advantages are:

I think that (many) readers misunderstood my message. It is simply that Microsoft chooses to pick a fight on the merits it cannot justify (stability, security) but never seems to crush the opposition on the qualities that are simply not available anywhere else.

As is evident by many comments on my blog, most Linux people simply do not understand what is in Microsoft Exchange, why anybody would consider SBS instead of a full blown Microsoft Windows 2003 Server + Microsoft Exchange 2003, the author of this response included. Microsoft Exchange + Windows 2003 would come in at over $1600 retail for the 5 users whereas Microsoft Windows Small Business Server (SBS) retails for $599 and comes with an easy way to deploy Exchange in less than 15 minutes. Not even the most seasoned Exchange Administrators are capable of deploying everything SBS does that quickly.

While I agree that commodity whiteboxes with Linux may be cheaper you are trading off functionality and easy configuration. For example, any Windows user can easilly find out how to add the email address, or a user, or a shared drive, or a new web page, etc on SBS. Can they do that on Windows 2003 Server? Not likely. On Linux, even with GUI (which shouldn't be installed on servers IMHO?) - not a chance.

It seems to me that most passionate of zealots also happen to be least informed and most base arguments on what they may have experienced several releases ago. It is as if I based all my arguments against Linux on Redhat 7.1. I will be preparing a lenghty article on SBS vs. Linux in terms of features that the small businesses are asking for:

Mobile device sync
Secure, mobile mail
Fully functional webmail
Intelligent file sharing
Service monitoring with plain English descriptions

Some person today tried to compare Outlook Web Access with Squirrelmail. That shows such utter ignorance of the technology and such poor understanding of competitive solutions that if such a quote came during a job interview he/she would be out the door before they could even say HEY! As IT Professionals, whether we sit on the Linux or Windows side of the bandwagon, we need to be able to evaluate both solutions and not constantly stick to our almost fanatical religious views of operating systems - there is a place for Linux, there is a place for Windows. If we cannot live in that harmony and understanding then perhaps we are no better than Mac users.

-Vlad

Linux vs. SBS: Switch!

Excellent point brought up in the comments section today by Josh:

For example, Microsoft wants to argue about stability vs. Linux. In nearly all Linux servers we manage that comparison is laughable. Now, compare RPC-over-HTTP functionality with Linux? You can’t, no such thing on Linux! Where is that among the facts?

This is something that I’ve tried to make very painfully clear in my Linux presentations for SBSers in Florida groups. Here is the thing about winning in small business, you have to know your customers. You also have to know your Microsoft and understand certain “facts”. So here is a little competitive howto on Linux vs. SBS.

Watch Where You Get Your Facts

First and most important thing to understand about Microsoft’s Get The Facts site is that those reports have been paid for by Microsoft and are to a large extent questionable at best and outright false in many respects. Second thing to remember is that those reports are not written or targeted for the SMB market at all - they are written to discourage enterprise and high-end markets from moving their commodity-line servers to Linux and discourage Unix-shops from going to Linux instead of Microsoft. If you’re an SBSer, you will not find your facts there.

Know Your SWOT

Know your strenghts, know your weaknesses… but more importantly know what is not your weakness.

Price

When bidding against Linux you are really competing against this: “Joe Consultant told us that Linux is free.” They are correct, many Linux distributions are free. So in most cases, it will be $599 vs. $0. For the purchase price that is. So on the face of things, Linux wins because its free.

When you dig a little deeper you find out that the “free” is the acquisition cost. If you are losing a client over $599 this is likely a client that you do not want as your business to begin with. If the server costs $1,800 and your labor to set them up and train them for a week will cost them another $4,000 that up-front licensing cost of $599 is going to be less than 10% of the total solution. This is generally what Microsoft talks about when they mention their TCO, total cost of ownership.

But we know our small business owners, don’t we? The same folks that will sign up for a plan with a “free cell phone” (MSRP $99) but agree to a two year contract that costs $20 a month more. If you really want to compete against Linux give them a 10% discount on your labor which will outright displace the licensing costs. Show them that they will be paying the Microsoft penalty anyhow as its very hard to impossible to buy a PC without a Microsoft OS to begin with. 

Upgrades and Migrations

When you bid against Linux you bid against free upgrades, forever, and easy migrations. Thats at least what gets put on the paper and what the Linux guy will say. The truth is much different. Here are a few facts that you might want to consider about some of the most popular Linux distributions out there:

Fedora – Fedora is a free version of Redhat Linux. Redhat Enterprise Linux is a full tested and supported distribution of Linux that retails between $350 and $3000 per server. So whats the difference? Redhat uses Fedora as their bleeding edge distribution, they use it to roll out experimental packages and see what breaks. The software itself is solid, but it is not elegant by a long shot. For example, consider that there is no migration path from version 3 to 4 to 5 – if you Google for “upgrade from FC3 to FC4” you will find a number of hacks that show you how to fool the dependancy checks and hack your way up. Not that it won’t work, but what happens if it fails? Remember, unsupported. There is literally nobody you can call.

Debian – Used to be most popular but recently displaced by its Ubuntu cousin. The trick with Debian is that they are so fanatical about being free that they eliminate any commercial or restricted software (or non GNU) from the base distribution. It is a severly outdated technology (in terms of even years) that nearly everyone seriously running Debian is doing so with the untested– or experimental– branches of the code. Even if you’re not a Linux person you can imagine what thats like. Again, virtually unsupported except for the MVP-like effort.

Gentoo – The concept here is that this is the most optimized version of Linux you can get because virtually everything from kernel on up is upgraded by running an emerge command. What emerge actually does is pretty cool – it downloads the source code along with a spec and compiles it against your hardware – so on a fairly loaded box you are constantly affecting the performance by rolling out your own code. Do you trust that your security patches are deployed as full recompiles of the source code? I don’t even trust most binary patches.

Ubuntu – The darling of the Linux world at the moment. Built on the Debian core with the pretty integrated interfaces and its claim to fame is the ability to roll out LAMP (Linux, Apache, MySQL and PHP) in 15 minutes. Pretty, but unsupported.

Those are the basics of Linux and distributions you will likely come up against. Every now and then someone will propose an Enterprise Linux version, a free community recompile of the popular Redhat Enterprise Linux. Distributions such as CentOS and WhiteBox Enterprise Linux. They are free, but again, unsupported as well.

So here is a real world scenario for you. The upgrade for the above is free– in all cases. They will download an ISO, burn it, stick it in a Linux server and after the reboot the system will be upgraded. All free! Yay.

As far as the technical discussion is concerned, they are right. Here is the dirty secret behind this though that nobody talks about: For most scenarios Linux doesn’t migrate, Linux overwrites. Now lets say your consultant tweaked the /etc/rc.d/rc.local file to automatically delete specific files on the server – generally a Linux distro upgrade would put in the new file in the place and make the original one a rc.local.bak. Let’s say you wanted something special done with your web server – your /etc/httpd/conf/httpd.conf file would have two options – it would get overwritten, or they would copy an httpd.conf.orig or tweak it in another way.

So yes, the upgrade is free. But the time to get this done is not. More importantly, because these migrations are generally done on per-site basis (ok, these guys have Redhat, these are on Fedora, these are on Gentoo) the migration checklist is all but nonexistant.

The truth about Linux deployments is that they are very much done on a per-case, needs basis. The beauty of the system (unlimited flexibility) is also its dagger because by endlessly tweaking the system the documentation part of the setup goes out the window. And when the migration goes bad with the freebies above you will likely have only newsgroups and mailing lists to turn to.

Finally, migrations nearly always include more than the base OS. The reason you deploy a Linux system is to get a flexible, fast and cost effective server. Well, Linux developers don’t think the same way business owners do. Linux developers try to adapt new technology, provide the newest features, create a system that is easiest and fastest to develop for. So when that new distribution comes with MySQL 5.0 and PHP 5.0 – will your PHP 4 script designed on MySQL 3.1 work? Maybe, maybe not. Who do you contact to find out – the webmaster that took the script from some random site? Nope. The commercial software developer? Unlikely, they only support official distributions like Redhat Enterprise Linux and SuSe. Who do you turn to? Good question to ask while providing a competitive bid.

How do you do application migration compatibility tests on Linux? You install the new version and try to hack it into working. If you’re lucky, it will just work. If you’re not lucky, whats the alternative? Another question for the stack. This is not the U part of FUD in uncertainty, this is something that there is no good, reliable, documented process in Linux. For years Linux distributions have tried to fight amongst themselves to develop a unified way that Linux is deployed - with same file system layout, dependancy checks, package management. Today you’re more likely to find multiple package management systems (yum up2date, apt).

Features

For the most part this is your biggest strength. Small business owners and business people in general have habbits that are hard to change. Going from a Windows world to a Linux world is a big transition in anything more complex than a P2P environment. Its easy to replace a pop3 server with an onsite dovecot deployment. But when you’re selling a new server you are selling new functionality. Here are things that you will not find in Linux.

Exchange – Biggest advantage. There are no decent webmail programs for Linux – the best one to date is Scalix and it costs about as much as Exchange does. It does not provide RPC-over-HTTP, it does not provide cached mode, it does not provide advanced connectivity to mobile devices.

ISA – For the most part almost all Linux firewalls are connection based firewalls, nothing provides application-level security. So yes, if you want to block people from going to certain sites, Linux will cut it. Try to set those restrictions in place per employee per hour (ie, no espn updates for Joe between 9AM and Noon) you’ll be SOL.

WSUS – Exists on commercial Linux distributions as a Satellite server but almost all are desktop triggered up2date updates via cron – no ability to see which software is running on which system and no ability to restrict what goes on which workstation without manually adjusting workstations on per-case basis. No grouping. No reporting on which patches failed and no reporting on what may be out of compliance. These could be hacked together but do you really want to hack your security solutions together? Do you think your customers would?

IIS – The biggest reason to deploy LAMP is to get PHP and a free SQL server. Both of those run quite reliably on Windows as well and you can install WAMP on Windows. My personal dev environment for Linux is based on Vertrigo server which rolls out as a single install. So if thats all you need to deploy a new forum, blog, or a survey package your customer saw somewhere – this is the way to do it. And it’s free too. But feature is an advantage here – you have a choice. ASP or PHP? On Linux you have no ASP advantage (they use Chilisoft, Sun’s poor hack of ASP) nor do they have any .NET compatibilities without hacking in mono – but skip back to migrations and upgrades – whats the guarantee that your app will run on a hacked server? Now compare that with IIS. If you’re really familiar with IIS this is almost impossible to do. The cost of a second IIS server is not that great to begin with, Windows 2003 Server Web Edition retails for less than $300 which is likely less than two hours of any consultants time. You’d end up charging them more to download an ISO and read the intro parts of the Apache documentation.

Bus Features

When I worked at Dial ISDN I used to write “If Vlad Gets Hit By A Bus” documentation for everything I did. Why? Because all of our Linux servers were so heavilly tweaked that in case something happened there was no way on earth someone would be able to figure out how I’ve implemented my patch management, version control, monitoring, account creation and race conditions.

How much documentation will the Linux deployment come with? How long will it take someone else to replicate the setup on a new system? What commercial contacts do you have that will validate what you say about Linux? How many “user-geared” books are there on Linux that can get me going with this server immediately? SMB owners are DIY-centric, how much of this can I do through a GUI?

Final question: Give me a place to find other professional Linux consultants.

Where you have hundreds of Windows guys in every area there are only a few Linux solution shops. Most of the “Linux guys” will be people with careers and full time jobs that do consulting on the side and are saving your money out of the goodness of their heart. These are also the types you turn to for support. Do you want to run your business on goodness of strangers or do you want a contract? If you want a contract the savings will go out the window.  

Conclusion

Linux provides a cost effective, flexible and powerful server operating system and Microsoft’s FUD about it is largely a collection of paid distortions, some quite well documented as outright lies. Microsoft will not offer competitive sales support to SMB solutions that are under $10,000 in licensing so you’re on your own. They will also not discuss any of the above because of the irrational fear that if you experience a competitive solution you might find enough in it that you like to leave Microsoft.

On the other end of the fence you have, by comparison, a relatively innovative but young solution that lacks the standardization, unity and certainty with many of its supposed solutions. While the core of it is solid the biggest lacking factors for small businesses are in the areas of available expertise and support systems to fall back on when there are problems. In the areas of affordable business intelligence Linux is behind enough to make it unattractive beyond file servers, basic pop3/imap mail servers and popular web applications. 

In the end, both sides will lie, cheat and FUD to get their points accross. Your advantage is in knowing your customer, knowing their needs, and showing them the solution that will not only solve their problems but be ready for the problems they will encounter as they grow. For what its worth, I’ve been a Linux system administrator for three years longer than I’ve been a Windows guy and work on both platforms daily. 

Update: Welcome LinuxToday.com visitors. As you get outraged at the article above please keep in mind that I own and operate a large ISP whose commodity-level services have been powered by Linux, FreeBSD, dovecot, IMP, Squirrelmail, vsftpd, bind, etc for close to a decade. We also own the largest deployment of Microsoft Small Business Server 2003 and constantly manage both platforms. If you have not seen what Microsoft has been up to for the past 3 or so years please don't waste your time posting comments about how "you can do it" and how "there are solutions that you can customize" because thats the entire point of the article, knowing the audience. Small business owners will not pay for "you to do it" they will only pay for as little labor as possible, which in turn makes the licensing cost negligible. So please don't think you've landed on some bashers site, this post is about recognizing the market.

Windows 2003 Server more reliable than Linux

Really. Not just because Scoble says so, but also because Yankee Group did a research paper on it. Well, it’s written down and researched so it must be true. Sometimes I get under fire for calling BS on Microsoft too often so allow me to introduce you to my friends at Neowin.net. Mike, please field this one:

I had to do a double take when I saw that. 20% more!? Assume for a moment that you have two servers, one running Windows Server 2003 and one running Red Hat Enterprise Linux 4. Assume that your Windows box ran non-stop, without rebooting (which means you probably are not loading any Microsoft security updates) for 365 days. For your Linux box to have 20% more downtime it'd have to only be up for 292 days. If that is the case, your machine is no longer a server and is nothing more than a space heater.

Looking into the Yankee Group, and the analyst who contributed to this article, Laura DiDio, it can quickly be decided that they can hardly be seen as an objective source for technology analysis. Yankee has regularly been tasked and paid by Microsoft to provide "objective" reviews for its Get the Facts campaign (see all 184 results from Microsoft's website). The Facts campaign is the same campaign that said one company switched from Linux because they had been effected by the Blaster worm (a Windows worm) on their Linux systems which caused them massive down time and as a result made the switch to Windows Server systems. (read that one for yourself).

Read more about this at Neowin: Editorial: Yankee Group Spreads On The FUD. I wonder who’s wins the next contract to write a Microsoft research paper.

Linux and History of Understatements

Post on my local Linux User Group reminded me that Linux is just about 15 years old. Linux Journal, something my friend Pablo subscribed to in the long long ago when we were just starting at CyberGate, is doing a big write-up on it and has put up the original Usenet post from Linus regarding his project:

``Hello everybody out there using minix - I'm doing a (free) operating system (just a hobby, won't be big and professional like gnu) for 386(486) AT clones. This has been brewing since april, and is starting to get ready. I'd like any feedback on things people like/dislike in minix, as my OS resembles it somewhat (same physical layout of the file-system (due to practical reasons) among other things).I've currently ported bash(1.08) and gcc(1.40), and things seem to work. This implies that I'll get something practical within a few months, and I'd like to know what features most people would want. Any suggestions are welcome, but I won't promise I'll implement them :-)

Linus (PS. Yes - it's free of any minix code, and it has a multi-threaded fs. It is NOT protable (uses 386 task switching etc), and it probably never will support anything other than AT-harddisks, as that's all I have :-(.''

Ok, so I did find that bit a little cute, as I'm here in 2006, at 4:00 AM and my Windows workbench keyboard (HP 1996 baby) has F6 worn out. If you don't get that you're reading the wrong blog :)

Hey, if you can't laugh at yourself...

This certainly puts in perspective. Kevin Korb, whose presentation on Software RAID at the local Linux user group got turned into the podcast, shared this great page with me along with his resistance to the word podcast. You have to admit, its pretty funny. I tried to keep the above paragraph close to the description on that page. However, it is quite accurate. Most of the blogosphere is clogged with generally worthless opinions, much like the one you are currently reading, spread by people that are either generally useless to their organizations or simply unemployed enough to have the time to provide their opinion on every worthless event covered by someone else. My friend Pablo and I argued for a long time around the turn of the century on whether it was a good idea to allow people that could not put a page on the web (or have access to someone that could) to spread their message. With 98% of what I've seen so far it's been a bad move. However, I am a firm believer that over time most people that get 30 people a day to hit their site out of pure boredom will eventually lead them to forget about their blog and update it annually, or less. Look at the collection of blogs you consider worthless, haven't most of them been dead for at least a month? It's just the universe balancing itself out.