Digital Butter

Text

You know it’s time to change hosting companies when…

Recently, we’ve been planning on consolidating the various hosting plans that we’ve collected onto a single (new) server, but as is often the case in this industry, it’s difficult to find time for these in-house things. This month, we’ve had a lot of trouble with one of our providers, who happen to be hosting the main bulk of our DNS records. After the 3rd instance this week of the DNS being down (not to mention the entire server being down for 48 hours a couple of weeks ago), we made the decision to go through with the migration ASAP when we received this, very enlightening response to our support ticket.

Support Ticket #1940 has been updated

Description:
Hello,

Please check now.

Thanks

So, I’ve spent the last few days setting up a shiny new cloud server to host all of our projects. Once set up, the only major issue was the lack of fancy control panel to manage the virtual hosts. While this may suit the developers down to the ground, our interns and office staff, who often get the pleasure of this grunt work, would struggle with the Linux CLI. After exploring the existing options and being unable to find anything suitable we decided to build one.

I started by setting up a basic control panel that would store these sites and the full virtual host entries, based on a template, in a MySQL database. I then wrote a PHP CLI script to pull the entry from MySQL, and if necessary create a vhost file and the document root/log directories. I modified Apache’s init script to call my PHP script on start/reload. Perfect!

Next, came the issue of being able to reload Apache’s configuration after adding one of these sites. I created another script that would reload Apache if a certain file existed (created by my control panel), then delete it. Finally, I set up a cron job to run this check every minute.



…Just like a bought one.

- Jude.

View comments
Posted on Wednesday, June 16 2010.

Digital Butter We are a Website Design & Software Development team based in Hong Kong.
butter.com.hkOur new blog - The Churn Ask me anything Submit
Previous Next