The Bonsai install file is a lot better than the one that comes with LXR, but still not as complete as I'd like. Read it, and the README, and then we'll get started.
Just like getting LXR, except that you want to check out mozilla/webtools/bonsai instead. You'll also want to get mozilla/webtools/registry, since Bonsai requires it.
Installing bonsai is pretty straight forward.
Procedure 2.
Run the configure script, and look carefully at the ouput to see if you're missing any perl modules. Oh, you may want to pass a --prefix option to configure. Since I was installing things to /var/www/html/, I passed that as the prefix.
Run make install to place the bonsai files in /var/www/html/bonsai, or wherever you've configured as your prefix.
Make the bonsai/data/ writable by the user which will be executing the cgi scripts.
Edit bonsai/data/treeconfig.pl as described in the README. I've found that setting the module to / works for me. I didn't want to create an “All” module, since there are several hundred modules in GNOME CVS.
Bonsai needs access to the raw CVS files (all those strange files named ,v in your CVSROOT) in order to work properly. There are two readily apparent solutions to this.
| First, run bonsai on the same machine that hosts your CVS repository. This may be undesireable if your CVS server is heavily loaded, or if you have issues with allowing http access to the cvs machine. |
| Second, you can NFS mount the CVSROOT from the CVS machine to the web server. I don't know how well this works, as I haven't needed to do this. |
Bonsai can't generate it's database unless it has both read and write access to $CVSROOT/CVSROOT/history. This might pose complications if you're trying to read the CVSROOT via NFS.
Next, you need to create a password, so that anybody who stumbles across your website can't reconfigure bonsai. Go to bonsai/data and run trapdoor PASSWD > passwd.
Now you need to fill in bonsai/data/legaldirs. I found that putting in a blank line, followed by /* worked for me. I'll describe how to tell if it's working in just a moment.
You'll need to configure your webserver to execute the Bonsai CGI scripts. Add a section like
<Directory /var/www/html/bonsai> Options ExecCGI </Directory>And then tell apache to reload it's config file.
At this point, you should be able to get to the bonsai webpages, although a great many of them won't work yet. Bonsai stores lots of information in a database, which we haven't created yet, let alone populated with data.
Procedure 3. Creating and populating the bonsai database
Point your web browser to http://somehost/bonsai/editparams.cgi. Go through and set these up for your local installation. Make sure you know what you've filled in for mysqluser and mysqlpassword.
Setting up the MySQL permissions.
Next, go the a command prompt on your server, as a user who has rights to change things for MySQL (probably root).
Run mysql_setpermission. You'll want to select
2. Add a database + user privilege for that database. - user can do all except all admin functions
You should be prompted with
Which database would you like to add:Type “bonsai” as the database to add.
The next prompt should be
What username is to be created:Type in the username that you used for the mysqluser on the editparms.cgi webpage.
Now you should see
Username = bonsai Would you like to set a password for [y/n]:Answer “y”, and fill in the password at the prompts.
Your password will not echo to the screen!
Now MySQL needs to know where this user should be able to connect from. I think that the “safe” answer is to fill in only “localhost” here. I'm not a MySQL security expert, check this out with whomever you can find.
One of the #webtools guys confirmed that this sounds like a fairly “secure” thing to do.
MySQL should present you with a summary of the selections that you've made, something like this:
Okay we keep it with this ... The following host(s) will be used: localhost. ###################################################################### That was it ... here is an overview of what you gave to me: The database name : junker The username : bubba The host(s) : localhost ###################################################################### Are you pretty sure you would like to implement this [yes/no]:Assuming that you haven't made any typos or other mistakes, tell it “yes”. Now the database should be in created, and you ready to get filled up with data!
Now point your web browser to http://somehost/bonsai/admin.cgi, and scroll down to the bottom. Just above the section where you can change the password, there's a button that says “Rebuild cvs history”. Fill in your password in the “password” field above this, and then click the button. This should take you to another page, showing something like this.
Rebuilding entire checkin history in GNOME CVS, (`default' tree) ... Doing directories: ... : is invalid, skipping... /cvs/gnome//gnomeicu/Attic/gnomeicu-0.93,v /cvs/gnome//gnomeicu/Attic/gnomeicu-0.61.tar.gz,v /cvs/gnome//gnomeicu/Attic/gnomeicu-todo-nethunter.txt,v /cvs/gnome//gnomeicu/Attic/TODO-jwise,v /cvs/gnome//gnomeicu/Attic/TODO-nethunter,v /cvs/gnome//gnomeicu/Attic/gnomeConf.sh,v /cvs/gnome//gnomeicu/Attic/gnomeicurc,v /cvs/gnome//gnomeicu/src/.xvpics/Attic/gnome-gnomeicu.xpm,v /cvs/gnome//gnomeicu/src/.xvpics/Attic/foo.gif,v /cvs/gnome//gnomeicu/src/.xvpics/Attic/foo.xpm,vYours won't look quite like this, and it should take a REALLY long time to finish loading the page. When it's done, it should have listed every file in your CVSROOT. All of that good information should be in the bonsai database now. Test it out, and see how things work!