Forum

Syntax error in hiawatha.conf on line 46. (UrlToolkit is not read in)

Fred
8 September 2011, 07:37
Hiawatha version: hiawatha-7.4.1.tar.gz
Operating System: Linux fritz.fonwlan.box 2.6.13.1-ohio #1 Wed Jan 27 13:20:43 CET 2010 mips GNU/Linux

When I use the following hiawatha.conf on my fritz box (see http://freetz.org) I get the above error:

# Hiawatha main configuration file
#


# GENERAL SETTINGS
#
ServerId = wwwrun:wwwrun
ConnectionsTotal = 14
ConnectionsPerIP = 10
ExecuteCGI = yes
SystemLogfile = /var/media/ftp/uStor01/hiawatha-7.4.1/logs/system.log
GarbageLogfile = /var/media/ftp/uStor01/hiawatha-7.4.1/logs/garbage.log
ExploitLogfile = /var/media/ftp/uStor01/hiawatha-7.4.1/logs/exploit.log
WorkDirectory = /var/media/ftp/uStor01/hiawatha-7.4.1/work


# BINDING SETTINGS
# A binding is where a client can connect to.
#
Binding {
Port = 85
Interface = 0.0.0.0
MaxKeepAlive = 30
TimeForRequest = 3,20
MaxRequestSize = 8192
MaxUploadSize = 30
}

# COMMON GATEWAY INTERFACE (CGI) SETTINGS
# These settings can be used to run CGI applications. Use the 'php-fcgi'
# tool to start PHP as a FastCGI daemon.
#
CGIhandler = /usr/bin/php-cgi:php
CGIextension = cgi

FastCGIserver {
FastCGIid = PHP5
ConnectTo = 192.168.178.1:2005
Extension = php, php5
SessionTimeout = 30
}

# URL TOOLKIT
# These URL toolkit rules are made for the Banshee PHP framework,
# which can be downloaded from: http://banshee.leisink.org/
UrlToolkit {
ToolkitID = dokuwiki
#Match ^/(bin|conf|data|inc)/ DenyAccess
#Match ^/_media/(.*)\?(.*) Rewrite /lib/exe/fetch.php?media=$1&2
#Match ^/_media/(.*) Rewrite /lib/exe/fetch.php?media=$1
#Match ^/_detail/(.*)\?(.*) Rewrite /lib/exe/detail.php?media=$1&$2
#Match ^/_detail/(.*) Rewrite /lib/exe/detail.php?media=$1
#Match ^/_export/([^/]+)/(.*) Rewrite /doku.php?do=export_$1&id=$2
#Match ^/$ Rewrite /doku.php
#RequestURI exists Return
#Match /(.*)\?(.*) Rewrite /doku.php?id=$1&$2
Match /(.*) Rewrite /doku.php?id=$1
}

# DEFAULT WEBSITE
# It is wise to use your IP address as the hostname of the default website
# and give it a blank webpage. By doing so, automated webscanners won't find
# your possible vulnerable website.
#
Hostname = localhost
WebsiteRoot = /var/media/ftp/uStor01/www
PIDfile = /var/run/hiawatha.pid
StartFile = index.html
AccessLogfile = /var/media/ftp/uStor01/hiawatha-7.4.1/logs/access_default.log
ErrorLogfile = /var/media/ftp/uStor01/hiawatha-7.4.1/logs/error_default.log


# VIRTUAL HOSTS
# Use a VirtualHost section to declare the websites you want to host.
#
VirtualHost {
#
Hostname = 192.168.178.1
WebsiteRoot = /var/media/ftp/uStor01/www/dokuwiki
StartFile = index.php
#SecureURL = false
AccessLogfile = /var/media/ftp/uStor01/hiawatha-7.4.1/logs/access.log
ErrorLogfile = /var/media/ftp/uStor01/hiawatha-7.4.1/logs/error.log
TimeForCGI = 120
UseFastCGI = PHP5
UseToolkit = dokuwiki
#DenyBody = ^.*%3Cscript.*%3C%2Fscript%3E.*$
#ExecuteCGI = yes
#PreventCSRF = yes
#PreventSQLi = yes
#PreventXSS = yes
#TriggerOnCGIstatus = no
}

When I comment string "UseToolkit = dokuwiki" the config works. My local test environment does not complain about using string "UseToolkit = dokuwiki".

Any ideas?

Thanks!
Hugo Leisink
8 September 2011, 07:46
Does Hiawatha on your fritz box has support for the UrlToolkit? You can check for it with the -v command line option.
Fred
9 September 2011, 20:12
Hi Hugo,

you are right!

My test environment:

[root@host fred]# /usr/local/sbin/hiawatha -v
Hiawatha v7.4.1, cache, IPv6, Monitor, SSL, URL toolkit, XSLT
Copyright (C) by Hugo Leisink <hugo@leisink.net>

My fritz box:

root@fritz:/var/mod/root# /usr/bin/hiawatha -v
Hiawatha v7.4.1
Copyright (C) by Hugo Leisink <hugo@leisink.net>

OK, I will invest howto enable URL toolkit.

Thanks!
Fred
9 September 2011, 20:39
Solution:

To use URL toolkits, Hiawatha should not have been compiled with --disable-toolkit.
Hugo Leisink
10 September 2011, 00:44
Correct!
This topic has been closed.