The FreeBSD Diary |
(TM) | Providing practical examples since 1998If you buy from Amazon USA, please support us by using this link. |
Installing and configuring Phorum using cvs
22 July 2002
|
This is the first of two articles about importing a third party product into cvs and using for different projects in different ways. The steps I outline below may not be the best way of doing things, but I'm about to find out. The prerequisites for this article are:
My current project is FreshSource. I also have other projects such as this website and FreshPorts. All of these websites use a web-based message board called Phorum. It is a very flexible and easily configured product. I've been using it for years. I use cvs for publishing my website. For example, this article I'm typing now is first saved to a file. That fie is then added to the cvs repository. When I'm ready to put the article onto the website, I will use cvsup to get the file from the cvs repository onto the web server. The problem I'm trying to solve here is the use of Phorum on three different website, but maintaining only one instance of Phorum in the cvs repository. If a new version of Phorum arrives, I don't want to manually upgrade three websites. I want to upgrade once and only once. Hopefully this strategy will work and it will be flexible and simple. |
Structure of my websites
|
My websites follow the same structure. Each website resides within their own directory under
|
Initial Phorum Installation/Configuration
|
Here are the steps. For mor detail on Phorum configuration please refer to the The following steps will fetch the tarball, extract the files, and move into the directory.
Notice that I put phorum one directory up from the www directory, where my HTML code usually appears. I will now create a link so that the URL will work:
Remember to read
The following is the output produced when running the security script provided by Phorum.
My responses are shown in
It is important to note that I just created a new directory:
I then wanted to compare the original code and the changes performed by the above step.
First, I again extracted the code to a new location, then ran
|
Creating the Phorum database
|
I am using PostgreSQL as my database. Phorum can also use mySQL. My instructions in this section are PostgreSQL-specific. The mySQL link above should show you how to perform the mySQL equivalent.
|
Final Configuration via your browser
|
Now that you have done the initial Phorum configuration and created the database, it is time for the
final configuration, which can be done via your web browser. If you were to browse to your phorum URL
now (e.g.
This should be your clue to instead browse to your administration directory as specified in a previous section.
In my example above, this URL would be:
I selected "PostgreSQL 6.5 or newer" because I am using PostgreSQL 7.2 and clicked on The next screen you will contains the settings which Phorum will use to connect to your database. Use the settings you specified when creating the Phorum database. Note that because my database server and my web server runs on the same computer, I did not specify a value for "Database - Server Name".
You will now be prompted for the administration user details. This is the user who will be permitted to modify the Phorum settings online. Any phorum user can optionally create a user profile for themselves. This profile ensures a certain amount of security in that it implements some simple steps to prevent people from impersonating others. You can use this administration user when you post message to the phorum. You can fill in the details at a later stage.
The next step is the specification of the Phorum URL. The default value was correct for me, but you may wish to alter it should your needs differ from mine. You must supply an email address.
That's it. You're all done. You should now click on the link provided and then login using the administration details you supplied in a previous step.
|
Modifying your Administration User profile
|
Creating a new phorum is achieved via your browser. The URL will vary, but it should be something of the form http://www.example.org/phorum/MySecretDirectory/. Under Forum Maintenance, click on UserAdmin. Click on edit on the line containing your name. |
Creating a new Phorum
|
Creating a new phorum is achieved via your browser. The URL will vary, but it should be something of the form http://www.example.org/phorum/MySecretDirectory/. Under Forum Maintenance, click on New Forum. For a simple phorum, the only fields I filled in were Name, Description and Table Name. If you then click on Forum Index, you will be able to create the first post.... But you may wish to create a user profile. I do this to ensure that nobody else can impersonate me within the phorum. NOTE that you cannot use the same email address for your login as that which was specified for the |
Phorum is now running
|
Phorum should now be up and running. Go for it. |
Importing Phorum into cvs
|
In a previous article, I wrote very briefly about customizing the pages. In this article, I hope to provide sufficient detail of my customization process so that you can customize your own. You may not wish to import the phorum code into cvs. I am doing that only because I use Phorum on multiple websites with each website having custom configuration.
You will create your own cvs repository if you don't already have one. My repository
already exists. In this case, my CVSROOT was set to The key point to remember is we have Phorum spread across two directories (phorum and MySecretDirectory). Both of these will need to be imported into cvs. Before you do this, remember to set CVSROOT accordingly. See the cvs article mentioned in the previous paragraph for details. Here is how I did the import:
WARNING: I am writing the above long after I actually did it and my notes are incomplete. The above may not be correct. Then I moved away the original code and grabbed the copies from CVS:
The
I now have copies of the original code in the same directories |
Local customization
|
Each of my websites will have have their own customization. I will handle these customizations by creating one branch for each website. Here is how I created the branch:
To be sure I have the correct revision and branches sitting around, I then removed the above directories, and did another checkout:
Now I'm ready to start changing things which are relative to a particular branch. These localizations are found in two places:
After testing the changes, I checked them in. |
Publishing the changes
|
This section assumes you are already running a cvsup server. I handled this new collection by creating two new entries in the sup directory on the cvsup server:
On my web server, I had the following supfile:
To publish, I just issue this command:
|
What about other websites?
|
I have not tried any other website yet. Only FreshSource. My guess is that I will need to create a different branch for each website. |