Server management

I’m looking to code my own server management / webbased control panel via php.

This will be used for another business that demands a dedicated server and not shared like dreamhost.

Basically, i want something similar to the DH web panel - for users to add/edit/remove shell/ftp users, domains, mail, databases, etc.

I have intermediate knowledge of PHP and MySQL to at least get a head start.

This is what my plan of attack would be.

A user visits which asks the user to enter their account number. The script then checks the database to see which server that account number is associated with. The script then redirects the user to lets say server 13, so it would take them to From there they would enter their username and password to access the web panel.

A cron job will be set to run every 15 minutes or 30 minutes to execute shell scripts such as changing user passwords, adding users, removing them, etc.

Is this a good plan of attack, or does it pose security? I would prefer to run shell_exec to process commands immediately, which will also reduce the amount of server overhead. However, I can’t run shell commands without running as root. Any suggestions on how I can go about doing this?


This is a huge undertaking, and not one that should be attempted without expertise. Any security problems in your application could open up the server to all sorts of nastiness.

Something to keep in mind is that you can’t run interpreted scripts as root – you’ll need something compiled (eg, written in C, Java, etc) to do this – and you’ll need root to do pretty much any of the stuff you’re talking about. You may also want to reflect on the fact that it’s 2007 and there still isn’t anything much better than crap like cPanel out there for this. This should speak volumes about the complexity of this sort of thing.

Unless you’ve got a developer team experienced with this sort of thing, you should probably just use one of the existing control panels or, if user friendliness isn’t an issue, install Webmin on everything.

If you want useful replies, ask smart questions.

I have to agree 100% with kchrist.

However, don’t let that stop you from starting to code something up to see for yourself. At the very least, you’ll learn :slight_smile:

You also might want to start by prototyping your system to manage a single server to remove some of the complication, then progress from there.

Good luck! - The simple, audio podcast search engine.

I agree its going to be a challenge, but who knows if I come up with something down the road a year or two from now that has a panel as intuitive as DH’s. I personally hate Cpanel. Webmin isn’t too bad but it doesn’t have a professional look to it. Plesk is the closest thing out there to DH.

I already have intermediate knowledge of PHP and MySQL. Been using it for 5 years now. I just picked up a book on APACHE and how to program in SHELL so by the end of spring I hope to have grasped the concepts.