Archive for the ‘Webdevelopment’ Category

Other activities..

Wednesday, October 11th, 2006

Blame me for not keeping you updated :X

I do a lot on web developing (PHP5 and mysql), and that’s what I’ve been doing over the past month and still do. One of my brews is a PHP5 (Object Orientated) script/class that acts as a gateway between a web-application and WHM, which is the administrating module that comes with cPanel.

cPanel does provide a script to do this. The problem however is the way it does. It origines – according the copyright notice – from 2002, and looks like it was programmed in php3. Try to turn on error_reporting for fun, and scroll down for minutes, before getting the actual output (= hopeless). The old (cPanel)script syntax is described here

The intension of my class is that everything between the constructor and destructor is handled over one HTTP connection. Unfortunately the WHM-webserver (which is a derival of apache1.3) doesn’t support the keep-alive http option. No luck so far, however I contacted cPanel, and expect to have this feature enabled soon.

The script below supports the same functionality as the original in exception to a SSL-connection to the WHM-server. The functions IsSuspended and ListSuspend() are a few ones that weren’t available in the script of cPanel. I’m also thinking abut adding a feature to down-/upgrade diskspace and bandwidth limites per account. If you’re interested, let me know…..

(more…)

python for webscripting

Sunday, August 6th, 2006

Recently i decided to try and build a website for http://www.moshe.nl/ (again). I know python’s wsgi interface well, because i’ve done some webprogramming. This time I didn’t want to “program” a complete website, I merely wanted to be able to use python (and wsgi) for some scripting (like powering a contact form).

I started building some “browsing” functionality, at first it used dir(SomeObj) to gather the contents of a “directory”, it worked straight forward by using the wgsi application class to figure out another object to call, and it calls it just like it is another wsgi application. After working on the layout for a bit (i didn’t want to write a wsgi framework, I wanted to build a website ;) ), I made a ’static’ directory class, so I could just include real dirs along with the dynamic code.

This way, I build a flexible framework in a couple of hours. It really is nothing special, but now I have a framework I know, and one that is able to adress my needs for ocasional python scripting. Maybe I’ll release the framework when it is crystalised a bit further. And when my site is in a state worthy for everyone to see, the framework can be seen powering www.moshe.nl :D

For everyone thinking about using python for website programming or scripting, it is worth the try. Either with a framework someone else built, or by writing some lines of code yourself, The startup of a site with FastCGI and WSGI (my favorite setup) is a bit more difficult than a php like setup, but it is a very clear and easy way once you are familiar with it.

(So far for my first post here.)