OpenWrt Forum Archive

Topic: multiple instances of uhttpd

The content of this topic has been archived on 6 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi,

I need to run 2 instances of uhttpd, each of them listening on a different port and with a different root directory.

I haven't found any explanation about how to do this with packages which include uci config files, init.d scripts and so on.

I tried to create a renamed copy of the uhttpd script in init.d and same with the uci configuration file but this doesn't seem to work.

I am sure there is an easier way.

Can anyone show me some light here?

Thanks a lot!

(Last edited by griguolcomerranas on 2 Nov 2012, 05:42)

I have been looking at that wiki page during the whole day but until know I didn't realize about this sentence:

Multiple sections if the type uhttpd may exist - the init script will launch one webserver instance per section.

Now my configuration file looks like this and it works perfectly with 2 instances:

config uhttpd 'main'
    list listen_http '0.0.0.0:80'
    option home '/usbdrive'
    option rfc1918_filter '1'
    option max_requests '2'
    option cert '/etc/uhttpd.crt'
    option key '/etc/uhttpd.key'
    option cgi_prefix '/cgi-bin'
    option script_timeout '60'
    option network_timeout '30'
    option tcp_keepalive '10'
    option config '/etc/httpd.conf'

config uhttpd 'secondary'
    list listen_http '0.0.0.0:8080'
    option home '/usbdrive/public'
    option rfc1918_filter '1'
    option max_requests '2'
    option cert '/etc/uhttpd.crt'
    option key '/etc/uhttpd.key'
    option cgi_prefix '/cgi-bin'
    option script_timeout '60'
    option network_timeout '30'
    option tcp_keepalive '10'
    option config 'none'

config cert 'px5g'
    option days '730'
    option bits '1024'
    option country 'DE'
    option state 'Berlin'
    option location 'Berlin'
    option commonname 'OpenWrt'

big_smile

(Last edited by griguolcomerranas on 2 Nov 2012, 11:18)

The discussion might have continued from here.