This site is now 100% read-only, and retired.

Creating simple websites with Bamboo

Posted by Steve on Sun 4 Sep 2005 at 07:20

Tags: ,

Bamboo is one of the numerous Wiki packages included in the Debian distribution, it makes creating simple websites with integrated searches very straightforward. Unlike some more basic Wikis it also allows you to create navigation bars, or menus, with nested pages and organise the structure as you see fit.

The Bamboo software is a simple mix of the SQLite database for indexing, flat files for hosting the content, and a PHP front end. Although it will work upon both Apache 1.3.x, and Apache 2.x I'm only going to cover the Apache 2 setup here to save space.

Unlike other Wiki software it is not really designed for having a website which arbitary viewers can edit, instead it is more suited to the creation of simple websites which a single maintainer can easily manage.

To get a feel for how it looks you can view one of the sites known to be running it: The Seattle Community Colocation website.

To install the software you can simply run:

apt-get install bamboo

This will go on to install any of the dependencies which you also need and don't currently have upon your host. What it might not do is enable the PHP4 SQLite extension.

To check for this open the file /etc/php4/apache2/php.ini you should look for the following line:

extension=sqlite.so

(If this line is missing then simply add it.)

Once this is done you should be ready to create your site. The first thing to do is to create the appropriate Apache configuration.

If you are already serving a number of virtual hosts then adding a new one is a simple matter, using the following configuration file:

<VirtualHost *>
  ServerName mysite.com
  DocumentRoot /home/www/mysite.com/htdocs
  ErrorDocument 404 /bamboo/frontdoor.php
  Alias /bamboo /usr/share/bamboo 
  DirectoryIndex index.html index.php /bamboo/frontdoor.php
  Options -Indexes
        ErrorLog   /home/www/mysite.com/logs/error.log
        CustomLog  /home/www/mysite.com/logs/access.log combined
  <Files "b.*">
    Deny from all
  </Files>
</VirtualHost>

You should save these settings into the file /etc/apache2/sites-available/myhost.com - then run "a2ensite myhost.com").

This creates a site which has two directories:

/home/www/mysite.com/htdocs

This is the document root, and where all the site content will be stored.

As pages will be added here via the online interface you should ensure that they are writable by your webserver - we'll do that shortly.

/home/www/mysite.com/logs

This is the location of the logfiles which Apache will save for you, to record incoming connections and error messages.

This setup might not suit your needs, but it is something that has been described here previously when setting up hosting multiple virtual hosts with Apache.

This leads you into the next phase; creating the actual site setup. If you don't have the directories already present first create them:

 mkdir -p /home/www/mysite.com/htdocs
 mkdir -p /home/www/mysite.com/logs
 chgrp www-data /home/www/mysite.com/htdocs
 chmod g+w      /home/www/mysite.com/htdocs

(The last two lines ensures that the Apache process can write to the document root; required since the Apache process will be creating the pages of the site via the Wiki interface).

Once the directories are created you can restart your Apache server with:

/etc/init.d/apache2 force-reload

Now you can create your actual site, by creating a file b.site beneath the webroot. The various options you can include are described in the documentation, but the most basic site setup is:

sitename = MySite
allowed-types = txt
indexbackend = sqlite, .bamboo/b.index.sqlite 

This creates a site which only contains .txt files and is called MySite.

Once you've completed this step you should be able to point your favourite web browser to the site http://mysite.com, and begin creating content.

The menu in the left page allows the creation of navigational structure, and the normal Wiki markup can be used - this is described in the editor itself, so don't worry if you've not used it before.

After you've began to create your content you can look at the security options making sure that random visitors to your site cannot edit the site.

The simplest way of achieving this is by creating a username and password pair within the b.site file then giving that user the ability to modify pages, whilst denying modifications to the "anonymous" user. This can be done with settins such as these:

; user 'admin', password 'mypassword'.
userbackend   = static, admin:mypassword

; All users can view
access-view   = anonymous

; Only "admin" can edit the pages.
access-edit   = admin

You can also change between the two available themes by setting one of :

; The default template
decorator = default 

; A more spartan setup
decorator = spartan

The theme files are PHP files located within the directory /usr/share/bamboo/decorators, and can be edited manually if you wish.

 

 


Re: Creating simple websites with Bamboo
Posted by dan (204.83.xx.xx) on Mon 5 Sep 2005 at 04:55
Once this is done you should be ready to create your site. The first thing to do is to create the appropriate Apache configuration.

If you are already serving a number of virtual hosts then adding a new one is a simple matter, using the following configuration file:

What if one is not running a number of virtual hosts? I mean, if virtual hosts are not required are they after installing Bamboo?

-- Dan Hunt, St. Brieux Saskatchewan Canada

[ Parent ]

Re: Creating simple websites with Bamboo
Posted by chris (84.48.xx.xx) on Mon 5 Sep 2005 at 09:51
[ View Weblogs ]
No - if you haven't got multiple sites then you only need to configure the default site (under /etc/apache2/sites-available/default).

Changing the paths and logfiles there should be enough.

[ Parent ]

Re: Creating simple websites with Bamboo
Posted by Steve (82.41.xx.xx) on Mon 5 Sep 2005 at 11:01
[ View Weblogs ]

Just to be more specific. If you're not running a VirtualHost setup the only configuration setting you'll need to add is:

Alias /bamboo /usr/share/bamboo 

Once that's been done you can create the b.site file and access the front page with http://example.com/bamboo/frontdoor.php.

(You should still add the access rules to deny random visitors the ability to download the b.* files - so your passwords don't get stolen, but otherwise you don't need any configuration).

Steve
--

[ Parent ]

Re: Creating simple websites with Bamboo
Posted by Anonymous (213.216.xx.xx) on Tue 6 Sep 2005 at 15:36
Shame it's in php.

[ Parent ]

Re: Creating simple websites with Bamboo
Posted by Steve (82.41.xx.xx) on Tue 6 Sep 2005 at 15:40
[ View Weblogs ]

Feel free to recode it, from scratch, in your favourite environment ..

Steve
--

[ Parent ]

Re: Creating simple websites with Bamboo
Posted by peterhoeg (193.163.xx.xx) on Thu 8 Sep 2005 at 08:32
Steve, I believe you left something out. After:

chgrp www-data /home/www/mysite.com/htdocs

You probably want to do:
chmod g+w /home/www/mysite.com/htdocs

Otherwise, that group will not have write access.

[ Parent ]

Re: Creating simple websites with Bamboo
Posted by Steve (82.41.xx.xx) on Thu 8 Sep 2005 at 08:33
[ View Weblogs ]

Indeed, I was working with a umask setup to allow group writing by default.

I'll make an update to ensure this is explicit. Thanks for the notice.

Steve
--

[ Parent ]