• WebGUI Installation and Configuration under Ubuntu 13.10

    This is mainly a note for myself, but there’s no reason why it won’t be useful for someone else too. Recently, I have been trying to set up a server under VirtualBox to start writing / maintaining some WebGUI code. WebGUI as a platform seems to be fairly under-used. Certainly, searches for information as a newbie to the environment have been frustratingly unyielding. Because I can foresee the possible need to get things set up in the same way again, I thought I would make a note of the initial steps.

    Install the server

    I selected to install Ubuntu 13.10 server as I was aware that WebGUI came as a package in the repositories, meaning that an installation from source would not be necessary. Incidentally, I did attempt an installation from source, and none of the Perl dependencies ever seemed to be met. In the end I gave up and went with the repository version. I also tried to make use of the WebGUI Runtime Environment (WRE) as I had understood this to be a good idea. It turned out not to be, and once again caused problems with MySQL (when the mysql-server package was installed).

    Once the server installation is complete, I updated the OS (apt-get update and apt-get upgrade) and then, I installed the following packages:

    sudo apt-get install apache2
    sudo apt-get install mysql-server
    sudo apt-get install ssh

    Why install a server under VirtualBox?

    As an aside, I thought I would answer this question. Naturally, installing a server in this way is not necessary, but the trouble is that the WebGUI installation brings so much with it, that it seems safer not to clutter a machine that will be used for other development purposes.

    Install the WebGUI package

    Run the command:

    sudo apt-get install webgui

    to install the WebGUI package from the Ubuntu repositories. Following this install, it is necessary to remove a package which conflicts and causes an Apache segfault:

    sudo apt-get remove libdata-alias-perl

    Link the configuration file

    The WebGUI configuration file needs to be linked into the Apache install:

    sudo ln -s /etc/webgui/apache.conf /etc/apache2/conf-enabled/webgui.conf

    Change a couple of modules

    With the default setup, the first time you try and access the site, CPU will peak and memory will max out. This (according to a post on webgui.org) is to do with the mpm_event module. Run the following two commands to prevent this from happening, and then restart Apache:

    sudo a2dismod mpm_event
    sudo a2enmod mpm_prefork
    sudi service apache2 restart

    Database configuration

    In the WebGUI configuration file, there will be some details regarding the setup of the database. This includes the default user, password and table. If in a development environment, there is no need to change these values unless you particularly want to. I decided not to change them and to configure MySQL with the details in the configuration file (which can be found in /etc/webgui/webgui.conf).

    CREATE USER 'webgui'@'localhost' IDENTIFIED BY 'webgui';
    GRANT ALL PRIVILEGES ON *.* TO 'webgui'@'localhost' WITH GRANT OPTION;
    CREATE DATABASE 'webguidb';

    This will create the user, set the password and create the database that will be used by the webserver.

    Screenshot from 2014-05-22 21:44:43Visit the server

    At this point, if I navigate to my servers location (http://<my.server.ip.address>/webgui) every request freezes and eventually I get a “No data received” error in the browser. The reason for the freeze is that there are no tables in the database. This, however, is not something that can just be created. It turns out that there is an SQL file that can be used to create a base database. The file lives in /usr/share/doc/webgui/docs and I imported it into the database I created (above) using the standard MySQL syntax:

    mysql -u webgui -pwebgui webguidb < create.sql

    (If the create.sql has been zipped up, you can gunzip it before running the above command).

    Once I had done that, the WebGUI webpage loaded.

    What is Spectre?

    The install.txt (in /usr/share/doc/webgui/docs) says to Start Spectre:

    cd /data/WebGUI/sbin
    perl spectre.pl --daemon

    As this was an install from the repositories, though, the /data/ folder is not present. Nor is there a spectre.pl in the corresponding sbin folder (/usr/share/webgui/sbin) so I’m a little stumped.

Leave a Reply

Your email address will not be published. Required fields are marked *

Are you human: *