diff -r 8f5e7d62f577 tests/apachetest/apachetest.tcl
--- tests/apachetest/apachetest.tcl	Fri Oct 19 09:26:35 2007 +0100
+++ tests/apachetest/apachetest.tcl	Wed Oct 24 16:59:58 2007 +0300
@@ -34,9 +34,14 @@ namespace eval apachetest {
 
     # name of the apache binary, such as /usr/sbin/httpd
     variable binname ""
+	if ![info exists ::httpd_version ] {
+    	puts stderr "Please create httpd_version variable "
+	    exit 1
+	}
+	variable httpd_version  $::httpd_version
     # this file should be in the same directory this script is.
     variable templatefile [file join [file dirname [info script]] \
-			       template.conf.tcl]
+			       template.conf.$httpd_version\.tcl]
 }
 
 # apachetest::need_modules --
@@ -105,6 +110,7 @@ proc apachetest::start { options conftex
     variable serverpid 0
     variable binname
     variable debug
+    variable httpd_version
 
     set fn [file join [pwd] test.conf]
     catch {file delete -force $fn}
@@ -112,10 +118,17 @@ proc apachetest::start { options conftex
     puts $fl [uplevel [list subst $conftext]]
     close $fl
 
+    #OpenBSD related workaround, their stock apache tries to chroot by default
+    #have to  add -u to the arguments to prevent this
+    catch {exec uname} uname_str
+    if {[string equal $uname_str OpenBSD] && $httpd_version == 1 } {
+        set server_args "-u -X -f"
+    } else {
+        set server_args "-X -f"
+    }
     # There has got to be a better way to do this, aside from waiting.
-    set serverpid [eval exec  $binname -X -f \
+    set serverpid [eval exec  $binname $server_args \
 		       [file join [pwd] server.conf] $options >& apachelog.txt &]
-
     apachetest::connect
     if { $debug > 0 } {
 	puts "Apache started as PID $serverpid"
@@ -323,6 +336,11 @@ proc apachetest::makeconf { outfile {ext
     variable templatefile
     set CWD [pwd]
 
+    #getting uid and gid of user
+    catch {exec id} raw_string		
+    set username  [lindex [regexp -inline {(uid=)([\d]+)(\()([^\)]+)(\))} $raw_string]  4]
+    set group  [lindex [regexp -inline {(groups=)([\d]+)(\()([^\)]+)(\))} $raw_string]  4]
+
     # replace with determinemodules
     set LOADMODULES [determinemodules $binname]
 
