Chapter 19. Webconf Configuration

Revision History
Revision 1.12006-01-28kp
???

Table of Contents

Objectives
Step 1: Install the packages
Step 2: Configure mini-httpd
Step 3: Reconfigure Shorewall (Optional)
Step 4: Remove sh-httpd (Optional)
Step 5: Test It
Step 6: Remove Weblet, make Webconf standard (Optional)
Step 7: Install additional plugins (Optional)

Objectives

Webconf is a web configuration framework that provides a way to configure a Bering-uClibc LEAF router with a web interface. Webconf is a superset of the features in weblet. This chapter explains how to configure webconf.

Step 1: Install the packages

Webconf is a library of cgi scripts; but it needs a web server that supports the POST method to work. sh-httpd does not support the POST method, so it cannot be used. Two web servers that can be used are mhttpd.lrp (mini_httpd) or mhttpds.lrp (mini_httpd with ssl support). These instructions assume you know how to install .LRP packages and have already installed mhttpd or mhttpds.

You must also install webconf.lrp (either by copying it to your boot media, editing LEAF.CFG and rebooting, or by using lrpkg -i <path to webconf.lrp> .

The basic webconf.lrp package is available at http://cvs.sourceforge.net/viewcvs.py/leaf/devel/nangel/webconf/lrp/webconf.lrp. Additional plugins are available in the same directory (http://cvs.sourceforge.net/viewcvs.py/leaf/devel/nangel/webconf/lrp/).

Step 2: Configure mini-httpd

Reconfigure mini_httpd; it should process any file named .cgi as a cgi. If you wish to run weblet in addition to webconf, change the default port of mini_httpd. Here's an example of the /etc/mini_httpd.conf set up to work on port 8080:

        port=8080
        cgipat=**.cgi
        user=sh-httpd
        logfile=/var/log/mini_httpd.log
        pidfile=/var/run/mini_httpd.pid
        max_age=0    

If you do not intend to run weblet, please set port to be 80.

Change mini_httpd to serve docs from /var/webconf/www. The WWWDIR variable defined in /etc/init.d/mini_httpd determines the document root. Change this from /var/sh-www to /var/webconf/www.

Start mini_httpd: /etc/init.d/mini_httpd start

Step 3: Reconfigure Shorewall (Optional)

If you are running mini-httpd on port 80, you can skip this step. If you are running mini-httpd on port 8080, you must open up the Shorewall rules to allow access to the web server. In the /etc/shorewall/rules, file, add 8080 to the line that looks like this:

ACCEPT loc fw tcp 80,8080

Restart shorewall : /etc/init.d/shorewall restart

Step 4: Remove sh-httpd (Optional)

If you are running mini-httpd on port 80, you must reconfigure inetd so that port 80 traffic does not go to sh-httpd. You can do this by commenting out the following line in /etc/inetd.conf

#www  stream   tcp  nowait  sh-httpd .......

Restart inetd: kill -HUP $( pidof inetd )

Step 5: Test It

You should now be able to take a look at webconf by pointing your web browser at your LEAF router. The interface is lightly protected by basic authentication. When prompted for a username and password, enter admin for the user, and leave the password blank.

You can change this password by selecting the Webconf Password menu option.

Step 6: Remove Weblet, make Webconf standard (Optional)

To make webconf your new standard web interface, edit the LEAF.CFG file on your boot disk, and replace sh-httpd,weblet with mhttpd,webconf.

Make sure you copy the mhttpd and webconf .lrps to your boot media. You may need to delete sh-httpd.lrp and weblet.lrp if you don't have enough space on your boot device.

Step 7: Install additional plugins (Optional)

The /etc/webconf/webconf.conf is the configuration file for webconf. As additional plugins become available, you can copy them to your boot media and then add them to the LWP= variable in the configuration file. Webconf plugins generally have the extension of ".lwp" and share the same name as the package (e.g. the webconf plugin for dropbear.lrp is dropbear.lwp)

The webconf.lwp contains only basic monitoring functions. To perform advanced configuration using the web interface, you must copy the expert menuset webconf.lwp to your boot media. The expert functions become available after a reboot or after issuing /etc/init.d/webconf restart from the console.