March 4, 2007

0.6 - Backups

Filed under: Releases — edg @ 11:06 am

The design of a structured backups module is being made complex by the structure of the existing stuff but i have found by writing down how everything communicates things become more clear.

Whenever a hook is called as a parameter it takes a variable it calls $data. $data is often used in the frontend for user information and logical actions. In effect you have multiple data variables at once, one solely used in frontend code but one which is used for all hooks that are called. Clearly it is useful for a frontend hook if it calls the variable data and receives the frontend’s $data variable (which is a reference by the way) so it the frontend data can be modified by the hook or whatever other variable was given to the hook.

The problems at the moment are that functions in the backup module seem to have little use and need replacing perhaps entirely by more structured functions to be called by other modules from the backend as a response to a call_hook. However in keeping modules structured modules should probably leave functions in other modules enitirely alone. Although this does not make sense for modules like backup which provide functionality to other modules, and since unix users is also something which perhaps provides shared functionality modules should have access to each other’s functions.

For now i will start by improving the backups_create function and initiating a commit call in the frontend code temporarily to remove the jumping around between functions. I think it is unwise to use $data as a variable in the backend code when we have something similar hanging around in the frontend code. At least i now know that $data is not actually sent to backup.php when it forks on behalf of the backend. So many variables floating around :)

March 1, 2007

PowerDNS Module

Filed under: Supported Programs — pdrake @ 11:31 am

I have moved the PowerDNS code (supporting PowerDNS through a MySQL backend) from lib code into a module. The code was based on my original code for the MyDNS module and there have been a number of bug fixes and enhancements to the MyDNS code so I have updated the PowerDNS code with those changes. If anyone tests and finds errors in the new implementation, please open a bug report.

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.

February 3, 2007

FreeBSD…the OS for me!

Filed under: Miscellaneous — edg @ 8:19 pm

it seems i’ve found the OS for me.. i know i change things around a lot but finally after two tries of FreeBSD i really like it.

Hopefully my general use of FreeBSD will help with web-cp development whether i have a FreeBSD VM running on top of my main FreeBSD or use a jail somehow or just in general use.

The main things i like about FreeBSD on the desktop/laptop are:
- Powerful, stable, advanced (Advanced high performance memory management and very effective file system)
- Support for other platforms - SMB, MSDOS/FAT partitions support…(sometimes not something that’s always there on a linux install or always working.
- Full WIFI and Bluetooth stack supporting WPA, WEP, WPA-PSK you name it from the OFF!! I’ve not seen a single Linux distro to date that does this (only comparing with ubuntu really but that is one of the best of the Linux distros) Bluetooth and wifi are incredibly easy to get to grips with on FreeBSD with the handbook’s help and installing the ndis wifi driver was very simple. Ubuntu didn’t properly detect my card or provide the WPA options i needed.
- DVD support - all i had to do was install VLC and DVDs worked. Ubuntu is one of the best Linux distros and when you try to play a DVD on 6.10 it is useless..until you mess about with “easy ubuntu” third party software and lots of extra package repositories!
- No requirement for Gnome/KDE/Anything bloated (you can setup what you like and remove it without having hundreds of dependancies pop up in your face or ubuntu style telling you ubuntu base must be removed or debian getting confused or fedora which doesn’t give you many options with package management i found)
- Customizable to the full, you can install what you want and do just about anything.
- Hardware support easy to add if not there (just load a kernel module and your soundcard is there, add it to loader.conf and your done! no messing with hundreds of choices then to find your card stops working, also better sound quality than linux distros it seems to sound better)
- sysinstall may not be a 3d or GTK GUI but it does the job very well giving lots of options, configure everything from services to networking to packages..
- installing the kernel source (required if you have to use NDIS windows network drivers for something - my realtek LAN card which is incredibly hard to get working with linux even though they make drivers and really hard with ndis on linux) was easy peasy..

All this adds up to a very easy to use system, if something’s not as you want it you can add a line to sysctl.conf or loader.conf changing the setting, most things are done via sysctl settings or kernel modules. ACPI follows the specifications better than linux installs and works out of the box on my laptop although using the Sleep states isn’t going too well just yet but i am working on that, it may just be i have to tell ACPI that its really running on windows NT :D

The package manager is well organised on FreeBSD and the installer is flexible, small and simple…

The only annoyances i find are:
- FreeBSD has no official ati graphics support - but that’s only required for gaming in 3d something not common for me anyway.
- Sysinstall seems to always ask what FTP mirror i want to use, it only takes a couple of key presses to choose FTP Passive -> UK but it would be nice if it saved the package location you used most.
- Sysinstall package search is not the most easy thing in the world

I’m on the lookout for a package management tool for freebsd but i’m guessing that you have to use sysinstall, it would be nice to have something in GNOME which i could use.

Either way the way everything works on FreeBSD and the hardware support make it a really cool OS, not to mention the performance and solid design of the kernel. It really seems to be in a different league from most Linux distributions - but maybe i’m just tired of seeing the same old - installer, install gnome, here’s your gnome everythings the same, wifi doesn’t work, dvds don’t play, hundreds of rubbish packages i don’t want installed by default, no propper ACPI support etc..

I just re-setup GEdit so hopefully it is now ready for tackling some web-cp… depending on whether i have it setup well enough to enable me to ignore the HTML and PHP together.

FreeBSD is a very nice platform - i encourage you to try it if windows or linux is annoying you. Although obviously there are things that you may need to consider such as nothing’s perfect and you may have some obscure hardware that is not yet supported, but that applies to anything, you will probably be pleasantly suprised at just how well-supported things are on FreeBSD. It has a well-made, uncheap feel :D Maybe the best bit is you don’t have to spend hours compiling bluetooth support or something into your kernel or wifi or messing about and you don’t have to mess about in text files comenting and uncommenting, you just change a sysctl value if something affects you..

…and the best bit is it has screensavers for the text console HOW COOL IS THAT!!! well i think its quite cool…. although i was suprised that i had to download Java JDK from freebsd foundation instead of being able to select it on sysinstall (presumably because Java only recently went GPL so they couldn’t include it until now)

edg - at a very uncluttered GNOME desktop

January 24, 2007

New module pop3

Filed under: Miscellaneous — edg @ 5:18 pm

server/lib/pop3.wcp.phps has been moved to a module.

don’t know if a mail / imap / pop3 module is best or just seperate imap pop3 but pop3 just seems to ensure a user’s mailbox in /var/spool/mail is renamed if a user is renamed and removed if removed… maybe this module should be renamed mail or made to support imap i’m not sure i just thought it was good to get the functionality out of pop3.wcp.phps as i was trying to cleanup functions.inc.php on the backend end.

anyway we’d need an imap managing module at some point really…

any thoughts?

November 14, 2006

Important module system changes

Filed under: Miscellaneous — edg @ 4:09 pm

Please note that the module system has now been changed in the following way:

Dependencies and Exclusions are now written in the format “modulefilename”.

This is the name that the file name starts with for the module, e.g. for unix_users.mod.phps the dependency to name would be “unix_users”.

Please note the underscore not hyphen.

This has been changed in all places in web-cp which deal with dependencies. The is_registered and is_enabled functions now expect to receive a file name rather than a module name. If you put “unix-users” as a dependancy then there is no chance of the system recognising that you want unix_users to be installed.

This has been noted on the wiki and forums also.
Please also note that i accidently committed these changes without adding a log note in cvs… i don’t know if its possible to add a log note without changing all those files that were modified. (A few modules referenced unix-users when they need to talk about unix_users since it is the actual name of the module file)

Just to make sure people understand this, the dependencies system does NOT use the Module Name (e.g. ‘Backups’, ‘Apache’, ‘Unix Users’, ‘NSS-MySQL’), for obvious reasons it uses the module part of the filename of the module (e.g. unix_users, nss_mysql, bw_quota) So if you want to list NSS-MySQL as a dependency then you would look at the file name of the NSS-MySQL module, realise it is nss_mysql and then specify “nss_mysql” as the dependency.
EdG

November 13, 2006

Setup changes

Filed under: Miscellaneous — edg @ 4:01 pm

I just committed some significant changes to setup.

The following changes are made:

1. Moved each step in setup_config.php to its own file to make things clearer.
2. Removed unnecessary code
3. Cleaned up case statements
4. Added comments

Each step now has its own file so if you want to change step 1 you simply edit setup_step1.php

This hugely reduces the clutter that was at the bottom of setup_config.php.

However the use of case statements and ? conditionals may still cause problems so there’s lots to work on in the various setup stages.

Also please note that only the part of the step that actually shows it to the user is in setup_step1.php or setup_step2.php etc.
Certain operations are still done at the beginning before any output is provided to the user and these still remain in a switch statement at the top of setup_config.php.

I also removed some redundant code e.g. there is no reason whatsoever for send_header(’Location: http://’.$_SERVER[’SERVER_NAME’].’:’.$cfg[’port’]);
to be in every case statement for every step since it happens exactly the same where it does happen. Simply making sure it only runs when $error contains nothing is all that is necessary.

I will try to better comment the setup process and work out issues as i get time. I would also like to if possible find a way of re-organising the cfg variables because so many of them have names that are not useful and we have previously talked about caching of the config file… perhaps most could be stored in the database e.g. like phpbb and then just retrieved on each page.

I think we may need to start categorising modules since we have so many now. We may also need to work on the dependencies of modules. This would also help setup_config.php since there is a huge amount of dependency code at the modules step.

At some point we also need to go through a lot of things with a fine-tooth comb as they say and try to conform to Gyrbo’s code guidelines - see http://web.archive.org/web/20051119075844/http://www.gyrbo.be/?page_id=2

November 11, 2006

sockets

Filed under: Miscellaneous — edg @ 9:58 am

webcp-httpd uses sockets to receive and respond to requests.

we are currently having some issues with webcp-httpd’s use of sockets whereby socket_accept returns false for no apparent reason. If anyone out there has sockets knowledge please check out the development forum and see if you have an answer.

Perhaps we should contact the origional author of server.inc.phps listed at the top of the file?

November 5, 2006

mod_cband

Filed under: Miscellaneous — pdrake @ 10:30 am

Snert recently stopped distributing mod_watch and due to the restrictive license, we are unable to distribute the module on our own so we needed to find an alternative. Given the popularity and stability of Apache 2, we needed to select a module which is Apache 2 compatible. mod_cband has been selected to replace mod_watch as the transfer monitoring and limiting tool for web-cp 0.6. It supports both bandwidth and transfer quotas. mod_cband supports extensive options for limiting or preventing access to websites which have exceeded their transfer quota including reporting only, limiting bandwidth, serving specific pages, redirecting the user, etc allowing the server administrator to select the appropriate action based on their policies. The new module is named mod_cband.mod.phps.

October 30, 2006

New DNS Modules

Filed under: Miscellaneous — pdrake @ 9:31 pm

BIND and MyDNS functionality has been moved to modules. Also, the template editing function within the server panel has been set up with a new hook so that modules can add their own template files to it automatically.

« Previous PageNext Page »