Archive for the ‘web’ Category

A common purpose

Thursday, June 19th, 2008

Ian Robinson posted a callout to any Cocoa developers in Northern Ireland (and wannabees, I presume). He wants to form a group to get together in order to dicuss Mac and iPhone development. Great stuff.

However, there’s another fledgling group of misfits meeting under the banner of Xcake.

Let’s get together, and code ! (You kinda have to sing that so it doesn’t sound *too* silly)

VirtualHost at Localhost

Wednesday, April 23rd, 2008

So, once I got mod_python running, the next task was to get a Django app up and running on the machine. Which led to my next question, how to I set up an Apache VirtualHost on my local machine. Up to this point, I had deployed all my mod_python apps to the Linux VM running, making it trivial to set up VirtualHosts for all my projects. The answer, as always, was simple.

Simply add your VirtualHost as always, then add it’s name to your hosts file. Talk about a Duh moment.

So I set up a name-based VirtualHost in apache called, for instance, ‘project.local’ (ServerName project.local), then I add a line to my hosts file

127.0.0.1   project.local

Now, I can browse to project.local on my local machine, and everything works.

I don’t think I’ll be looking for any sysadmin jobs in the short term.

Snakes and cats

Tuesday, April 22nd, 2008

I have a VM running Linux on my MacBook. The main reason being that I could never get mod_python to install into Apache on Leopard. I followed all the instructions I could online. I could always get it compiled, but Apache would always puke when I tried to restart it with the module loaded.

Tonight, the breakthrough.

There are countless blog entries on building mod_python on Leopard, but why not add another one?

  • Get the source (3.3.1 is the newest at the time of writing)
  • When uncompressed, run
    ./configure --with-apxs=/usr/sbin/apxs
  • Open src/Makefile in your favourite text editor
  • Add “-arch x86_64″ to the end of line 27
  • Change line 49 to read “(APXS) $(INCLUDES) -c -Wc,”-arch x86_64″ $(SRCS) $(LDFLAGS) $(LIBS)”
  • Do the make/sudo make install dance
  • Root edit the file /usr/apache2/httpd.conf
  • Uncomment line 116 which should load mod_python.so, however, check that the module is loaded as ‘python_module’

(Update: I think line 116 was there from my last failed attempt at installing mod_python on this machine.)

The last point was the important one for me. There was a default of ‘mod_python_module’ there. Once I changed that, it all worked. I may be talking from my proverbial, but give it a go and tell me how it goes.