August 30, 2007

Zimbra Messaging Suite

Filed under: New Features, Supported Programs — pdrake @ 3:18 pm

Today, I’ve committed a new module to fully support the Zimbra mail suite from within web-cp. If you aren’t familiar with Zimbra, it is a feature-complete open source replacement for Exchange Server. It provides full mail, calendar and document sharing functionality (integrated) as well as mobile connectivity and Outlook support (as commercial add-ons). The webmail is AJAX based and feels like a desktop mail application. Also integrated are spam and antivirus scanning. The new module utilizes the Zimbra administrative soap interface with transport via SSL to ensure the security of all management functions.

July 30, 2007

Backups progress 2

Filed under: New Features — edg @ 11:23 am

Right now the main thing i’m working on is how a backup of a reseller/domain is done recursing through the users and domains to be backed up. At the moment a reseller backup will provide a choice of domains to backup but all users under those domains will be backed up so backing up the domains and users is part of this. Also how various hooks work together to build the backup. A backup manager function is in charge which calls the relevant hooks.

I’m beginning to realise how useful some of the techniques of last years computer science lectures are in this. E.g. splitting things into functions where code gets too complex and the manjana(sp?) principles like if you need a specific function to do something write the empty function and write the rest as if that function exists, then work on the function, allowing you to skip thinking about the specifics for the moment…

Also i can’t imagine my life without a text editor like Crimson editor :D it is without a doubt the best and most functional editor i’ve ever found. Most useful are things like opening and saving files to a remote ftp server so i can save direct to my test machine and the ability to have multiple files open in tabs, also indenting, saving a backup file every time you save and conversion to unix file types are great. It has a huge number of features and i would recommend it to anyone.

I found the project features useful when manually editing Visual Basic form files for my a level computing project :D

For anyone not developing on windows i would recommend something called CUTE which is an awesome text editor….although you’ll probaly have to compile it its worth the trouble. Or there’s always GEdit.
EdG

July 29, 2007

Backups progress

Filed under: New Features — edg @ 10:52 am

Okay, i thought i’d provide an update as to what’s going on with the backups module. Everything functions fine as to creating a backup and the process for restore is very similar but putting domain backups inside reseller backups and things like that are more complicated. Due to this i have followed the policy of one run of backup.php means one reseller, domain or user backup so far.

I have since decided to move backup.php to backups_backup and to make this run as a hook. The alternative was forking a backup function (which would have been very similar to just calling the hook anyway). If the hooks method doesn’t work out i will go back to the forking idea. But for now i’m working towards easy maintainability which means hooks.

I just committed an update in the CVS to webcp.php to improve the method used to tell the backend to call a hook. This now allows you to send $data to it in the $extra part of commit with the module to run rather than just the module to run. Whether data is global or not isn’t really helpful to me because obviously the backend and frontend are seperate so data has to be sent anyway. Now you can call a hook with some data in the backend from the frontend. In future i think forking the call_hook would be a good idea for security and performance. Maybe the seal should be checked or something i don’t know.

The idea is to register hooks as follows to allow a single call to call_hook(’server:commit:backup’, $data) to run the whole process from start to finish.

// Setup backup hooks
register_hook('server:commit:backup', 'backups_backup');
register_hook('server:commit:backup', 'backups_generate_archive');
register_hook('server:commit:backup', 'backups_ftp_archive');
register_hook('server:commit:restore', 'backups_ftp_archive');
register_hook('server:commit:restore', 'backups_restore');

Clearly calling server:commit:backup will be done by webcp.php using commit(’module’….). The idea is that the backup, generate_archive, ftp_archive and any other functions will all run on the data in sequence (i may have to sepcify priority to confirm they run in order i know there’s a way to do that with register_hook). This should make maintaining the module simple if all goes to plan.

Right now i’m working on moving to hooks rather than relying on calling backup.php from the backend with specific data and gathering it later.
EdG

February 13, 2007

clustering web-cp

Filed under: New Features, Supported Programs — pdrake @ 12:40 pm

I have recently begun moving my web hosting architecture over from standard single-server setups to a high-availability, load-balanced cluster. I am currently using Ultramonkey 3 for my cluster. It consists of two load-distributors(LD), one active and one hot standby, which are linked via heartbeat so that the hot standby can take over in case of active LD failure and two real servers (RS). The services on the real servers are monitored by ldirector and the load director only sends traffic to the appropriate real server (based on availability and load). I currently synchronize the real servers using csync2. This setup has impressed me thus far and so I intend to move it from development to production. In order to do so, I will be creating a web-cp HA-LB clustering module to attend to the relevant clustering functions and which will provide system administration capabilities. The following are the functions I intend to implement in the module:

  • Multi-server actions (actions in the DB are executed on each real server).
  • Configuration of scheduled file synchronization.
  • Domain, reseller and server-level option to sync files between servers (for immediate sync rather than having to wait).
  • Status monitoring of LD and RS and their services.
  • The ability to report server load from RS to LD for weighting.
  • The ability to add/remove RS on demand with web-cp notifying the LD.

October 26, 2005

new tomcat module

Filed under: New Features, Supported Programs — pdrake @ 9:03 am

This morning I finished up what I spent most of last night working on - a Tomcat module. This module adds the required JkMount directive to the Apache virtualhost file as well as managing the required entries in the Tomcat server.xml file. I imagine that this module is not yet perfect but it does handle domains, subdomains, aliases and pointers right now. The host configuration is defined by a template which the server admin can edit using the templates function. The module does not currently handle tomcat users and roles to allow for restarting, deploying, undeploying, etc. Once I learn a bit more about managers, security realms, roles, etc maybe I can make this happen.

You must ensure that the $cfg[’tomcatpath’] setting within the module points to your Tomcat installation (default /usr/local/tomcat), $cfg[’init’][’tomcat’] points to your stop/start script (default $cfg[’tomcatpath’]/bin/catalina.sh’ and $cfg[’spid’][’tomcat’] points to your tomcat pid file (default /var/run/tomcat.pid) and you should be all set.

As always, feedback and constructive criticism is welcome. Remember that this module is not even beta-quality code so expect bugs but please report them.

While developing this module, I discovered and fixed bugs in subdomain creation, pointer creation (both when using multiple IP addresses) and the SSL module. Additionally, the SSL module needs to either be extended to handle SSL certificates for subdomains and pointers or the SSL sslang entry needs to be limited to domains in some way. Preferrably, the SSL module should be expanded.

October 22, 2005

ssl module

Filed under: New Features — pdrake @ 10:36 pm

Today I committed a new module to the 0.6 CVS - an SSL module. This module can create certificate requests, generate temporary certificates or upload certificates you may purchase from an SSL certificate provider. It does not handle adding intermediate certificates, however. This may be something that should be considered but I am very unfamiliar with the process of adding these certificates… anyone want to help out in this regard? Most of the code was contributed by Mike. I have converted the contributed code into a module and reviewed the basic functionality but have not performed an extensive review to ensure it follows the web-cp coding standards. In developing this module I discovered a number of bugs (one in the apache module among other places) so if you want to test this module for me, please update all your code.

October 20, 2005

cron module

Filed under: New Features — pdrake @ 3:07 pm

Believe it or not, I really have been busy coding away on web-cp these last few days. There’s still a lot to do and anyone who wants to jump in and contribute would be very welcome! Today I completed adding the hooks required to add quantity limited features to resellers and domains. I also completed changing the basic cron code over to a quantity based system. Now resellers can have a quantity of crons which they can then assign to domains (or not, as appropriate). Once this is done, domain-level users can create crons up to the quantity granted by their reseller. The entire user-defined cron functionality has been encapsulated in the cron.mod.phps module and can be enabled or disabled by the server administrator using the module management page. Also, quite a number of bugs or annoyances were discovered and fixed during my coding sessions. Download the latest 0.6 CVS and check it out!

As always, feedback and constructive criticism is welcome. Remember that this is not even beta-quality code so expect bugs but please report them.

October 14, 2005

nss_mysql module

Filed under: New Features — pdrake @ 4:10 pm

Well, given that we now have a virtual user system which supports using username@domain.tld to login to the control panel, I felt that it was about time to support the same kind of logins throughout (mail, ftp, ssh, etc). The best way to do this, it was determined, was through nss_mysql. Today I installed nss_mysql and wrote a neat little module (nss_mysql.mod.phps) which will enable these kinds of logins system-wide. A few gotchas:

In /etc/nss-mysql.conf and /etc/nss-mysql-root.conf ensure that all group-related table settings are commented out.
In /etc/proftpd.conf ensure that PersistentPasswd is set to off.

Once you’ve done that, you’re all set and virtual users will work virtually perfectly!

October 13, 2005

custom logos

Filed under: New Features — pdrake @ 10:46 am

I guess I’m just on a roll these days. This morning I went ahead and coded a feature I’ve been meaning to add for quite some time… the ability for server admins and resellers to upload custom logos. The new module system allowed me to add all the required functionality in 1 file - logo.mod.phps in the modules directory. I also fixed a number of other pages while I was at it so if you’re using 0.6 CVS, you probably want to update to the latest version and check it out. Man, the new module system makes enhancement of web-cp so easy that these new features practically code themselves. Woohoo!