Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Attempting to make a portable WiFi webserver with php support on an old WRT54GS (v1.0) with DD-WRT. I have 8MB of flash on there. I know, it's a tall order. I tried the combination of dd-wrt.v24-13064_VINT_openvpn_jffs_small.bin, optware, and lighttpd. Didn't have enough space. Now I'm going to try dd-wrt.v24-13064_VINT_mini.bin, but I'm only saving 300KB, and I don't think that is going to make the difference. Any other small http servers with php support? Heck, I didn't even got to the point where I could add php!

Maybe a way to calculate the size and dependencies of packages from optware BEFORE trying to install is more what I'm looking for.

Any ideas?

share|improve this question
add comment

1 Answer 1

up vote 1 down vote accepted

This one isn't related to DD-WRT but is similar:

I used OpenWRT on a device with 8 MiB of flash and used the included uhttpd server as webserver.

Advantages of OpenWRT here are that its squashfs image is much smaller and its root is in JFFS2 and is editable.

Configuration part is simple too. Interesting file is /etc/config/uhttpd

# Server configuration
config uhttpd main

        # HTTP listen addresses, multiple allowed
        list listen_http        0.0.0.0:80
#       list listen_http        [::]:80

        # HTTPS listen addresses, multiple allowed
        list listen_https       0.0.0.0:443
#       list listen_https       [::]:443

        # Server document root
        option home             /www

        # Reject requests from RFC1918 IP addresses
        # directed to the servers public IP(s).
        # This is a DNS rebinding countermeasure.
        option rfc1918_filter 1

        # Certificate and private key for HTTPS.
        # If no listen_https addresses are given,
        # the key options are ignored.
        option cert             /etc/uhttpd.crt
        option key              /etc/uhttpd.key

        # CGI url prefix, will be searched in docroot.
        # Default is /cgi-bin
        option cgi_prefix       /cgi-bin

        # List of extension->interpreter mappings.
        # Files with an associated interpreter can
        # be called outside of the CGI prefix and do
        # not need to be executable.
#       list interpreter        ".php=/usr/bin/php-cgi"
#       list interpreter        ".cgi=/usr/bin/perl"

        # Lua url prefix and handler script.
        # Lua support is disabled if no prefix given.
#       option lua_prefix       /luci
#       option lua_handler      /usr/lib/lua/luci/sgi/uhttpd.lua

        # CGI/Lua timeout, if the called script does not
        # write data within the given amount of seconds,
        # the server will terminate the request with
        # 504 Gateway Timeout response.
        option script_timeout   60

        # Network timeout, if the current connection is
        # blocked for the specified amount of seconds,
        # the server will terminate the associated
        # request process.
        option network_timeout  30

        # Basic auth realm, defaults to local hostname
#       option realm    OpenWrt

        # Configuration file in busybox httpd format
#       option config   /etc/httpd.conf


# Server configuration
config uhttpd secondary

        # HTTP listen addresses, multiple allowed
#       list listen_http        0.0.0.0:80
        list listen_http        [::]:80

        # HTTPS listen addresses, multiple allowed
#       list listen_https       0.0.0.0:443
        list listen_https       [::]:443

        # Server document root
        option home             /mnt/www

        # Reject requests from RFC1918 IP addresses
        # directed to the servers public IP(s).
        # This is a DNS rebinding countermeasure.
        option rfc1918_filter 1

        # Certificate and private key for HTTPS.
        # If no listen_https addresses are given,
        # the key options are ignored.
        option cert             /etc/uhttpd.crt
        option key              /etc/uhttpd.key

        # CGI url prefix, will be searched in docroot.
        # Default is /cgi-bin
        option cgi_prefix       /cgi-bin

        # List of extension->interpreter mappings.
        # Files with an associated interpreter can
        # be called outside of the CGI prefix and do
        # not need to be executable.
#       list interpreter        ".php=/usr/bin/php-cgi"
#       list interpreter        ".cgi=/usr/bin/perl"

        # Lua url prefix and handler script.
        # Lua support is disabled if no prefix given.
#       option lua_prefix       /luci
#       option lua_handler      /usr/lib/lua/luci/sgi/uhttpd.lua

        # CGI/Lua timeout, if the called script does not
        # write data within the given amount of seconds,
        # the server will terminate the request with
        # 504 Gateway Timeout response.
        option script_timeout   60

        # Network timeout, if the current connection is
        # blocked for the specified amount of seconds,
        # the server will terminate the associated
        # request process.
        option network_timeout  30

        # Basic auth realm, defaults to local hostname
#       option realm    OpenWrt

        # Configuration file in busybox httpd format
#       option config   /etc/httpd.conf

# Certificate defaults for px5g key generator
config cert px5g

        # Validity time
        option days             730

        # RSA key size
        option bits             1024

        # Location
        option country          DE
        option state            Berlin
        option location         Berlin

        # Common name
        option commonname       OpenWrt

I added a new site using the config uhttpd secondary part. Just copy the config uhttpd main, edit it and paste it back under new name. In my case, the other site listens only for IPv6 connections and has it's root in /mnt/www.

On my TP-LINK TL-WR1043ND default installation (which includes uhttpd) took just a bit over 4 MiB so there should be at least 3.5 MiB of free space for the site.

share|improve this answer
    
Very cool. OpenWRT. Thanks! –  Jeshii Mar 12 '11 at 4:07
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.