Josh Ourisman » On the other hand

Navigation: Blog, Portfolio

Duplicating WebFaction's Apache setup

October 13th, 2008

I've been using WebFaction for my hosting for a while now, and have been extremely pleased with them. In addition to the fantastic service I've received, I've been very impressed with the intelligent way they have their servers setup. They've clearly done a lot of work to make things as modular as possible which makes it insanely easy for me to run multiple sites with very different requirements seamlessly on the same server.

Basically what they've done is segment out all of your different websites into 'applications'. Each application in represented as a directory in your ~/webapps/ directory, and is essentially a self-contained environment with it's own apache instance, and, in the case of a Django app, it's own $PYTHONPATH. The end result is that even though all the websites are being stored and run from within my home directory, they're entirely modular, can have different, or different versions of the same, dependencies installed, and can be shut down and restarted independently of one another. On top of all this is a fantastically simple custom web-based control panel that I'm pretty sure is built with Django.

I've been so impressed with how well this setup works, that I've decided to duplicate it on my home server for development purposes. Currently I do pretty much all my development work on my Gentoo Linux powered ThinkPad. To that end I've installed Apache, MySQL, PostgreSQL, SQLite, Python, PHP, &c.; to allow me to mimic the live sites as closely as possible and to allow me to continue working when I don't have internet access (such as when I'm flying or visiting Jessi's family out beyond the reach of broadband). This works very well, but as I'm just using a basic Apache install, without any VirtualHosts, it's not nearly as flexible and means I can really only work on a single site at a time with some work necessary to switch back and forth between projects. Of course most of the time I just use Django's built-in development server when working with Django, but I do end up relying on Apache sometimes, and I'd like to set up my home server as a more complete development environment for both myself and some friends I can grant VPN access to. So to that end I've been looking into WebFaction's setup with the idea of re-implementing it myself.

Turns out it's pretty simple. Simple enough that I almost feel like I should have thought of it myself. Basically, WebFaction's setup scripts create a new 'app' in your ~/webapps/ directory, and populate it, most importantly with a copy, owned by your user, of the Apache executable, some scripts to start, stop, and restart that executable, and an httpd.conf file that sets the (in the case of a Python-based app) $PYTHONPATH variable to include a ~/webapps/yourappname/lib/python2.5/ directory allowing each site to maintain it's own dependencies independently (you can also put things in your ~/lib/python2.5/ for global dependencies if you want). Oh, each application also gets it's own copies of the necessary Apache modules to the same effect. Each application's Apache instance(s) is set up to listen to a different (non-80) port. The end result of this is an extremely simple, extremely modular setup that works fantastically.

Obviously I've left out a step here. If each Apache isntance is listening to a different, non-80, port, how does your traffic get to your actual site? This is the one part that I can't really just peek into the configuration files for, because it doesn't (as far as I can tell, which makes sense) live on the same server as my sites. I assume that what's happening is that WebFaction's name servers are simply pointing requests to (for example) joshourisman.com:80 at my.webfaction.server:portnumber. Again, a simple, yet elegant solution that allows for easy customization and expansion.

I haven't yet tried to implement this setup myself (I first want to move my server from FreeBSD to Linux (which now that I'm using full-time again I'm just much more familiar with), but there's nothing about it that's particularly tricky. Really, the routing is probably going to be the hardest part, but I'm planning on replacing our rather lackluster TrendNet wireless router with a Linux box which will give me much greater control and (hopefully) better reliability.

Ah the joys of django

September 13th, 2008

I've just implemented the first real benefit of having my blog now be Django based instead of WordPress based. Because part of the reason I had wanted to make this move all along was to allow for some close integration between my blog and my business site, when I went about setting up the Django project for the blog I actually just duplicated the project for my business site. Because of this, I'm able to use Django's sites framework to have both project pull from the same database. This means that any information available to one is also available to the other.

Because I used a ManyToManyField to define the relationship between a blog entry and a site, I'm able to specify that a particular entry is related to either or both of the two sites (as well as any future sites that I may decide to add). This entry, for example, is related to both. Thanks to Django's fabulous templating system I was able to effortlessly integrate the blog templates into my business site without every writing a single line of HTML or CSS.

The end result of all this? The business relevant posts on my blog are available not only at joshourisman.com, but now also at dydxtech.com/blog.

How cool is that?

Fresh from the Family Farm: A new project goes live

September 12th, 2008

It's always fun doing this: a new project has gone live! In cooperation with BostonChefs.com, Fresh from the Family Farm is an event for local Boston-area restaurants to showcase the possibilities of local ingredients from area family farms. The event runs from Oct. 12 through Oct. 19, and a list of participating restaurants, along with links to make reservations through OpenTable (where available), and links to the restaurant's BostonChefs.com profile (also where available).

The website is powered by Django (which is now at 1.0, something I plan to write about soon), which even still I am growing to love more and more as I use it.

Hosting hassles

June 20th, 2008

As I mentioned in my last post, I recently migraded my dy/dx tech website to a different hosting company. If you've really been paying attention, you may recall that not too long ago I had gotten a Media Temple hosting account with the plans on migrating all of the sites I host, both my own and clients' to it only to discover that setting up Django on a Media Temple (dv) account is far more trouble than it's worth. My estimation of that hasn't changed, in fact I actually cancelled my Media Temple account a few weeks ago after the last client I had hosted there was moved off to another host. My experiences with WebFaction have been so positive (exploding data centers notwithstanding), that I have instead migrated everything to their servers. Well, not everything yet. This blog is still hosted on DreamHost for the time being (though I plan on moving it to a WebFaction hosted WordPress blog in the very near future before eventually migrating it to a Django based solution as I've mentioned before).

The hosting hassles referred to in the title, thankfully, have nothing to do with the actual hosting companies I'm dealing with, and are instead due to a foolish mistake on my part: when I switched my domain to WebFaction, I forgot that I had custom MX records enabling the use of my hosted google apps for my domain. As a result, as the new DNS information started propagating, people stopped being able to send me email. Fortunatly, it was an easy fix to just change the MX records with WebFaction, and I don't think I missed any important emails, but if anyone out there got a bounceback when sending me an email, that's why.

A big new project goes live

June 18th, 2008


It's been a while since I've been able to announce a big new project. Not because I haven't had any, but because everything I've been working on lately has been so large that nothing is quite ready to go live yet. But finally, I get to announce a big project that I recently finished: the Becoming MOBOS video blog. As I'm sure many of you from the Boston area are aware, there is a new Mandarin Oriental that's been under construction down by the Pru. They hired me to create an internal video blog for them. Unfortunately, since it's internal, I can't link to it, but the screenshot to the right links to a full-size, albeit redacted, image. It's a WordPress based blog using a verstion of WPelements.com's MassiveNews theme customized by your truly. I also used FlowPlayer to provide the Flash video playback capabilities. All in all, I think it turned out to be a pretty slick site.

That's not the only news, however. In preparation for announcing the Becoming MOBOS site I've been doing a little work sprucing up my own website. So I also get to announce a new version of the dy/dx tech website (I also changed hosts for it, so you may need to wait for the DNS to propagate if you're still seeing the old site). The overall look of the site is the same as before, but I've removed some rather pointless elements such as the Google Map that used to be on the front page. In it's place is now a slideshow of screenshots from my portfolio, which I think is a much better use of the space. The majority of the changes, however, are under the hood. As you may recall, I redeveloped the site using Django a while ago. Since then I've spent a lot more time with Django and know a lot more about it, so I completely redeveloped the site (using the newforms-admin branch and was able to make a lot of improvements to the code, and basically leave it better positioned to integrate more features in the future. Among other things, I plan on migrating this blog to a Django-based solution and integrating it into the dy/dx tech website to some extent. I've been working heavily with Django for the past several months, and I just keep liking it more and more. It makes every part of my job so much more enjoyable and, in a lot of cases, faster. Be on the lookout for another project going live in the next couple weeks: this one will be Django-based and will be very public, and, I predict, very popular.

I love Django

May 20th, 2008

I'm currently working on a fairly large Django project that I think I've mentioned a couple times in the past. In that Django project there is a Person model and an Organization model. Both Persons and Organizations have email addresses. Organizations are related to Sites (through a ManyToMany field), but Persons are not (they're related to Organizations through an intermediary table). I'm currently attempting to create a contact form, so that people can email either a Person or an Organization using newforms.

For security reasons, we don't want the user to actually see the email address, just the name of the Organization or Person. Fortunately, newforms has the ModelChoiceField class that you pass a queryset of options. In keeping with DRY principles, I want to be able to use a single Form regardless of whether the person is trying to email a Person or an Organization (both models have a field named 'email_address'). Unfortunately, this is where I ran into my first problem: ModelChoiceField doesn't really allow you to define the queryset dynamically, you have to define it in the form definition. Luckily I found this blog entry which provides a method to re-define the queryset in the __init__() method which allows you to change it based on the HttpRequest object. My next problem was that I only want the user to be able to email Organizations and Persons on the current Site. Since Organizations are directly related to Sites I just used the CurrentSiteManager. However since People are not directly related to Sites, and are instead related only to Organizations (through an intermediary table), I couldn't do this. Instead, I decided to try this crazy bit of code:

Person.objects.filter(persontoorganization_map__organization__in=Organization.on_site.all())

Amazingly, it just worked exactly as I would have wanted it to. No fuss, no problems, just a queryset of Persons related to the current site. Go Django!

Finances

January 12th, 2008

2007 being over, and taxes looming on the horizon, I figured I should probably put together my finances for the year. I should have been keeping track of this on an ongoing basis, but...

Pretty much as soon as I started to delve into my records, I realized something: my hard copy records were fairly abysmal. Fortunately, I keep everything on my computer, and the hard copies are more of a convenience thing; as it is apparently the case that they're not actually all that convenient, I'm going to transition into fully electronic record keeping. Don't worry, I keep everything backed up both locally and remotely. I am in IT after all.

I realized something else almost immediately: things are actually going pretty well, especially when you also take my 2006 numbers into account. My business having started in the summer of 2006, I had pretty low revenues for that year. In fact, both my Q1 and Q4 revenues for 2007 were greater than my total revenues for 2006. The upshot of that is that in 2007 I saw approximately 300% growth in revenue over 2006. Quarter by quarter, I maintained an average growth of slightly over 55%.

One point of interest: on November 1 I changed my business model. In that month I brought on a new partner, and December ended up being my second highest grossing month yet, despite the holiday slowdown. Obviously I don't have the final numbers yet, but I can pretty much guarantee that January will beat it, and February will likely beat January. In fact, I'm currently set for Q1 of 2008 to not only be my highest grossing quarter so far, but to repeat the performance of Q1 2007 and gross higher than the entire previous year.

I think this means that my business model is working. :)

My Portfolio

November 28th, 2007

I've been meaning to do it for a while, but I've finally gotten around to creating a portfolio. Since my website is now Django based this was incredibly easy, and probably only took about 45 minutes to do. Previously I've just been keeping a list of links to former projects that I included in emails to prospective clients. I didn't really want to put up a portfolio when I only had a handful of projects to show off. But in the past few days three different projects went live: Lola Boston for which I created the locations database, Tundratour for which I created a database for the different trips as well as a 'shopping cart' to allow people to request more information on multiple trips at once, and Sel De La Terre which was live before but now has a tool for purchasing gift cards online that I created. I figured that 5 projects was a big enough number to go live with, especially as it should be growing pretty rapidly in the next few months.

I'm still trying to decide if I want to put more information in there. Should I put in a little description of each project, or at least expand on what my contribution to the project was? The Chainsaw Awards page was nominated for the MITX awards, I should probably mention that somewhere. Fortunately, now that it's there it will be easy enough to add more to it. The other question I've been asking myself is whether or not I should include websites that I worked on at my old job. I was just as much responsible for those projects as the ones I'm doing now, but somehow it just seems like I should leave them off. Fortunately again, it will be easy to add those later if I decide to. And in the meantime I have a portfolio to show off. A pretty nice one, if I do say so myself.

Also, I do still intend to write that post that I promised while I was in Jamaica, I've just been very busy ever since getting back. I'm going to be away again this weekend (Florida for another wedding), so hopefully I'll be able to get to it next week when I'm back.

A new business model

November 1st, 2007

When I first decided to start my own business, my idea was basically to offer IT services for Mac using individuals and companies. Previously I had been working in IT at an all Mac corporation, so I definitley have the skill set to do this. The problem with that idea turned out to basically be one of supply and demand: there's quite a lot of competition in the field, and as a newcomer without much of a background it was hard to distinguish myself and actually land jobs. During the past 18 months or so that I've been doing this I've gotten some work doing IT, but not really all that much. Instead I found myself filling the gaps by doing web development. For whatever reason, it appears that I'm much better at selling myself as a web developer than I am at selling myself as an IT consultant. So I've found myself doing mostly web development with IT work pretty much being something I do on the side.

So in the past month I've made the decision to change my business focus. Instead of dy/dx tech being a Mac IT business that also does some web development work, it is now a web development business. I've even let my membership in the Apple Consultants Network lapse, as the main benefit I derived from it was the great prices for software which I've now already got. There are a number of benefits for me making this switch. The first is that I'll now be able to focus all my energy on finding web development work rather than it being a secondary focus. Since even as a secondary focus, web development was much more successful than IT, I think this will really pay off. The other benefit is that it will be easier to distinguish myself from the competition. I have a number of web site projects that I'm working on right now, and that I've worked on in the past that I can put my name on. Having that lets me put together a nice pretty portfolio of work, something that IT work just isn't as good for. I'm currently working on putting together a portfolio application in Django to add to my website. This will increase the ability of my website to sell my services, and also serve as visual evidence of my businesses growth and therefore as a rought metric for the quality of my services. I'm waiting to finish up a few of the bigger projects that I'm currently working on before going live with online portfolio.

I will still, however, be doing some Mac IT work. But now I'll be doing it under the In Home Mac brand. In Home Mac is a company started by Matt Moglia, a good friend of mine from High School. He started doing the Mac IT thing for himself in the Bay Area at about the same time I started doing it in Boston. He's apparently much better than I am at marketing those services, and has now built up his company to the point where he's got multiple techs working for him in different areas. I'm now the In Home Mac tech for the Boston area. The main advantage of this for me is that I no longer have to worry about advertising those services. All the advertising and such wil be taken care of for me, so I just have to take care of the work when it comes in. This is just about a perfect arrangement for me as I can focus on selling the services that I'm actually good at selling and still have work to do with the services I'm good at but can't sell well.

I'm pretty confident that this change will, in the next several months, lead to me bringing in a lot more busines than I have been. Especially as I've already got a pretty good business model for the web development side of things. It's pretty rare to find people who are both good designers and good programers. This makes a lot of sense when you think about it, but what most people don't realize is that both skill sets are necessary for functional websites. In general, I've found that web designers tend to do the designing and then either muddle through with what little programming skills they have or get a friend or relative who knows more programming than them to do it on the side. This works for a while but tends not to be a very scalable model for a number of reasons. First, someone who's doing web development on the side can often make time to get one project done, but they just can't do it for project after project because they have other things to worry about. Second, it's usually not reasonable for that person to quit their day job and do web development full time because a single web designer or small web design firm isn't likely to generate enough work to justify a full time developer. So I have an advantage here. I have as much time as I need to dedicate to web development. On top of that, I have enough time to fine more web designers to partner with. The more designers I work with, the more steady the work coming in will be. Currently I'm working with two different small design firms which brings in decently steady work, and I'm always on the lookout for more designers and small design firms that might be interested in hiring me to do their development. This basically ends up being win-win for everyone as several different designers get to have a developer without needing to hire one full time, and I get to work full time as a developer without having to sell my soul to a big company.

My eventual plan now is to partner with enough designers and design firms that I can't actually handle all the work myself. At that point I can bring in more developers in the same way that Matt has brought in more Mac techs and my business can really start to grow not only in size and revenue, but in the variety and quality of the services that I can offer. There's only so much I can do myself, but when I start bringing in more people I'll be able to add their unique skills to the services I can offer and I'll be able to delegate work out in a logical way to improve the workflow, efficiency, and quality. I'm not quite to the point of needing to do that yet, but I think I'm on track to get there. And I've already got a few other people in mind to bring into the dy/dx tech web design fold including an SEO specialist and another general developer who's good with Ruby on Rails.

My first Django site

September 15th, 2007

My first Django project is now live. Sadly it's not a very interesting one, just a re-develop of the dy/dx tech website. It looks exactly the same as before, but it's now powered by Django. This doesn't really offer any advantages at the moment, but it will. For example, pretty much all the data on the site is currently stored in a database which means it will be extremely simple to add, remove, or change any of the services show in the services tab. Not that I really expect that to change any time soon (although you may notice that the services tab is the one part of the website that has changed; I've added a few, and consolidated some redundant ones), but the principle is sound.

More importantly having the site powered by Django will make it much easier for me to add some new features/online services that I've been thinking about for a while. The first one will definitely be a portfolio tab. I've worked on a pretty good number of websites in the year or so since I started this business, and I really should have a portfolio on my website to show off my work. I'd also like to put up a clients tab where I can list my clients and, if I'm lucky, get some testimonials to put up there as well. Then of course there's the WiFi database that I've been talking about for a while, that will have it's own subdomain, but I'll give it its own tab as well. Hopefully now that the whole site is done with Django and I'm a little more familiar with how the framework works development of those things and others will go a little faster.

dy/dx tech's WiFi Database

August 19th, 2007

A little while ago I posted about an idea to create a good online database of places that offer WiFi. My motivation for this is that, as I have no real office, it's often nice to work from a cafe or something like that. This is especially true during the summer as those places usually also have air-conditioning that I can take advantage of as well. Additionally, while there are any number of sites that claim to fulfill that purpose, none of them do a good job at it. I've been unhappy with every such site I've tried for pretty much as long as WiFi has existed. So now I'm going to do something about it.

This project is also a good opportunity for me to learn some more web development skills. Up till now the web development that I've done has been almost entirely in PHP. It's also been coded 100% by hand. I like doing things that way because it means that I know exactly how everything is working under the hood, and have no qualms whatsoever about going in and changing things. Now, however, I'd like to expand a little beyond that. I'm comfortable enough with the way web programming works that I no longer feel the need to be completely in control of everything; it's time for some shortcuts. Fortunately, frameworks such as Ruby on Rails and Django exist to provide exactly those sorts of shortcuts. Being, as I am, a huge fan of Python I've decided, with a little input from Jesse Legg that I'm going to create my WiFi database site with Django (I've got another project planned for the near future that I plan on using as an opportunity to learn Ruby on Rails as well).

I've just finished installing Django on my web server, so development for the WiFi project will be beginning shortly. The way I see it, the key to creating a successful site as opposed to the ones that have existed previously, is to make sure that all the relevant information that people might want (information such as available bandwidth, number of outlets available to customers, whether or not you need to purchase a coffee to get a code before you can use the internet, &c;) is available, make sure it's presented in an easy to use way, and, most importantly, make sure that the list is complete enough and the site good enough that users actually want to contribute. This will never work if I just try and make a list of cafes with WiFi that I maintain myself; it absolutely needs to allow for contribution by users. People need to not only be able to find out that the Boloco in Davis Square has free WiFi, they also need to be able to add the Grand Prix Cafe to the list as well if it's not already there. They need to be able to let other visitors to the site know if they've had problems connecting to the network with Vista or OS X or Linux, or if the staff at that particular cafe tends to be rude with people who spend 'too much' time using the WiFi. There's a whole lot of information out there that someone looking for a place to get WiFi could use, and the only way to make sure that all that information is available is with some sort of community participation.

Basically, this is probably going to turn out to be a pretty large project. It will be interesting to see if and how it grows. It will also be interesting to see how much data needs to already be on the site before it hits that critical mass point and becomes useful enough for people to want to add more data on their own. It should be fun.

Boston's Restaurant Week

July 11th, 2007

Most of you probably know about Boston's Restaurant Week. For those that don't, it's a week (or more) that happens twice a year during which participating Boston area restaurants offer meals from a prix fixe menu at very low prices. For example, Excelsior will be offering a three-course meal for $33.07 (I might just have to give that a try).

What you probably didn't know is that there's a fantastic website at restaurantweekboston.com (offered by bostonchefs.com) that will show you all the participating restaurants, the details of their participation, the prix fixe menus that they are offering, and a Google maps mashup to help you locate and get to those restaurants.

I helped create it, so you should go use it to help justify my services. ;)

Working from home

June 29th, 2007

For the past year or so I've been doing pretty much all of my work from home. Occasionally I go into a client's office and work from there, but the vast majority of my work I do here. Right now, for example, I'm sitting on my back porch.

This week, however, has been a little different. As anyone in the area knows, it's been extremely hot. Over 90° for the past three days in a row with about 50% humidity. Not pleasant. We have an air conditioner in the bedroom, but I prefer not to run it if I don't have to so I've been doing a lot of work from elsewhere. Specifically, I did a lot of work from the Breugger's Bagels in Porter Square. They have free WiFi and free air conditioning, so it's a pretty good deal. Yesterday and today I also spent a little time working at the Boloco in Davis Square. Their air conditioning isn't nearly as strong, and wasn't quite enough yesterday, though their free WiFi seems a little more reliable and faster.

Anyway, working from Bruegger's for basically an entire week was an interesting experience. I definitely wasn't the only one; every single day there were at least three or four other people there with their laptops working. Oddly though, there were very few people who did it multiple days. I definitely saw a buch of the same people every day, but they were mostly people who just came in for lunch. The people who came in to do work generally didn't seem to make a habit of it (except me, of course).

I also discovered something about myself. I found that it's much easier for me to focus on work and be productive when I'm not at home. Pretty intuitive really, but the extent to which it's true was surprising. I was definitely much more productive when I was working from Breugger's or Boloco than when I work from home; which isn't to say that I'm not productive from home, just that it's a little easier to get work done when I'm not. As a result, I plan on working from other places more often. This should help my productivity, probably my quality of work too, as well as just get me out of the house more, which will be nice. I only wish that there were more places around here with free WiFi. It's basically Breugger's in Porter, Boloco in Davis, The Druid in Inman, and Grand Prix in ...uh ...out past Porter on Mass Ave. Those places are all nice, but of them only Breugger's and Boloco are really that good for working. The Druid is a bar and doesn't have the most comfortable seating and Grand Prix just doesn't do it for me. I tried working there, but the big Plasma screen showing Sky Sports kept distracting me with rugby highlights. Maybe this is something I can help address as part of the Young Somerville Advisory Council.

In the meantime, I'd like to compile a more complete list of the places in Cambridge and Somerville with WiFi. There's any number of websites out there that claim to have a searchable list of this sort of thing, but in my experience they're usually pretty poorly done. I'm not sure why that is, it's an extremely simple concept. Maybe once I have a big enough list I'll try making one of my own. It's the perfect application for a Google Maps mash-up. Might even make a good added value service for the dy/dx tech website.

Anyone have any suggestions for good places with free WiFi in the area I might not know about?


copyright © Joshua Ourisman 2006-2010 all rights reserved