Web hosting on Windows III: Reluctant Success

Mon 28 Jan 08 22:27 | Tags: Web Hosting, Windows

Okay, I've been putting off ending this series (Part I, Part II) for too long. Please forgive me for sort of rushing through this, but I think we both agree that I tend to write too much anyway.

So clearly the server is now up and working. What was the final solution? Well, as much as I tried to avoid it… I went with Apache. I still think that Apache is a spectacularly mediocre web server with a fantastically horrible configuration system, but Amaya was not cutting it. I swallowed my pride, did my research, and installed it.

I'm giving it a hard time, and rightly so, but as horrible as the syntax is, Apache's configuration files are well-commented and set to fairly secure defaults. Which is good, because I didn't need most of Apache's features, such as .htaccess files or subdomains or such. We did need some parts of the site to be locked up by a username and password, and, as with LightTPD, I was even able to get those parts to work over an HTTPS encrypted connection as well; it wasn't as easy as it was with Lighty, but I did it. However, one feature I wasn't able to get working was WebDAV. The feature is there in Apache, so it can be done; I just couldn't get it to work. We could log in, but not upload files; probably some Windows-specific permissions thing that I don't want to even bother guessing about. So… I turned back to LightTPD. Yes, through a little more tweaking of configuration files, I've set up both Lighty and Apache to run on the box; Apache handles all the web requests, whereas Lighty responds to the WebDAV ones. Ideal? No, but it works.

Now that I was using Apache, I once more tried to get PHP working via FastCGI… no dice. Eventually I gave up and installed PHP as an Apache module. For reasons I've explained before, this isn't the most ideal solution, but it's working. And it's allowed me to install XCache, which really set the server on fire; it was definitely noticeably faster.

But, if you were paying attention, you may realize that there was one more problem we haven't solved yet; outgoing mail. For whatever reason, IIS's outgoing mail server just wasn't wanting to relay mail. On a whim, I tried the slightly scary-looking hMailServer; imagine my surprise when it worked fantastically! I don't know if this program would be up for the task of a full-service mail relay, but for this server, which maybe sends out a couple dozen messages a day at most, it seems to be working just fine.

So that's the story of how I got a web server of moderate traffic up and working on Windows. Was it as bad as I thought it was going to be? Well… yes, just about. Having done it once, I'm now more knowledgeable about the process, but just as reluctant to do it.

Get more great Ray Gun Robot content sent directly to your feed reader or email inbox! Subscribe today!
Feed icon Articles & LinksVia Email
Feed icon Articles OnlyVia Email

0 Comments | 0 Trackbacks | Digg this article | Bookmark with del.icio.us

 

Web hosting on Windows II: Of Speed and Stability

Sun 13 Jan 08 00:48 | Tags: Web Hosting, Windows

So at the end of Part I, we were given a Windows 2003 server to host on and told to go nuts -- we could install whatever software we wanted on it, but we couldn't change the OS. Okay, fair enough.

As I mentioned, my first choice for a server was LightTPD. There's a great project called WLMP Project, which provides an installer which MySQL, Lighty and PHP all as a "kit," including their services (the Windows equivalents of daemons). The installer itself is in Hungarian, but it's easy enough to get through; just click the default buttons all the way through.

One problem, though; it configured Lighty to connect to PHP via CGI instead of FastCGI. The difference between these two is beyond the scope of this article, but suffice it to say that the latter is faster, and would also allow me to use the opcode cacher XCache to make things even faster. I tried to reconfigure Lighty to use FastCGI, but as it turns out… FastCGI simply doesn't work on the Windows version of Lighty and apparently never has.

Well, okay. Maybe old CGI without XCache would be good enough. So I tweaked the configuration back to using CGI, and things worked great for the rest of testing period.

Then we went live and Lighty promptly crashed.

Well. We could restart it and it would hold up for a few more hours, chugging along very slowly. The error log was packed with errors like this:

2007-12-30 22:39:13: (connections.c.132) (warning) close: 14 Interrupted system call 
2007-12-30 22:39:26: (connections.c.132) (warning) close: 9 Interrupted system call 
2007-12-30 22:39:27: (connections.c.132) (warning) close: 9 Interrupted system call 
2007-12-30 22:40:37: (connections.c.1205) connection closed: poll() -> ERR 8 
2007-12-30 22:40:37: (connections.c.1205) connection closed: poll() -> ERR 9 
2007-12-30 22:41:55: (connections.c.1205) connection closed: poll() -> ERR 7 
2007-12-30 22:41:56: (mod_cgi.c.1231) cgi died ? 
2007-12-30 22:42:25: (connections.c.132) (warning) close: 7 Interrupted system call 
2007-12-30 22:43:23: (connections.c.132) (warning) close: 7 Interrupted system call 
2007-12-30 22:43:23: (mod_cgi.c.1231) cgi died ? 
2007-12-30 22:43:41: (connections.c.132) (warning) close: 8 Interrupted system call 
2007-12-30 22:44:26: (connections.c.1205) connection closed: poll() -> ERR 11 
2007-12-30 22:44:27: (mod_cgi.c.1231) cgi died ?

I never precisely figured out what the problem was, but seeing as how I had run into incompatibility problems with Lighty and CGI before, I decided at this point that, as much as I loved LightTPD, it was just never meant to run on Windows. Time to look for alternatives.

Now, the obvious alternative was Apache. I shied away from it at first, though, because I hate Apache's confusing configuration files -- the illegitimate child of XML and that kind of meth which makes you think you can take a cop who has a gun drawn and pointed at you -- and I needed a crash-resistant server working now. What I ended up with was Abyss. Abyss is a closed-source server with a free and a commercial version; I installed the free one first. Abyss uses a rather pleasant graphical configuration system which is accessed by going to port 9999 on localhost in a web browser. It sounds really Mickey Mouse, but it was actually pretty capable; it connected to PHP via FastCGI with no problems, and it could handle URL rewriting with regular expressions so we could keep the same "pretty URLs" we had set up with Lighty. Most importantly, it never crashed. However, it couldn't handle WebDAV as LightTPD could, so I configured LightTPD to only listen to WebDAV requests through another port and leave port 80 to Abyss. Since LightTPD got a lot less traffic and didn't have to try to connect to PHP in this case, it started behaving itself again and stopped crashing.

So Abyss was stable and faster than the suffering LightTPD, but it still was unacceptably slow at times. Also, since Windows doesn't have Unix/Linux's sendmail, how was PHP going to send outgoing email? There was more work to be done, clearly… But I'll leave that for another day.

Get more great Ray Gun Robot content sent directly to your feed reader or email inbox! Subscribe today!
Feed icon Articles & LinksVia Email
Feed icon Articles OnlyVia Email

0 Comments | 0 Trackbacks | Digg this article | Bookmark with del.icio.us

 

Web hosting on Windows I: Not on my worst enemy

Thu 10 Jan 08 01:17 | Tags: Programming, Web Hosting, Windows

My new year's resolutions that I probably have no chance of not breaking are, in no particular order:

  1. Exercise more. This desk job isn't making me any thinner.
  2. Get my credit cards and student loan paid off and never go into debt again ever ever ever.
  3. Start posting regularly on Ray Gun Robot again.

But it's not like I've been lazy this whole time. Quite the contrary, I was working on the biggest web project of my entire life. Namely: the web site for The Eureka Reporter, a local newspaper.

Like all good projects of any size and substance, this was definitely a learning experience. We decided to go with the excellent Drupal content management system, which is made all the more amazing when you can code your own modules for it -- which I learned to do, with the help of a most excellent book entitled Pro Drupal Development. Maybe some time in the future I'll convert RGR to Drupal…

So the programming was not so much a challenge… it was just pretty voluminous, and learning the Drupal way of doing things was new. One particularly tricky thing was finding a way to convert the paper's printed pages to Flash files without cheating and just turning the pages into huge bitmaps (PDFs were nixed as being too easy to download). Well, we did it… I'm afraid just how is going to have to stay a bit of a trade secret.

There is one part of the project I'd like to talk about, however… The experience with getting the frickin' thing up and hosted and visible to the world. The Reporter's parent company is a rather large financial firm which has its own data center. (The newspaper is something of a pet project of the company's head honcho.) We were told (or, at least, had assumed that we were told) by our main contact at the Reporter that we would have access to a Unix- or Linux-powered server of some sort, but apparently there was a miscommunication somewhere, because very late in the project, once we finally got access to the parent company's IT department (the thickest stack of non-disclosure agreements I've ever seen and a few layers of corporate bureaucracy stood in our way), we found out they were a Microsoft-only operation; Windows 2003, Exchange email servers, MSSQL databases, IIS web servers, the whole bit -- the previous CMS that we were replacing had been written in ASP. So when they heard we wanted to run a PHP app with a MySQL backend running through LightTPD on some flavor of Unix or Linux, they were like, "you want to put what on our iron? Uh… no."

So then we scrambled to consider third-party hosting solutions, to which they replied, "you want to put our data on a server outside of our own four walls? Uh… no." Did I mention we were supposed to go live in less than a week at this point?

Well. At this point, I was expecting their IT guys to be real hard-you-know-whats, so I was pleasantly surprised when they got back to us with a compromise. For the initial launch, we could go ahead and use a shared hosting provider, just for the time being. However, they were going to set up a Windows 2003 server for us, and we were going to be expected to use that. Furthermore, we could install whatever software we wanted on it, but they would only be responsible for tech support to the extent of Windows itself; we were on our own as far as troubleshooting beyond that.

A fair compromise given the circumstances, I think; it meant we didn't have to rewrite Drupal in friggin' ASP or anything. However, it meant that I still needed to learn how to set up and run a Windows 2003 server, and fast.

I will go into detail into the trials and errors involved with this (and boy, were there a lot of errors), but I'll sum it all up here. In the Unix/Linux hosting world, I can use a mail server from here, a web server from there, a programming language from these people, a database by those people, and an operating system originally conceived by hippie-nerds in Berkeley decades ago, and even though all these things are made by different people, odds are they'll work together quite well. However, I've come to the conclusion that, on Windows, the most successful way to tackle the project is exactly as The Reporter's parent company was doing it; use Microsoft's mail server and Microsoft's web server and Microsoft's programming language and Microsoft's database on Microsoft's operating system. Once you venture outside of Microsoft's little bubble, any guarantees of interoperability go out the window. Now, of course, different people (especially those who have formal training in running Windows-based servers) will have different experiences, but as you read more about my personal experiences in the days to come, you'll see that it was quite simple for me to reach this conclusion.

Get more great Ray Gun Robot content sent directly to your feed reader or email inbox! Subscribe today!
Feed icon Articles & LinksVia Email
Feed icon Articles OnlyVia Email

0 Comments | 0 Trackbacks | Digg this article | Bookmark with del.icio.us

 

DreamHosed II

Sat 10 Mar 07 01:37 | Tags: Meta, Reviews, Web Hosting

Okay. As you may know, I've had quite a few nice things to say about DreamHost in the past, but, of course, those experiences were in light of the fairly decent level of service I had been receiving from them thus far. Well, from about midday yesterday to about an hour ago tonight, all PHP-powered stuff on my DreamHost account was dog slow; sometimes pages wouldn't respond at all. (At least, as far as I could tell, it was just PHP-powered stuff that was being slow; but apparently, according to DreamHost, it was lower-level network hardware stuff, which would cause other types of files to be slow too. I thought images and static HTML pages were working just fine, though.) And this was during a period when I wanted to do some pretty heavy experimenting with RGR, so it was quite frustrating. So I'm just a liiiiiittle less enamored with DreamHost now than I was two days ago.

Earlier today, I went ahead and opened an account with another host to move over the drastically important stuff to. I chose asmallorange for two reasons; for one, I've heard some decent things about them, and for another, it offers a plan which costs only $5 a month, and you can pay for it monthly, not yearly. So if, in a month, the DreamHost account seems to be healthy again, I can close the asmallorange account, move everything back to DreamHost, and only be out five bucks. Not too much sweat.

asmallorange's hosting plans seem anemic compared to DreamHost's. DreamHost's $9.95 monthly plan starts you off with about 160GB of disk space and 1.7TB of bandwidth; asmallorange's $10 monthly plan offers a single gigabyte of disk space and 25GB of bandwidth. Personally, I had no problem keeping my monthly bandwidth measurements under 15GB at DreamHost, but that 1GB of disk space would be a bit of a tight squeeze; right now I'm using about 2.3GB at DreamHost. A lot of it is silly macro images and the like, so I think I could make it fit if I tried, but I don't really want to have to try.

Also, asmallorange uses the ugly, confusing cPanel back-end to set up your domain names and such. After getting used to DreamHost's pretty and simple custom back-end, having to use cPanel is not the greatest of experiences. This also means that new domains and subdomains are less pleasantly arranged in your disk space. With DreamHost, if you had foo.com and bar.com, foo.com's files would be in ~/foo.com/ and bar.com's files would be in ~/bar.com/. With asmallorange, I have to specify a domain as my "default" domain, which gets the directory www, and all other domains get subdirectories inside of www. So, for example, foo.com's files would be in ~/www/, but bar.com's files would be in ~/www/bar/. Ugh!

asmallorange's referral program is also less rewarding than DreamHost's; your reward will be equal to one month's payment for your referee, depending on which plan they chose. Since the most expensive plan is $30 a month, that means the most you can earn is $30; much less than DreamHost's flat $97. Also, there doesn't seem to be a way to cash out earnings; you must apply them to your hosting bill.

So what are the good points? Well, it worked when DreamHost didn't. Also, the service seems to be pretty quick; SSH is off by default and you have to submit a service ticket to get it enabled. I received an email to confirm the trouble ticket right after I sent it, then another email from the tech after he enabled this on my account. The difference between the times on those two emails is under two minutes. That sure beats DreamHost; I've had good experiences with their tech support in the past, but during this last crisis, almost twenty-eight hours passed between my first plea for help and the message they sent me a few hours ago, telling me everything should be fine now.

And everything does seem fine now; when I go back to less-crucial PHP-powered stuff still running on DreamHost's server, the problems seem to have been alleviated. We'll see if it stays that way. I still think of myself a fan of DreamHost, but the last two days definitely tried my patience.

Get more great Ray Gun Robot content sent directly to your feed reader or email inbox! Subscribe today!
Feed icon Articles & LinksVia Email
Feed icon Articles OnlyVia Email

0 Comments | 1 Trackback | Digg this article | Bookmark with del.icio.us

 

Dream Hosed

Sun 25 Feb 07 23:46 | Tags: Web Hosting

So Ray Gun Robot was down early this morning, along with thousands of sites hosted by my hosting company, DreamHost. Their data center had a planned power outage at midnight, and when they powered everything back up, some hardware apparently decided to die. Some sites are still affected, and some customers are very not happy, as the comments to this blog post make evident. Since I recently wrote a glowing review of DreamHost here, I thought I'd give my thoughts.

This incident needs to be seen in context. First thing is that for all the moaning and whining people throw about, downtimes don't happen all that often. I suppose if they were a monthly thing, they'd bug me, but they're not frequent or regular at all. And the one today happened early morning on a Sunday. I don't know what better time it could have happened; that's not exactly a prime time slot for internet activity.

Second is that DreamHost is a value hosting company. That is to say they do what they say they do, and they do it cheaply; I still think it's a heck of a value. But they do not have an uptime guarantee. If you are running a site which is going to be losing thousands of dollars an hour in income if your servers go down, DreamHost will not be your best choice. Go with a colocation company with multiple levels of redundancy, a 100% uptime guarantee, and various other buzzwords -- and pay hundreds of dollars a month. That's the kind of company I'd like to use, but none of the web sites I'm hosting are currently making anything resembling a profit (including this one). So I can't afford it, and even if I could, it wouldn't make much sense.

So I still stand by my comments in my last post about DreamHost. If you're looking for a feature-packed host at a fair price, and you aren't going to be devastated by rare downtimes for a few hours, you owe it to yourself to give them a look. If, on the other hand, 0% downtime is a serious concern for you, you'll need to consider other options which will be much more expensive.

Get more great Ray Gun Robot content sent directly to your feed reader or email inbox! Subscribe today!
Feed icon Articles & LinksVia Email
Feed icon Articles OnlyVia Email

4 Comments | 0 Trackbacks | Digg this article | Bookmark with del.icio.us