Till now I got the following to work: The main configuration file
includes a a command to include my script to fetch the data out of
the mysql server. This script fetches the domain, document-root and
errorlog-path. This seems to work correctly. But the aolserver does
still not handle the domains. I think it's a probleme in the
vhtemplate.tcl template file. But I am not sure what could be wrong
there.
I get no errors and there are no entries in the domain specific
access los.
The aolserver4.tcl (this is the main config file) executes the
following comands at the end of the file:
<--- snip --->
ns_log notice "Starting to read mysql vhost config file..."
source /usr/lib/aolserver4/etc/mysql.tcl
ns_log notice "Finished reading mysql vhost config file!"
--- / snip ---
And here is the mysql.tcl:
<--- snip --->
package require mysqltcl
set vhserver "localhost"
set vhusername "www-data"
set vhpassword "secret"
set vhdbase "myvhosts"
set dbh [mysqlconnect -host $vhserver -user $vhusername -password
$vhpassword -db $vhdbase]
set res [mysqlsel $dbh "SELECT * FROM domains" -flatlist]
foreach { domain docroot suffix } $res {
ns_log notice "Setting up $domain"
# puts "$domain $docroot $suffix"
source /usr/lib/aolserver4/etc/vhtemplate.tcl
ns_log notice "DONE!"
}
mysqlclose $dbh
<--- / snip --->
Last but not least, here is the template file vhtemplate.tcl:
<--- snip --->
ns_param server ${domain}
ns_section "ns/server/${domain}"
ns_param directoryfile index.php,index.adp,index.html,index.htm
ns_param pageroot $docroot
# Tuning options
ns_param connsperthread 0
ns_param flushcontent false
ns_param maxconnections 100
ns_param maxdropped 0
ns_param maxthreads 20
ns_param minthreads 0
ns_param threadtimeout 120
# Limits
ns_param maxheaders 16384
ns_param maxline 8192
ns_param maxpost 65536
ns_param sendfdthreshold 2048
# Performance statistics gathering
ns_param globalstats true
ns_param urlstats true
ns_param maxurlstats 1000
# Directory listings can be generated with an ADP or a Tcl proc.
ns_param directoryadp ${homedir}/dirlist.adp
ns_param directoryproc _ns_dirlist
ns_param directorylisting simple
# Miscellaneous
ns_param checkmodifiedsince true
ns_param enableaolpress false
ns_param headercase preserve
ns_section "ns/server/${domain}/fastpath"
ns_param cache true
ns_param cachemaxentry 8192
ns_param cachemaxsize [expr 5000*1024]
ns_param mmap false
#
# Tcl interpreter
#
ns_section "ns/server/${domain}/tcl"
ns_param autoclose true
ns_param debug false
ns_param nsvbuckets 8
ns_param statlevel 0
ns_param statmaxbuf 100
ns_param library ${homedir}/servers/${domain}/modules/tcl
ns_section "ns/server/${domain}/module/nslog"
ns_param file /var/log/${package}/${suffix}/access.log
ns_param logfile /var/log/${package}/${suffix}/error.log
ns_param formattedtime true
ns_param logcombined false
ns_param maxbackup 5
ns_param rollhour 0
ns_param rolllog true
ns_param rollonsignal true
ns_section "ns/server/${domain}/modules"
ns_param nssock nssock.so
ns_param nslog nslog.so
ns_param php libphp4.so
ns_section "ns/server/${domain}/module/php"
ns_param map *.php
<--- / snip --->
Greetings
Chris
--
Neid ist die deutsche Form von Anerkennung
--
AOLserver - http://www.aolserver.com/
To Remove yourself from this list, simply send an email to <[EMAIL PROTECTED]>
with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject:
field of your email blank.