Friday, September 24, 2010

SOAP server with perl and Lighttpd

A co-worker of mine turned me on to lighttpd(pronounced lighty) a while back, and it does exactly what it says on the tin, it's the least resource intensive webserver I've found(yet). I deal with SOAP at work, and I've always been curious what's happening in the background, I bought a SOAP book(which was 99% useless). However it said that creating a SOAP server isn't that hard and it provided some steps(I think it was apache based) so I set out upon seeing if there was a less resource intensive solution here.

Thanks to the article here:

I saw that it was possible to create a SOAP server using lighttpd! I thought this was awesome, since I had been using it as a webserver for a while. Even though the instructions said that it doesn't work, I decided to go through them anyways. And I was able to get it to work thanks to a few bugfixes on behalf of the package maintainers. 

A few caveats here and additional packages that aren't mentioned in the article. You will need to install Crypt-SSLeay and SOAP::Lite through CPAN, and also a few packages were needed to be installed through aptitude that weren't mentioned.

Sanity is relative

Any time that I compile more than a few packages from source, I am forced to remember the mouseover text from xkcd:

http://xkcd.com/371/

For the lazy among us, or those of us that are too busy, here's the mouseover text:
"Checking whether build environment is sane ... build environment is grinning and holding a spatula. Guess not."

First random customization

So I've been messing around with lubuntu 10.04(still unofficial) and found that I like it as a server OS. It's lightweight enough that I can throw it on anything and it will play nicely. However for a server you don't need a GUI at all and I just find that it's sometimes nice to be able to have one there. So I figured that starting with lubuntu and just stopping the GUI from running would meet this requirement. However it seems to have been a more confusing task than I had thought.

First, on traditional linux systems, there should be an entry in the /etc/inittab to tell the system what runlevel to start in. However in ubuntu(and all debian I think), they start in 2, and really make no distinction between 2-5. So that solution was out.

Second, since version 7.04(at least) ubuntu has been using upstart to control what is started in each runlevel(unlike debian mainstream, but possibly to be included soon) so I couldn't modify which scripts are in /etc/rc2.d/ and what their symlinks are named.

Third was the fact that lubuntu uses lxde instead of gnome, xfce or kde, but I figured it would use either gdm,kdm or xdm, but could not find a startup script for any of these in /etc/default.

So, I finally looked in /etc/init (which is where upstart places conf files) and found something called lxdm.conf. Could it be possible that they created their own display manager(or at least renamed it)? Well I opened that conf file and found this line:
stop on runlevel [016]


It can't be that easy can it? Since I was testing this on a throw-away vm, I just changed it to read [0126](using sudo of course) and rebooted with crossed fingers.
It worked as I had wanted. 


I think the real issue here is that there isn't only 1 way to change this behavior, but different ways for different distro's. From the look of things, it is likely that the final solution may be the way that they are all going, but it sure seems as if it's quite divergent from the 'old way of doing things'