Different log directories for different Apache versions
authorAdam Chlipala <adamc@hcoop.net>
Sat, 21 Apr 2007 22:36:20 +0000 (22:36 +0000)
committerAdam Chlipala <adamc@hcoop.net>
Sat, 21 Apr 2007 22:36:20 +0000 (22:36 +0000)
configDefault/apache.cfg
configDefault/apache.csg
src/plugins/apache.sml

index 4ef970b..0a58d57 100644 (file)
@@ -22,11 +22,14 @@ val proxyTargets = ["http://hcoop.net/cgi-bin/mailman",
 
 val public_html = "public_html"
 
-fun logDirOf user =
+fun logDirOf version1 user =
     if size user < 2 then
        "/bad_username"
     else
-       String.concat ["/var/log/apache/user/",
+       String.concat [if version1 then
+                          "/var/log/apache/user/"
+                      else
+                          "/var/log/apache2/user/",
                       String.substring (user, 0, 1),
                       "/",
                       String.substring (user, 0, 2),
index 63adf00..cd0fbb7 100644 (file)
@@ -18,6 +18,6 @@ signature APACHE_CONFIG = sig
 
     val        public_html : string
 
-    val logDirOf : string -> string
+    val logDirOf : bool -> string -> string
 
 end
index 31fda50..602a396 100644 (file)
@@ -242,7 +242,7 @@ fun undown () = if imVersion1 () then Config.Apache.undown1 else Config.Apache.u
 fun reload () = if imVersion1 () then Config.Apache.reload1 else Config.Apache.reload
 
 fun logDir {user, node, vhostId} =
-    String.concat [Config.Apache.logDirOf user,
+    String.concat [Config.Apache.logDirOf (imVersion1 ()) user,
                   "/",
                   node,
                   "/",