I want to give this idea to an enterprising young individual who has the talent to make it happen on a mass scale. Logistically the idea is not all that complicated, however, pulling it off successfully will take some experience with the underlying technologies.
In additional, one will need a passion for server administration, something I do not have. Alright, so the problem is providing an environment for developing web-based software on Linux. This is obviously been done with either shared hosting or dedicated hosting.
The problem with shared hosting is a developer has limited control over the environment. Often the Apache server is running in the background with all the modules already complied in, so changing the configuration is usually limited to what is enabled in an .htaccess file.
The problem with dedicated hosting is unless a Server Administrator is around, the developer is running the server. While the developer probably has enough experience to get everything up and running, there is probably some neglected maintenance. Alternately, the server may not be setup following best practices.
Please do not misunderstand me. I am not faulting the developer at all. I am merely pointing out most developers enjoy creating software, not managing a server. If you feel you do both equally as well then more power to you.
Alright so I have figured out a way to solve this problem by running Apache under a separate instance on a shared host. The actual implementation of this could be done several different ways, I am merely showing a proof-of-concept for the idea.
The setup allows the developer to have total control over their Apache configuration file, including modules loaded and options. The environment allows quite a bit more flexibility than a standard shared hosting environment without the complexity or the cost of a dedicated server.
The actual Apache binaries and install directory could be centralized. The basic structure would be setup on a per account basis with a non-shell account provisioned with every user account. The developer could control their Apache instance from either a control panel or the shell.
The bonus is patching of the Apache server is done once and the entire server is upgraded. Also, since Apache is running under separate processes, limiting the allocation of CPU and memory on a per client basis is much easier.
Finally I will give some warnings because we all hate environments crashing. The developer essentially would take on management of his (or her) own Apache server. If the configuration is not configured correctly, then the website would die.
Safeguards could certainly be setup. For example, forcing a configuration check prior to a restart. If the test fails, then the server is not restarted. Also, since a separate process will eat up more resources than a single instance, the server must be powerful enough to handle the setup.
Now for the fun of the actual setup.
To start, do a standard Apache implementation. You can do this from the package management system of your OS, however, the example below is from a source install. Created a directory where the user logging in has access and duplicated the directory structure.
bin -> /usr/local/apache2/bin
conf
htdocs
icons -> /usr/local/apache2/icons
logs
modules -> /usr/local/apache2/modules/
Please note the '->' sign indicates a symbolic link. If you have not heard of this then you are really missing out (The short version is it is basically a shortcut, but far more useful). The (bin, icons, modules) directories are basically pointing to the installed versions, and the (conf, htdocs, logs) directories should start empty.
Start by coping a standard Apache configuration file (usually httpd.conf), into the conf folder. Then make sure the log files are writing to the local logs directory and not the server version. Test the setup before doing a mass duplication, and make sure to start the instance of apache with the '-k' option.
Let me repeat because this is the key for proper setup. You may want to setup a custom restart command instead of pointing directly to the bin folder of the server-installed version of Apache. To start the instance, run the following command:
/.../bin/httpd -k /.../conf/httpd.conf
Please make sure to edit appropriately. Again, you will probably want to make sure to wrap this in a script which takes the proper directory structure into account. Now you have the basic setup and the entire implementation should be pretty easy to script.
Some final considerations. You may want to control certain portions of the configuration file. For example, the port number or IP address on which the instances of Apache will run. Each instance of Apache needs a seperate port number or IP address. I would assign this centrally to avoid collisions.
Automating assignment should be easy enough. To make sure the developer's URLs for the domains are proper, you may considering running all of these on a private vlan and putting a proxy server in front. The added advantage is caching is possible prior to delivery to the client so performance and server resources are maximized.
I think I have covered everything so please leave any comments or complaints. I probably won't get to all of them, but hey, it works in theory right?
Wednesday, October 8, 2008
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment