Forum OpenACS Q&A: Does AOLserver 3.0 require .tcl style startup file?

Question 1: I downloaded and installed the latest beta3 ACS/pg, and installed it into AOLserver 3.0. I got too many errors to make it useable, and when I started looking at them they seemed to be caused by missing values in the configuration file. I was using the /parameters/ad.ini file at first, but then decided to edit the ad.tcl file only to find it was identical to the ad.ini file. Should I be running this through Rob's conversion utility before using it?

Question 2: How do I run 2 ACS installations on the same computer? Do I need to startup two postmasters with different data directories, or do I need to put both databases in the same place?

The parameters/ad.ini file is the ACS/pg-specific file. Is your AOLserver installation working right besides the ACS part ?

Ben made an ad.tcl file available at parameters/ad.tcl that you can use. .tcl files allow for more flexibility.

I'd recommend you go through the AOLserver installation docs, get it talking to PostgreSQL and then worry about ACS/pg. That way you isolate the problems and make it easier to debug.

Actually I have the ACS installed and "working", so AOLserver is talking to postgreSQL (main,subquery,log) and Interbase with no problem. The problem seems to come in when AOLserver needs a value which is set in parameters/ad.ini. If the .ini file has, for instance EnabledP=1, and some tcl code asks if {[ad_parameter EnabledP sectionname]} ..., I get an error like 'expected boolean but got "" '. So I must be making a basic mistake here (Do I have AuxConfigDir set correctly? Does the file need to be in .tcl format?).

Ah, ok. I don't know how to do that in the main AOLserver .tcl file, but in the old .ini-style file you needed: AuxConfigDir=/path/to/parameters/

It seems that you are missing that line that tells AOLserver to llok the parameters directory. You can use either .ini or .tcl files, but the trend is to move to .tcl files. Any .tcl experts out there to help Tom ?

Well I think I figured out what I did wrong. I did have the AuxConfigDir parameter set correctly, but I put it in the wrong section. I edited the basic nsd.tcl file, and the AOLserver team had a comment "Server Parameters", with the section "ns/server/${servername}" under that. In my haste I added the AuxConfigDir to this section instead of adding it to the "ns/parameters" section. Now I'm suprised that the ACS ran so well without sourcing this file! That solved, can anyone answer my second question: How to set up the data sources for two ACS/pgs on one computer?

Question 2
<p>
Start up one postmaster, but create two databases:
<pre>
createdb acs1
createdb acs2
</pre>
Then do the obvious thing in your datasource statements for the two virtual servers.
<p>
The only reason to start two postmasters would be to listen on two separate IPs (or ports), or to vary the resources used by each ACS installation (shared buffer pool, etc).  The last is probably not a good reason, I think you'd always be better off with a single postmaster and let it use ample shared buffer memory and give it a big  limit for sorts and heap joins (Postgres spills to disk if this limit  is overrun).
<p>
OK, I can hear the next question, and yes, I should probably write up a short document called "PG configuration for ACS/pg newbies" :)
Okay, let me post a small thing about .tcl param files to clear this up. We should also write this up into the main docs online.

If you're using .ini format, just plop AuxConfigDir in your ns/parameters section and make sure you have the ACS .ini file in that parameter directory. In that ACS .ini file, you need to make sure to change "yourservername" to whatever your server name actually is.

If you're using .tcl format all the way, which I recommend as it is much more flexible in the long run, you need to use the ad.tcl ACS parameter file. Also, AuxConfigDir will *not* work in your main parameter file. Instead, you'll need to explicitly source the other Tcl file by adding this line at the end of your main param file:

source /web/yourserver/parameters/yourserver.tcl
Or, if you're feeling adventurous and want to source all the Tcl files in there (which is more dangerous with .tcl than with .ini since the "yourservername" substitution is automatically done for you, so you might get confused as to which config files are actually getting sourced):
foreach tcl_file [glob /web/yourserver/parameters/*.tcl] {
	source $tcl_file
}
Will include this is the docs Ben. Thanks for the tips. I'll be completely reviewing the docs this weekend.

After reporting success in moving the AuxConfigDir parameter to another section, I discovered what is reported above: that AOLserver only reads .ini style files from that directory. Since I had already converted this to a .tcl file, I went to bed hoping the inevitable "this is the way it is done" responses would appear. Thanks!

For those who have not tracked down Rob Mayoff's superior ini2tcl conversion utility, here is the link to his AOLserver Modules page: http://dqd.com/~mayoff/aolserver/.

Thanks for the simple explanations about the .tcl files, Ben.  I've been tracking this, and hope to update the Concrete guide this weekend, to use the newest versions of everything.  Do people think that I should document both the .ini and .tcl styles, indicating that we will be moving to the .tcl in the future?