Danja Vasiliev 10 years ago
parent
commit
d5ced1a28f
2 changed files with 25 additions and 16 deletions
  1. 23 14
      openwrt/common/etc/lighttpd/lighttpd.conf
  2. 2 2
      openwrt/common/etc/logrotate.conf

+ 23 - 14
openwrt/common/etc/lighttpd/lighttpd.conf

@@ -46,23 +46,32 @@ url.access-deny = ( "~", ".inc", ".htaccess", ".htpasswd", "htpasswd", "/tmp/" )
 
 auth.backend = "htdigest"
 auth.backend.htdigest.userfile = "/opt/lib/htpasswd"
-auth.require = (
-  "/admin"  => (
-    "method"  =>  "digest",
-    "realm"   =>  "superglue",
-    "require" =>  "valid-user"
-  ),
-  "/log"  => (
-    "method"  =>  "digest",
-    "realm"   =>  "superglue",
-    "require" =>  "valid-user"
-  ),
-  "/server-status" => (
+#auth.require = (
+#  "/admin"  => (
+#    "method"  =>  "digest",
+#    "realm"   =>  "superglue",
+#    "require" =>  "valid-user"
+#  ),
+#  "/log"  => (
+#    "method"  =>  "digest",
+#    "realm"   =>  "superglue",
+#    "require" =>  "valid-user"
+#  ),
+#  "/server-status" => (
+#    "method"  =>  "digest",
+#    "realm"   =>  "superglue",
+#    "require" =>  "valid-user"
+#  )
+#)
+
+$HTTP["url"] =~ "^/admin$|^/admin/(.*)|^/log/(.*)$" {                                                 
+  auth.require = ( "" => (    
     "method"  =>  "digest",
     "realm"   =>  "superglue",
     "require" =>  "valid-user"
+    )
   )
-)
+}
 
 $HTTP["request-method"] == "GET" {
   url.rewrite = (
@@ -90,7 +99,7 @@ $HTTP["request-method"] == "GET" {
 $HTTP["request-method"] == "POST" {
   alias.url = (
     "/admin"    =>  "/opt/lib/cgi/admin2.cgi",
-    ""          =>  "/opt/lib/cgi/post.cgi"
+    ""          =>  "/opt/lib/cgi/post2.cgi"
   )
   auth.require = (
     "" => (

+ 2 - 2
openwrt/common/etc/logrotate.conf

@@ -1,5 +1,5 @@
 ## config file for /sbin/logrotate
 ## this file is NOT compatible with standard GNU logrotate 
 
-## keep logs for 120 days
-_ROTATE=120
+## keep logs for 7 days
+_ROTATE=7