Directory Hierarchy

From GeeklogWiki
Revision as of 23:03, 14 September 2006 by Amckay (talk | contribs) (Multi-Domain Directory Structure)

Jump to: navigation, search

By Alan McKay

These are currently just notes but soon i'll be organising them into a general discussion on the way i manage my geeklog installations. While I do not yet have a (mostly) fully-automated means of administering many Geeklog sites, I have finally put together an organisational mechanism which will eventually allow me to write a collection of automated PHP scripts to do the rest for me.

Path To Geeklog

Have a look at all of the variables in config.php which are based on /path/to/geeklog, and realise that any of these should be movable anywhere, and Geeklog will still work fine. Plugin writers should note this as well - most of my own plugins do not adhere to this standard, and break. Though my latest "books" plugin should work fine.

Multi-Domain Directory Structure

On my server all domains live at /home/username/domains/hostname.example.com/, and geeklog is always at /home/username/domains/hostname.example.com/htdocs/geeklog-x.ysrz. I also maintain under that a /home/username/domains/hostname.example.com/vdirs/ into which all virtual directories go. So plugins should ideally go into /home/username/domains/hostname.example.com/vdirs/gl-plugins/pluginname/public_html, the latter of which maps to http://www.example.com/pluginname/. You have to use similar webserver tricks to map in any admin, layout or other parts of the plugin which may be included (depends on the plugin). Always ask the plugin author if unsure whether it will work like this. But any good plugin should adhere to those GL base system variables.

Plugin Versions

My setup is actually a bit more complex than above, I just wanted to separate this out into it's own little subsection. Instead of /path/to/gl-plugins/pluginname/, I actually do /path/to/gl-plugins/pluginname-version and then use a symbolic link to point to /path/to/gl-plugins/pluginname, which is what the web server points to. This way you can keep many older versions around between upgrades of various plugins, and just use symlinks to link in the current version into the web space.

And So On

Similary, any directory where you want to store anything at all which is not part of the base Geeklog distribution, you should map into the web space virtually with your webserver. This will make life so easy for upgrades you'll thank yourself many times over for taking a bit of time up front to do it.

Websever Tricks

Apache 2.x

Use the webserver's virtual-directory capabilities to map all plugin files into the main geeklog directory. That means that when you are logged into the =bash= prompt, your files will be at the well-known /path/to/geeklog, which cooresponds to http://www.example.com/ in the web space.

The following entry is from /etc/httpd.conf on my main brewing webside http://www.bodensatz.com/

        Alias /filemgmt_data/ "/home/bodensatz/vdirs/filemgmt_data/"


more to come ... 2006.09.14