Installation

This is an account of my attempt to install Webgui on Debian
Date started 4/11/02
The Webgui installation manual recommends using apache with mod-perl, perl with a number of required modules and mysql. I already have mysql and apache running. Perl is installed a long with a perl-modules package which contains a number of perl modules although I am not sure exactly how they correspond to the one required by Webgui. Webgui provides a couple of scripts to check whether you have all the perl modules and your system is set up correctly so I will install and setup webgui first and then run the script to see if I have all the perl modules that I need.
Debian offers a version of apache that has the mod_perl statically linked so I will install that as it doesn't appear to conflict with my current apache packages.
# apt-get install apache-perl
The following extra packages will be installed:

  • libapache-mod-perl
  • libdevel-symdump-perl
  • libhtml-parser-perl
  • libhtml-tagset-perl
  • libhtml-tree-perl
  • liburi-perl
  • libwww-perl

The following NEW packages will be installed:

  • apache-perl
  • libapache-mod-perl
  • libdevel-symdump-perl
  • libhtml-parser-perl
  • libhtml-tagset-perl
  • libhtml-tree-perl
  • liburi-perl
  • libwww-perl

0 packages upgraded, 8 newly installed, 0 to remove and 27 not upgraded.
Need to get 1372kB of archives. After unpacking 4223kB will be used.
Do you want to continue? [Y/n]
The installation of some of the packages failed as a few of the packages had been upgraded since I last did an apt-get update. After doing an apt-get update apt-get install apache-perl resulted in a number of packages being updgraded and a total download of 11.8 MB. This is one of the problems of running unstable in that it increase downloads.

First thing is to just test and see if apache is still working ok and I will do that by checking out the two CMSs that I already have running.
Apache didn't work the first time but after using
# /etc/init.d/apache stop
# /etc/init.d/apache start
it was working fine. One change is that
# /etc/init.d/apache restart
seems to now just reload the modules rather that restarting the whole server. Either method works but you might have to restart a few times.

Ok now next step is to add an Alias to /etc/apache/httpd.conf that points apache to where i am going to have the webgui directory. I chose to put it where I have all the other CMSs that I am running stored /home/john/Content-Management-Systems/webgui.

You have to restart apache after creating aliases as well.

You can also unpack the webgui.tar.gz file straight into /var/www/ because when it extracts, it puts everything in the WebGUI folder anyway..

$sudo tar -zxvf webgui-4.6.9.tar.gz
(We are using sudo instead of logging in as root - see sudo)

Following the linux install instructions that are available at the webgui website (there is also an install.txt file available in the docs directory in the WebGUI folder that you get when when you unpack the webgui.tar.gz file) you have to first create a database in mysql for webgui.

I used phpmyadmin to create the databse and give cmsuser all the recommended privelleges. The install documents gives instructions on how to do it using msql commands.
Type localhost/phpmyadmin into the address bar in mozilla
log in as cmsuser
create a database called WebGUI
Not quite sure what I do in regard to granting and flushing privelleges in phpmyadmin. I am assuming that as I used cmsuser to create the WebGUI database I have all the privelleges to access the database.
Will just try loading the database with the create scripts as per the instructions in the install.txt
$ cd /home/john/Content-Management-Systems/webgui/WebGUI
$ mysql -u cmsuser -p WebGUI < docs/create.sql

I entered the password for cmsuser and then had a look at the mysql logs to see that it worked.
# tail -f /var/log/msql.log
which it did, and then I used phpmyadmin to have a quick look at the tables that were created in the WebGUI database. A total of 54 tables were added to the webgui database.

Ok now to edit the WebGUI.conf file and customise it for my information ie replacing the default webgui user (webgui) with cmsuser.
$vi etc/WebGUI
It is a very small conf file compared to the php based CMSs. This is the file

dsn = DBI:mysql:WebGUI
dbuser = webgui
dbpass = password
logfile = /data/webgui.log
extras = /extras
uploadsURL = /uploads
uploadsPath = /data/WebGUI/www/uploads
#excludeMacro =
#excludeWobject =
#excludeHourly =
#scripturl = /

I changed the script to

dsn = DBI:mysql:WebGUI
dbuser = cmsuser
dbpass = p3mbmp
logfile = /var/log/webgui.log
extras = /WebGUI/www/extras
uploadsURL = /WebGUI/uploads
uploadsPath = /home/john/Content-Management-Systems/webgui/WebGUI/uploads
#excludeMacro =
#excludeWobject =
#excludeHourly =
#scripturl = /

and created the uploads directory in the WebGUI folder. Make sure the 'extras' path is the URL path not the physical path

Installing Perl Modules

The install.txt file recommends adding a cron script next but before I worry about setting up cron scripts I will first run the scripts to test to see if I have got webgui working with mysql and perl.
Ok the WebGUI/sbin/testEnvironment.pl script tells me that 6 of the required perl modules aren't installed so I will have to install them.
I thought I would try and install them using apt-get first to see if that was possible.
Typing
$ apt-cache search perl | grep modules
shows a number of perl module packages. I tried installing the modules associated with time and then ran the testEnvironment script again.
Didn't get any of the modules that I needed so I will just install the modules according to the instructions in the install.txt. It seems that the perl modules packages are groups of perl modules so you would have to go through the module packages using apt-cache show to see what they contain which would probably be slower than the install.txt way.
So to install the perl modules I use the automatic method as described in the install.txt. See http://plainblack.com/installation

Firstly, just to save trouble, run these two commands
$apt-get install ncftp
$apt-get install unzip

Then it will detect the paths and you can just hit enter to all the questions that come after you execute the following command:

$ perl -MCPAN -e shell

This will setup a .cpan directory in /home/john/ and ask a few configuration questions. I had gzip and tar but had to use apt-get to download unzip, which was 136 kb and then manually enter the path. Also had to install ncftp which was 449 kb and then enter the path. If you need to find where a program in installed, it will tell you if you type:

$whereis unzip

After answering a few more questions which basically involved just accepting the defaults and making a couple of mirror and country choices you end up at a cpan> prompt.
Now install the modules that you don't already have.

Ran into a bit of a problem in that make failed due to the fact that I didn't have permission for something. Rather than worry about it at the moment I just thought I would install them as root so had to su to root and then run through the same setup process that I had already been through.
Then I installed the required modules.
cpan> install Tie::IxHash
cpan> install Tie::CPHash
cpan> install Net::LDAP
For this module I was told that I was lacking some dependencies and asked if I wanted to install them. I said yes.
cpan> install Date::Calc
Needed to say yes to get some dependencies for this modules as well.
cpan> install Image::Magick
This failed when it was trying to write the makefile for the module saying that I had some missing libs and then there was an error in make. Doing apt-cache search magick I found a perlmagick package so I thought I would try installing that and then try and install the Image::Magick module again.

debian:/home/john/Content-Management-Systems/webgui/WebGUI/sbin# apt-get install imagemagick perlmagick
Reading Package Lists... Done
Building Dependency Tree... Done
The following extra packages will be installed:
libmagick5.5.1 libpng12-0
The following packages will be REMOVED:
libmagick5
The following NEW packages will be installed:
libmagick5.5.1 libpng12-0 perlmagick
1 packages upgraded, 3 newly installed, 1 to remove and 106 not upgraded.
Need to get 2501kB of archives. After unpacking 770kB will be used.
Do you want to continue? [Y/n

I had a problem with the packages as I already had installed imagemagick when I installed ezpublish-src and there was a problem with the newer version of the package when it was trying to overwrite a file from the old package. I ran apt-get remove imagemagick and tried installing the imagemagick and perlmagick from apt again and it worked fine.
Trying to install the perl Image::Magick module again (James - this worked for us) I was told that Image::Magick is up to date. I might have problems with this later but as the testEnvironment.pl ran through ok so I will just continue and see if Webgui is working.

Getting WebGUI working

Ok I have had real problems just trying to figure out how to get webgui working mainly because of the issues in getting .pl or CGI scripts to work. In the /etc/apache/httpd.conf file there was no line to load the mod_perl module although this module was present (see dpkg -L apache). I had installed the apache-perl package which seemed to affect apache and I am not really sure just how apache and apache-perl are supposed to work together. The main problem was that it took me ages to realise that I should have uncommented the line
AddHandler cgi-script .cgi .sh .pl
in /etc/apache/httpd.conf. I am not sure if I needed to add the loadmodule line in the httpd.conf srcript and in fact I will try uncommenting it and see if it will still try and run the .pl (CGI) scripts.
Once I had uncommented the above AddHandler line it stopped asking me if I wanted to save the file but then it told me that I don't have permission to run the script on this server.
This turned out to be because I had not given apache permission to execute cgi/pl scripts in the WebGUI directory. To fix this I had to add ExecCGI to the Options line in my webgui alias section in /etc/apache/httpd.conf file. The section now looks like this
Alias /webgui/ /home/john/Content-Management-Systems/webgui/WebGUI/
<Directory /home/john/Content-Management-Systems/webgui/WebGUI/>
Options Indexes MultiViews ExecCGI
AllowOverride None
Order allow,deny
Allow from all
</Directory>
Going to localhost/webgui/www/index.pl in my browser now takes me to the webgui CMS where I appear as a visitor. I can then log in as Admin using the password that is supplied on the page.

Make sure your browser isn't caching old pages.

Couple of issues that I hadn't worried about during the install but which have made themselves apparent now.
As the I had issues installing the perl Image::magick module I can't view the thumbnails on the site which makes it a bit ugly. Will have to try removing the module and using cpan to install it again now that I have used apt to get the imagemagick libs.
The second issue is that it is a bit slow to load the webgui site which is probable why they recommend using apache with mod_perl. It might be that my adding of the load mod_perl line in httpd.conf is not working. I will try uncommenting it and rerunning apache and see if webgui still works. Alternatively I can set up the apache-perl server to work properly and see if having mod_perl statically linked increase the speed with which it executes cgi scripts.
I found that after uncommenting the
LoadModule perl_module /usr/lib/apache/1.3/mod_perl.so
line that I had added to /etc/apache/httpd.conf webgui still worked fine and there was no difference in the speed. I am not sure if this means that mod_perl is not being loaded or is loaded some other way. The command
# apache -l
lists the modules that are statically linked but I have not found a command yet that lists which modules are dynamically loaded. I will leave the line uncommented and set up the apache-perl/httpd.conf file, which is basically the same but has apache replaced with apache-perl in a few lines. See the apache-perl examples directory in /usr/share/doc/apache-perl/ for an example httpd.conf file.
After stopping the apache server
# /etc/init.d/apache stop
and starting up apache-perl
# /etc/init.d/apache-perl start
I then openned webgui in my browser. Everthing seemed to work fine and it might be a bit faster although it is really aparent at least for the stuff that I have done in it so far. The php based CMSs definitely seem to load faster.
The only issue I still have to sort out is getting a working Image::Magick module in perl so I can load all the icons that webgui has and make the pages look more attractive. Mozilla looks quite good because it doesn't show any sign of the icons so you don't notice anything, konqueror on the otherhand display some alternative icon that detracts from the page.

**** One further thing to do is to set up the cron job to do the maintenance see the install instructions.

We then realised that it would be better if our path was simply /WebGUI so we changed the directory in /etc/apache/httpd.conf to this:

Alias /WebGUI /var/www/WebGUI/www/
<Directory /var/www/WebGUI/www/>
Options Indexes MultiViews ExecCGI
AllowOverride None
Order allow,deny
Allow from all
</Directory>