Modified webcp.php daemon (part 2)

0 Comments

Well, it’s been a while since I wrote the first part to this little series and thought “what the hey, let’s do part 2”.


As I wrote in Part 1, I used to be involved in a web-hosting control panel project called WebCP (www.web-cp.net) while I was employed at adnewmedia Online GmbH. Now we needed a way to completely automate the creation of hosting accounts on multiple virtual hosting servers. The webcp.php daemon used in the WebCP project was almost there already and needed just a slight push to make it really powerful (dangerous? Depends on how you look at it).

 

Anyway, in the standard webcp.php daemon the service checks for update flags in the form of a tag file. This tag file is read in and the validity of the tag file is checked before doing anything. Once the file has been validated the daemon will execute the steps listed in the tag file. And that is about all there is to it.

 

The problem with the original webcp.php daemon was that it only worked on tag files on the local filesystem and we needed a secure way to inform webcp.php that something needed to be done from across the network.

 

Back then the kludge I wrote was even worse than the one you will see in the source here on the site (it is still just alpha code, more for proof of concept and evidence that it works, so be nice and report back any problems you may have). Basically what I did was to tell webcp.php to check a tag DB table instead of a file and execute the instructions found there. Due to the fact that the tag was being generated by another application that I wrote and the DB was secured I knew the tag that was retrieved was legit.

 

Now, in the version I modified for adnewmedia, webcp.php could not make use of the tag files at all the kludge. Well, that was OK for what we needed it for back then.  In the new version here, the tag files can still be read as well as a tag DB table check.

 

The only problem is that I have slimed the version here down a bit (now called qmacd.php) as about the only thing that was needed by my client was the qmail functions available in webcp.php and the supporting files.

 

In part 3 I will attempt to add the tag DB table check options to the actual 0.6 CVS version of WebCP and begin the long task of rebuilding the centralized automation center for virtual hosting based on WebCP.

 

So. Just check out the Download section for a copy of qmacd.php with instructions on installation. Now, just so you know. If you are not wanting to offer email services or need a way to automatically create qmail accounts then this package will not be of much use to you except as a way of seeing how differing apps can be pieced together with a bit of luck and code.

 

Enjoy,

Chuck

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.