HOWTO configure Hiawatha web server on my fritz box 7170?

jeffy

Neuer User
Mitglied seit
23 Apr 2011
Beiträge
17
Punkte für Reaktionen
0
Punkte
0
Moin und Hello!

I am refering to thread http://www.ip-phone-forum.de/showthread.php?t=233963 where Hiawatha was recommended as a good solution to run static and dynamic web pages:

Maybe it is easier for you to start with lighttpd, because it is in the current trunk version (just select it from make menuconfig; don't forget to select PHP too).

For hiawatha you can do this:
  • Download hiawatha_7_4_1_subop_250411.patch (from ticket)
  • Download hiawatha-webif-only-3.patch
  • In your Freetz folder: patch -p0 <hiawatha_7_4_1_subop_250411.patch
  • In your Freetz folder: patch -p0 <hiawatha-webif-only-3.patch
  • Edit make/Config.in to add hiawatha (you will see how)
  • Edit make/external.in to add hiawatha
  • make menuconfig to select hiawatha
Know that there is not much experience with hiawatha on Freetz yet, but I will try to help you were I can.

You can create a SWAP file here. Start with a SWAP file that has the size of your memory: 32MB.

Now I would like to adjust the config files of hiawatha on my fritz box:

Code:
root@fritz:/var/mod/etc# ls -ahl      
...
lrwxrwxrwx    1 root     root          25 Jan  1  2000 default.avm-firewall -> /etc/default.avm-firewall
lrwxrwxrwx    1 root     root          17 Jan  1  2000 default.ftpd -> /etc/default.ftpd
lrwxrwxrwx    1 root     root          21 Jan  1  2000 [COLOR="blue"]default.hiawatha -> /etc/default.hiawatha[/COLOR]
...
root@fritz:/var/mod/etc# ls -ahl default.hiawatha/
-rw-r--r--    1 root     root         226 Apr 30 00:43 hiawatha.cfg
-rw-r--r--    1 root     root         977 Apr 30 00:43 hiawatha_conf
-rw-r--r--    1 root     root         232 Apr 30 01:03 hiawatha_extra.def

1. How can I edit hiawatha config files like?:

Code:
root@fritz:/var/mod/etc# vi /etc/default.hiawatha/hiawatha.cfg ^C
root@fritz:/var/mod/etc# cp -p /etc/default.hiawatha/hiawatha_conf /etc/default.hiawatha/hiawatha.conf^C
root@fritz:/var/mod/etc# vi /etc/default.hiawatha/hiawatha.conf^C

I know that /var is writeable and can be flashed via "modsave" command.

My given binary files:

Code:
root@fritz:/var/mod# ls -ahl /var/media/ftp/uStor01/external/usr/bin/
drwxr-xr-x    2 root     root        4.0K Apr 30 01:23 .
drwxr-xr-x    4 root     root        4.0K Apr 30 01:23 ..
-rwxr-xr-x    1 root     root      101.4K Apr 30 01:01 hiawatha
-rwxr-xr-x    1 root     root      398.1K Apr 29 22:12 mc.bin
-rwxr-xr-x    1 root     root        8.0M Apr 29 23:45 php-cgi
-rwxr-xr-x    1 root     root       24.7K Apr 30 01:01 php-fcgi
-rwxr-xr-x    1 root     root       24.3K Apr 30 01:01 wigwam

Thank you!
 
Zuletzt bearbeitet:
>1. How can I edit hiawatha config files like?:

Maybe I am a bit stupid. I think I have to adjust my settings before I create the images in:

Code:
[jeffy@monteverdi default.hiawatha]$ pwd
/home/jeffy/programs/freetz/freetz-trunk/make/hiawatha/files/root/etc/default.hiawatha
[jeffy@monteverdi default.hiawatha]$ ll
total 12
-rw-r--r--. 1 jeffy users 226 2011-04-30 00:43 hiawatha.cfg
-rw-r--r--. 1 jeffy users 977 2011-04-30 00:43 hiawatha_conf
-rw-r--r--. 1 jeffy users 232 2011-04-30 00:43 hiawatha_extra.def

I will try!
 
I don't know the hiawatha package but Freetz has a generic feature. If you "cp /etc/default.hiawatha/hiawath_conf /tmp/flash/hiawatha/" it should be taken instead. You can edit the copied file and use "modsave flash" to make your changes persistent. Though I don't know if hiawatha uses modlib_config...

Regards
Oliver
 
It is very simple: just use the hiawatha sub-menu 'Extra', there you can enter additional lines to go into the config file.

Edit: what do you want more than the available settings?
 
Zuletzt bearbeitet:
@jeffy: Willst Du hiawatha, ohne das von M66B erstellte WEB-IF, auf deiner Box installieren?
 
Thanks for the answers!!!!

First I would like to have a running web server. So, it doesn't matter how I get there.

@M
Shall I use the

Code:
/etc/init.d/rc.hiawatha

script which includes the "Extra" link? But this file is not executable?:

Code:
root@fritz:/# ls -ahl /etc/init.d/
-rw-r--r--    1 root     root        2.8K Apr 29 20:23 modlibinetd
-rw-r--r--    1 root     root        9.0K Apr 29 20:23 modlibrc
-rwxrwxrwx    1 root     root       55.0K Apr 30 11:37 rc.S
-rwxr-xr-x    1 root     root        1.0K Apr 29 20:22 rc.authorized-keys
-rwxr-xr-x    1 root     root        5.2K Apr 29 20:23 rc.avm-firewall
-rwxrwxrwx    1 root     root       12.2K Apr 30 11:37 rc.conf
-rwxr-xr-x    1 root     root         778 Apr 29 20:23 rc.crond
-rwxrwxrwx    1 root     root        6.0K Feb 23  2010 rc.dsl.sh
-rwxr-xr-x    1 root     root        2.1K Apr 29 20:23 rc.dsld
-rwxr-xr-x    1 root     root        3.1K Apr 29 20:23 rc.external
-rwxr-xr-x    1 root     root        1.5K Apr 29 20:23 rc.ftpd
[COLOR="blue"]-rw-r--r--    1 root     root        1.6K Apr 30 11:39 rc.hiawatha[/COLOR]
-rwxr-xr-x    1 root     root        1.0K Apr 30 11:39 rc.inetd
-rwxr-xr-x    1 root     root        1.1K Feb 23  2010 rc.media
-rwxr-xr-x    1 root     root        3.1K Apr 30 11:39 rc.mod
-rwxr-xr-x    1 root     root        3.1K Apr 29 20:23 rc.multid
-rwxrwxrwx    1 root     root        9.4K Apr 30 11:35 rc.net
-rwxr-xr-x    1 root     root         815 Apr 29 20:23 rc.php
-rwxrwxrwx    1 root     root         252 Feb 23  2010 rc.preaudio.sh
-rwxrwxrwx    1 root     root        6.8K Feb 23  2010 rc.ptest.sh
-rwxr-xr-x    1 root     root         391 Apr 29 20:23 rc.smbd
-rwxr-xr-x    1 root     root        1.5K Apr 29 20:23 rc.swap
-rwxr-xr-x    1 root     root        2.5K Apr 30 11:39 rc.syslogd
-rwxr-xr-x    1 root     root         579 Apr 29 20:23 rc.telnetd
-rwxrwxrwx    1 root     root         393 Feb 23  2010 rc.usbhost
-rwxrwxrwx    1 root     root        1.0K Feb 23  2010 rc.voip
-rwxr-xr-x    1 root     root         775 Apr 29 20:23 rc.webcfg
-rwxr-xr-x    1 root     root         543 Apr 29 20:23 rc.websrv
root@fritz:/# less /etc/init.d/rc.hiawatha

In the Freetz GUI there is no link "hiawatha". I could upload a picture if required.

@S
For the beginning maybe it is better. So, how do I edit the config files. Could someone please tell me via example how I should make the config files editable and move them back into the flash?

Here are all the files of hiawatha which are available:

Code:
root@fritz:/# ls -ahl /etc/default.hiawatha/*            
-rw-r--r--    1 root     root         226 Apr 30 00:43 /etc/default.hiawatha/hiawatha.cfg
-rw-r--r--    1 root     root         977 Apr 30 00:43 /etc/default.hiawatha/hiawatha_conf
-rw-r--r--    1 root     root         232 Apr 30 11:39 /etc/default.hiawatha/hiawatha_extra.def
root@fritz:/# ls -ahl /etc/init.d/rc.hiawatha
-rw-r--r--    1 root     root        1.6K Apr 30 11:39 /etc/init.d/rc.hiawatha

root@fritz:/# ls -ahl /var/media/ftp/uStor01/external/usr/bin/*
-rwxr-xr-x    1 root     root      101.4K Apr 30 01:01 /var/media/ftp/uStor01/external/usr/bin/hiawatha
-rwxr-xr-x    1 root     root        8.0M Apr 29 23:45 /var/media/ftp/uStor01/external/usr/bin/php-cgi
-rwxr-xr-x    1 root     root       24.7K Apr 30 01:01 /var/media/ftp/uStor01/external/usr/bin/php-fcgi
-rwxr-xr-x    1 root     root       24.3K Apr 30 01:01 /var/media/ftp/uStor01/external/usr/bin/wigwam

root@fritz:/# ls -ahl /usr/lib/cgi-bin/hiawatha/hiawatha-log.cgi 
-rw-r--r--    1 root     root        1.3K Apr 30 11:39 /usr/lib/cgi-bin/hiawatha/hiawatha-log.cgi
root@fritz:/# ls -ahl /usr/lib/cgi-bin/hiawatha.cgi
-rw-r--r--    1 root     root        1.2K Apr 30 11:39 /usr/lib/cgi-bin/hiawatha.cgi

Thank you!
 
Zuletzt bearbeitet:
... But this file is not executable?:
chmod 755 nach dem Patchen und vor dem Kompilieren.

.
So, how do I edit the config files. Could so. tell me via example how I should make the config files editable and move them into the flash please ?
Externalisieren. Soviel Zeit sollte schon vorhanden sein.;)
Code:
/var/media/ftp/uStor01/hiawatha/hiawatha.conf
Code:
WebsiteRoot = /var/media/ftp/uStor01/www
Hostname = xxxxx
#
MimetypeConfig = /var/media/ftp/uStor01/hiawatha/mimetype.conf
PIDfile = /var/run/hiawatha.pid
#
SystemLogfile = /var/media/ftp/uStor01/hiawatha/log/system.log
GarbageLogfile = /var/media/ftp/uStor01/hiawatha/log/garbage.log
ExploitLogfile = /var/media/ftp/uStor01/hiawatha/log/exploit.log
AccessLogfile = /var/media/ftp/uStor01/hiawatha/log/access.log
ErrorLogfile = /var/media/ftp/uStor01/hiawatha/log/error.log
 
I see your problem. The patches do not set the execute bit.
You have to make rc.hiawatha, the .cgi files and hiawatha_conf executable manually.
You should also remove all the symlinks you have created.
 
@sf3978
>chmod 755 nach dem Patchen und vor dem Kompilieren.
I had this in mind:) OK, I will do a

Code:
chmod -R 755 make/hiawatha/files/root/

before creating the *.image and *.external files!

>Externalisieren. Soviel Zeit sollte schon vorhanden sein
OK I will export the config files to my USB stick. I could then start Hiawatha like?:

Code:
/var/media/ftp/uStor01/external/usr/bin/hiawatha -c /var/media/ftp/uStor01/hiawatha/hiawatha.conf

@M66B
>You have to make rc.hiawatha, the .cgi files and hiawatha_conf executable manually.
OK. Is hiawatha_conf file just an example and could be exported as sf3978 said to sth. like

Code:
/var/media/ftp/uStor01/hiawatha/hiawatha.conf

? But maybe

Code:
/etc/init.d/rc.hiawatha

uses this "hiawatha_conf" tmp file to create a new "hiawatha.conf" file... I will investigate...

>You should also remove all the symlinks you have created.
I have no symlinks created by myself. Which symlinks? Before or after creating the *.image and *.external files?

Thanks!
 
Zuletzt bearbeitet:
Die Dateien die nicht "wachsen", z. B.: rc.* und *.conf, kannst Du auch auf der Box lassen, wenn genug Platz vorhanden. Aber die *.log-Dateien (die größer werden), solltest Du zumindest externalisieren.
 
Just make the indicated files executable, build, flash and hiawatha should be in the menu.
You can configure the port, web root, log-file, etc from the web-interface.
The only thing you have to choose beforehand is if you want hiawatha/PHP externalized or not.
 
Thanks again for your help!

So, the web server is running on 192.168.178.1, port 85! If I use the Internet Port scan tool of dyndns I get the error:

Code:
An attempted connection to [COLOR="darkorchid"]123.123.123.123[/COLOR]:80 was refused. This typically indicates that there are no services available on that port, but that it is NOT being blocked by a firewall or your ISP.

Another test which should be OK: 

An attempted connection to [COLOR="darkorchid"]123.123.123.123[/COLOR]:85 was refused. This typically indicates that there are no services available on that port, but that it is NOT being blocked by a firewall or your ISP.

The IP 123.123.123.123 is an example and not my current remote IP. I set the following firewall forwardrule in Freetz GUI:

Code:
...
tcp 0.0.0.0:80 0.0.0.0:85 0 # Hiawatha

See my network parameters after the FB reboot:

Code:
root@fritz:/var/mod/root# netstat -nlr 
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
[COLOR="darkorchid"]123.123.123.123[/COLOR]   0.0.0.0         255.255.255.255 UH        0 0          0 dsl
192.168.180.1   0.0.0.0         255.255.255.255 UH        0 0          0 dsl
192.168.180.2   0.0.0.0         255.255.255.255 UH        0 0          0 dsl
192.168.178.0   0.0.0.0         255.255.255.0   U         0 0          0 lan
169.254.0.0     0.0.0.0         255.255.0.0     U         0 0          0 lan
0.0.0.0         0.0.0.0         0.0.0.0         U         0 0          0 dsl

My local server is listening:

Code:
root@fritz:/var/mod/root# netstat -nlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 0.0.0.0:2049            0.0.0.0:*               LISTEN      514/telefon
tcp        0      0 0.0.0.0:49443           0.0.0.0:*               LISTEN      464/upnpd
tcp        0      0 0.0.0.0:5060            0.0.0.0:*               LISTEN      522/voipd
tcp        0      0 0.0.0.0:49000           0.0.0.0:*               LISTEN      464/upnpd
tcp        0      0 0.0.0.0:139             0.0.0.0:*               LISTEN      848/inetd
tcp        0      0 0.0.0.0:49100           0.0.0.0:*               LISTEN      1759/mediasrv
tcp        0      0 0.0.0.0:8080            0.0.0.0:*               LISTEN      436/ctlmgr.bin
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      436/ctlmgr.bin
tcp        0      0 0.0.0.0:81              0.0.0.0:*               LISTEN      756/httpd-webcfg
tcp        0      0 127.0.0.1:1011          0.0.0.0:*               LISTEN      514/telefon
[COLOR="blue"]tcp        0      0 192.168.178.1:85        0.0.0.0:*               LISTEN      2356/hiawatha[/COLOR]
tcp        0      0 0.0.0.0:21              0.0.0.0:*               LISTEN      848/inetd
tcp        0      0 0.0.0.0:23              0.0.0.0:*               LISTEN      2203/telnetd
tcp        0      0 127.0.0.1:8888          0.0.0.0:*               LISTEN      514/telefon
tcp        0      0 0.0.0.0:8089            0.0.0.0:*               LISTEN      436/ctlmgr.bin
tcp        0      0 0.0.0.0:445             0.0.0.0:*               LISTEN      848/inetd
udp        0      0 0.0.0.0:2048            0.0.0.0:*                           479/multid
udp        0      0 0.0.0.0:2049            0.0.0.0:*                           479/multid
udp        0      0 0.0.0.0:2050            0.0.0.0:*                           436/ctlmgr.bin
udp        0      0 0.0.0.0:2051            0.0.0.0:*                           514/telefon
udp        0      0 0.0.0.0:2052            0.0.0.0:*                           479/multid
udp        0      0 0.0.0.0:7077            0.0.0.0:*                           522/voipd
udp        0      0 0.0.0.0:53              0.0.0.0:*                           479/multid
udp        0      0 0.0.0.0:5060            0.0.0.0:*                           522/voipd
udp        0      0 0.0.0.0:5353            0.0.0.0:*                           479/multid
udp        0      0 0.0.0.0:5355            0.0.0.0:*                           479/multid
udp        0      0 0.0.0.0:1900            0.0.0.0:*                           1759/mediasrv
udp        0      0 0.0.0.0:1900            0.0.0.0:*                           464/upnpd
udp        0      0 0.0.0.0:1900            0.0.0.0:*                           464/upnpd
udp        0      0 0.0.0.0:1900            0.0.0.0:*                           464/upnpd
udp        0      0 0.0.0.0:1900            0.0.0.0:*                           464/upnpd
udp        0      0 0.0.0.0:1900            0.0.0.0:*                           464/upnpd
raw        0      0 0.0.0.0:2               0.0.0.0:*               2           479/multid
raw        0      0 0.0.0.0:2               0.0.0.0:*               2           479/multid
raw        0      0 0.0.0.0:2               0.0.0.0:*               2           479/multid
Active UNIX domain sockets (only servers)
Proto RefCnt Flags       Type       State         I-Node PID/Program name    Path
unix  2      [ ACC ]     STREAM     LISTENING       1620 527/pbd             /var/tmp/pbctrl
unix  2      [ ACC ]     STREAM     LISTENING       1622 527/pbd             /var/tmp/pb_event
unix  2      [ ACC ]     SEQPACKET  LISTENING       1771 514/telefon         /var/tmp/foncontrol

I searched for an explanation and found out that

[if netstat] displays your local network IP on the Local Address column, it means that port is ONLY listening for connections from the local network.

How could I implement this?:

[if netstat] displays your online IP on the Local Address column, it means that port is ONLY listening for connections from the Internet.

Thank you!
 
Zuletzt bearbeitet:
Perhaps you can try another external port? Port 80 could be blocked by AVM.

Regards
Oliver
 
Versuch mal das hier:
Code:
tcp 0.0.0.0:[COLOR="red"]85 [/COLOR]0.0.0.0:85 0 # Hiawatha
 
My best guest is that you should put 0.0.0.0 in the 'Interface' option.
 
Wenn es dann bei dir funktioniert und ein Freund sich über das Internet (d. h. von extern) mit deinem Server verbindet, könnte es mit "lsof -nPi" (wenn lsof installiert) so ähnlich (d. h. andere PID, FD, DEVICE und S-Port) aussehen:
Code:
root@fritz:/var/mod/root# [COLOR="red"]lsof -nPi | grep hiawatha[/COLOR]
hiawatha  20097 nobody    4u  IPv4 234906       TCP *:85 (LISTEN)
hiawatha  20097 nobody    7u  IPv4 235408       TCP 169.254.2.1:85->##.##.#0#.##:55301 (ESTABLISHED)
hiawatha  20098 nobody    4u  IPv4 234906       TCP *:85 (LISTEN)
hiawatha  20098 nobody    7u  IPv4 235408       TCP 169.254.2.1:85->##.##.#0#.##:55301 (ESTABLISHED)
hiawatha  20099 nobody    4u  IPv4 234906       TCP *:85 (LISTEN)
hiawatha  20099 nobody    7u  IPv4 235408       TCP 169.254.2.1:85->##.##.#0#.##:55301 (ESTABLISHED)
hiawatha  20855 nobody    4u  IPv4 234906       TCP *:85 (LISTEN)
hiawatha  20855 nobody    7u  IPv4 235408       TCP 169.254.2.1:85->##.##.#0#.##:55301 (ESTABLISHED)

EDIT:

Mit
Code:
Binding {
         Port = 85
         Interface = [B][COLOR="red"]0.0.0.0[/COLOR][/B]
 }
in der "hiawatha.conf".
 
Zuletzt bearbeitet:

Statistik des Forums

Themen
246,285
Beiträge
2,249,440
Mitglieder
373,878
Neuestes Mitglied
klaarapirkko
Holen Sie sich 3CX - völlig kostenlos!
Verbinden Sie Ihr Team und Ihre Kunden Telefonie Livechat Videokonferenzen

Gehostet oder selbst-verwaltet. Für bis zu 10 Nutzer dauerhaft kostenlos. Keine Kreditkartendetails erforderlich. Ohne Risiko testen.

3CX
Für diese E-Mail-Adresse besteht bereits ein 3CX-Konto. Sie werden zum Kundenportal weitergeleitet, wo Sie sich anmelden oder Ihr Passwort zurücksetzen können, falls Sie dieses vergessen haben.