Results 16 to 30 of 63

Thread: ipkg-Web-Managment cgi-bin Script von NSLU2 auf WL-HDD + ASUS umbauen

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #11
    Join Date
    Feb 2005
    Location
    Germany - Frankfurt
    Posts
    1,548
    mit bash gehts bei mir auch nicht

    Code:
    [admin@blechbuechse init.d]$ cat S80busybox_httpd
    #!/bin/sh
    
    PATH=/sbin:/bin:/usr/bin:/usr/sbin:/opt/bin:/opt/sbin
    
    # Uncomment path to busybox httpd to enable startup
    BUSYBOX_HTTPD=/usr/sbin/busybox_httpd
    
    HTTPD_CONFIG=/opt/etc/httpd.conf
    LISTENING_PORT=8008
    INDEX=/opt/share/www/index.html
    
    check_config(){
      if [ ! -r ${HTTPD_CONFIG} ]; then
      echo "Creating default ${HTTPD_CONFIG}"
      cat > ${HTTPD_CONFIG} << __EOF__
    # httpd.conf has the following format:
    #
    # A:172.20.         # Allow address from 172.20.0.0/16
    # A:10.0.0.0/25     # Allow any address from 10.0.0.0-10.0.0.127
    # A:10.0.0.0/255.255.255.128  # Allow any address that previous set
    # A:127.0.0.1       # Allow local loopback connections
    # D:*               # Deny from other IP connections
    # /cgi-bin:foo:bar  # Require user foo, pwd bar on urls starting with /cgi-bin/
    # /adm:admin:setup  # Require user admin, pwd setup on urls starting with /adm/
    # /adm:toor:PaSsWd  # or user toor, pwd PaSsWd on urls starting with /adm/
    # .au:audio/basic   # additional mime type for audio.au files
    #
    # A/D may be as a/d or allow/deny - first char case insensitive
    # Deny IP rules take precedence over allow rules.
    #
    #
    # The Deny/Allow IP logic:
    #
    #  - Default is to allow all.  No addresses are denied unless
    #         denied with a D: rule.
    #  - Order of Deny/Allow rules is significant
    #  - Deny rules take precedence over allow rules.
    #  - If a deny all rule (D:*) is used it acts as a catch-all for unmatched
    #       addresses.
    #  - Specification of Allow all (A:*) is a no-op
    #
    # Example:
    #   1. Allow only specified addresses
    #     A:172.20          # Allow any address that begins with 172.20.
    #     A:10.10.          # Allow any address that begins with 10.10.
    #     A:127.0.0.1       # Allow local loopback connections
    #     D:*               # Deny from other IP connections
    #
    #   2. Only deny specified addresses
    #   2. Only deny specified addresses
    #     D:1.2.3.        # deny from 1.2.3.0 - 1.2.3.255
    #     D:2.3.4.        # deny from 2.3.4.0 - 2.3.4.255
    #     A:*             # (optional line added for clarity)
    #
    # If a sub directory contains a config file it is parsed and merged with
    # any existing settings as if it was appended to the original configuration.
    #
    # subdir paths are relative to the containing subdir and thus cannot
    # affect the parent rules.
    #
    # Note that since the sub dir is parsed in the forked thread servicing the
    # subdir http request, any merge is discarded when the process exits.  As a
    # result, the subdir settings only have a lifetime of a single request.
    #
    A:*
    #/cgi-bin:${USER}:password
    .au:audio/basic
    .asp:text/html
    __EOF__
      fi
    }
    
    start() {
      if [ ! -x "${BUSYBOX_HTTPD}" ]; then
            echo "busybox httpd ${BUSYBOX_HTTPD} not started."
            exit 2
      fi
      check_config
      echo -n "Starting busybox httpd at port ${LISTENING_PORT} ... "
      ${BUSYBOX_HTTPD} -c ${HTTPD_CONFIG} -p ${LISTENING_PORT} -h /opt/share/www
      echo "done"
    }
    
    stop() {
            echo -n "Shutting down busybox httpd... "
            killall busybox_httpd
            echo "done"
    }
    
    case "$1" in
            start)
                    start
                    ;;
            stop)
                    stop
                    ;;
            restart)
                    stop
                    sleep 1
                    start
                    ;;
            *)
                    echo "Usage: $0 (start|stop|restart)"
                    exit 1
                    ;;
    esac
    Last edited by wengi; 06-03-2008 at 10:29.
    Übersicht aller HowTos --- HowTo Overview (mostly german)
    WL-HDD mit diesem Setup. --- WL-HDD with this setup.
    Kein Support per PM - Frage im jeweiligen Thread! --- No support via pm - ask in the according thread!
    Eine wirklich gute Idee erkennt man daran, dass ihre Verwirklichung von vorne herein ausgeschlossen erscheint. (Albert Einstein)

Similar Threads

  1. [Prob] Mediatomb UPnP Media Server auf dem Asus Wl-500 gP (Oleg)? Wie?
    By edelknecht in forum German Discussion - Deutsch (DE)
    Replies: 15
    Last Post: 16-04-2010, 12:54
  2. System-Aufbau von Oleg-FW auf den ASUS-Rouern gesucht
    By WLAN-Fan in forum German Discussion - Deutsch (DE)
    Replies: 7
    Last Post: 14-12-2007, 12:44
  3. Asus WL-500G en Linksys NSLU2
    By VEJ in forum Dutch Discussion - Nederlands
    Replies: 0
    Last Post: 06-12-2007, 21:23
  4. Verbinden von zwei WL500GP klappt nicht
    By marrrtin in forum German Discussion - Deutsch (DE)
    Replies: 13
    Last Post: 09-08-2007, 15:34

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •