Archive for April, 2008

php and ajax adventures

Today started out with a woeful surprise. Snow!?!? Yeah I know I’ve lived here in Minnesota for almost five years now, and I’ve never seen snow this late in April. I hadn’t coded in awhile, not for about two weeks. Desayuné, me lavé los dientes y me puse mis ropas en el cuerpo. After that I started up my laptop.

I had recieved an email from Scott VanderVeer Thursday night, asking me about The Source. The Source is an early scripting job that I did for the youth group at Trinity Presbyterian Church that I was more actively a part of in the past. This was before I become a more regular attendee and member of Emmanuel Mennonite Church. The Source kind of died out about 5-6 months ago. Maybe Scott can give it the new blood it needs to take off again. So the first half of the day was spent interspersed between giving Scott assistance on the finer points of DNS issues and PHP scripting, interspersed with various household chores.

After lunch was spent working on a contract coding job for these guys that call themselves, “Tribal Shaman” and “Zerja Sone”. They are working this upstart cracking/hacking network called XSSLink and Prohacks.org. I got called in to write the backend PHP/MySQL data processing and arrange the hosting, as they have other tasks at hand. Something about affiliates and investment return. I would have to say that the XSSLink backend is my craziest undertaking to date. “Tribal Shaman” wanted a completely Plug ‘n Play tracking method in Javascript as well as a monetized linking system at minimal cost. So I will be attempting to load balance across a couple free hosts. It will be risky but worth the payout.

And now as I write this at almost half past 11pm I feel my body asking to sleep. Which then got me thinking about this interesting venture called, Rockabye Baby!. The go by the logo, “Transform your favorite rock music into baby music.” They Green Day riff on the front page certainly sounds calming. Just imagine a couple years down the road, “Daddy … why do you have a different version of my lullaby music on your computer?” Which could turn into a valuable teaching moment about the world in general and what the artists are getting at when they offer up their work to the world.

media UPnP and DLNA

Last weekend I was playing around with running nginx, SSH, vsFTPd, and MediaTomb on this 1GHZ, 512MB RAM machine that I jacked into my network. So let me get the obvious things out of the way first:

  • SSH for administering
  • vsFTPd for getting files onto the media server
  • nginx for serving the media files externally to the WAN

What is this MediaTomb you may ask? It is a DLNA/Media UPnP server daemon, that is administered via a sleek javascript front end, and run by a fast C back end (for nix machines). There were issues though, when I tried accessing it from the new DirecTV set top boxes that have network/internet support built in. According to my dad, who works for DirecTV, the boxes are supposed to be able to access DLNA compliant content. It is not an advertised feature, just an “under development” feature. He says the only reason that ethernet ports are on the set top boxes in the first place is for VOD content, served by Limelight Networks. In the future, the DLNA support will probably be phased out, but for now I guess I’ll get to have some fun.

A Debian LEMP system

Yesterday was spent perfecting a Linux, nGinx, MySQL, and PHP setup on the lower end Optiplex I picked up last week. For those of you new to the Linux scene I suggest Debian or some other Linux distribution that has an automated package management system. The base install for Debian is about 200MB and has many of the core libraries you need, preinstalled, which makes it great for putting together a server on just about any old hardware. I am running my setup from a 20GB hard drive, 128MB of PC 133 RAM, 866MHz Pentium 3 processor, and an on-board 3com 10/100Mbps network interface (a Dell Optiplex GX150).

In case your Debian netinstall doesn’t have network connectivity while installing, you might find the following tutorials helpful once you get log in as root.

For those of you like me who don’t use ‘nix machines everyday a quick refresher on bash commands might be handy. You don’t want to forget how to extract tar.gz archives: tar xzf filename.tar.gz

I started out flying solo on this one, piecing together each bit of software I needed. After trying many different software combinations, I landed upon a tutorial on How to Install a Complete LEMP on Debian or Ubuntu. It is a great tutorial that I followed after failing to get PHP to work on my nGinx install.

Deviations from the tutorial:

  1. I didin’t need any email functionality so I skipped the Postfix and Dovecot install
  2. You don’t really need the package php5-xcache, plus it is no longer available.
  3. The command: “apt-get install mysql mysql-server” should be –> “apt-get install mysql-client mysql-server

After you are done with the entire setup, I suggest installing a few Nginx modules:

Need PhpMyAdmin? It works great on nGinx as well, once you have phpfastcgi installed. [Link Slicehost.com]

Finally for ftp access, I suggest installing vsFTPd.

  1. apt-get install vsftpd
  2. vi /etc/vsftpd.conf
  3. Change the configuration file to suit your needs.
  4. vsFTPd uses the user accounts of the local system, so if you need to add an ftp user, add a user account for the local system. [About adding user accounts]

Why did I decide to try out nginx?

  1. nginx is the most efficiant when it comes to handling large amounts of traffic
  2. the nginx configuration file is very easy to update
  3. when updating nginx, no downtime is required

Return top