Forum OpenACS Q&A: OpenACS on Win2K

Collapse
Posted by Pascal Scheffers on
Okay, I spent some time today playing with Win2k (my day job). Thanks to Sam Snow, who pointed to me to Cygwin, I had a perfectly good excuse for doing nothing very useful all day :)

Cygwin (the latest available download anyway) comes with PG7.1 pre installed - very hoopy. You need to download some extra things to be able to start the postmaster (took me all of two minutes to fetch and install), after which the postmaster kindly starts, without fuss (Although it didn't have fizz either, it was quite slow).

I downloaded OpenACS (from CVS) and loaded the datamodel, without any problems. All you need to change is the .../var/lib/something/plpgsql.so in postgres.sql to /lib/plpgsql.dll.

The next part was AOLServer. You need to do some editing to get the config files working, but AOLServer will start and answer queries, no problem.

Next I needed the Postgres 7.1 source to be able to compile the nsd-postgres driver-2.3. Compiling the driver on Win2K sucks, but after figuring out which headers to use, which .lib to use (DO NOT link against the static libpq.lib, it won't work - use lippqdll.lib) I got it to compile without errors.

That's how far I got. It took me plenty of time, 6 hours in all, most of it trying to compile AOLServer-pg-driver against the postgres libs. I started AOLServer once, but the postgres driver wouldn't load (windows error 128, it said (or was it 126?) ). It may well be that the postmaster just wasn't listening on 127.0.0.1:5432, I'll figure that out on friday - which might well be my last day at with my current job, we'll probably go belly-up. Anyone got a nice (OpenACS) job for me?

Collapse
Posted by Pascal Scheffers on
Ah, 't is not pretty - but it works.

You can see a running OpenACS system on Windows 2000 @ http://pascal.scheffers.net:8080/. Getting it to run needs some serious massaging of the configuration files, moving tcl libraries, etc. I have no idea for how long it will live without a crash. The windows 2000 box is behind a firewall, so the :8080 is actually a reverse SSH tunnel to my machine. The tunnel runs over an 128Kbit line, so please don't /. me :)

Platform:

  • Windows 2000 professional SP1
  • Cygwin - unix like windows environmen
  • Postgres 7.1-Cygwin (precompiled version that comes with Cygwin)
  • AOLServer 3.2+ad12 from aD
  • Latest AOLServer postgres driver from CVS, compiled against the DLL version of win32-libpq
  • OpenACS 3.2.5 from CVS
  • SSH 2.2 for incomming http tunnel (8080) and outgoing SMTP.
By the looks of it, running OpenACS on Windows 2000 is probably useful for academic purposes only...
Collapse
Posted by C. R. Oldham on
<i>By the looks of it, running OpenACS on Windows 2000 is probably useful for academic purposes only... </i>
<p>
How come--just because it hasn't been tested extensively yet?  Would it be stable enough for development maybe?
</p>
<p>One of the big selling points for the ACS for me originally was that I could load all the stuff I needed on my Win32 laptop (AOLserver, Oracle, etc) and do development on the road.  I could check our website out of CVS and work on it, commit changes and check them back out on our Linux servers without any changes at all.
</p>
Collapse
Posted by Don Baccus on
If your laptop's muscular enough, another way to accomplish this is to run Linux+VMware and run Win32 in VMware (you can go the other way, too, but I like having my base system being Linux).

VMware lets you set up a bridging virual NIC that let's your Windows installation talk over your 'net connection - my e-mail's still in Eudora, for instance, so this is how I get my mail on the road.  It's also handy for testing MSIE against a website you're developing - by setting up a second non-bridging virutal NIC Windows running in VMware  can talk to the host Linux system's ACS installation.

Collapse
Posted by Pascal Scheffers on
Oh, it would definitely be stable enough for development work. I would not do that, though. Cygwin provides a reasonably large number of the standard unix tools (haven't tried em all), but I'd rather have a full Unix environment. Also, as soon as you start interacting with the 'outside world' you'll run into platform dependant things. Like filenames, file handling (try rotating a log on win32) a lot of things are subtly different.

I would go for VMWare. I use it a lot already, and for text mode apps you don't need very much CPU horse power. Just memory. Lots of memory, I have 384MB at work. My 256MB at home usually doesn't cut it, although my home machine is a lot faster (700Athlon/Asus compared to 533PIII/Dell). I would do it the otherway round, though: A linux guest on Win2k host. I have experienced some rather large performance differences, between the two, mainly because Windows sucks. It's memory allocation mechanisms don't play nice with VMWare, Linux runs much, much smoother in VMWare than Win2k (even when using X).

Keep your VMWare guest OS lean and mean, and even Postgres will run like lightning (give it some RAM..). Another extremely nice feature of VMWare is 'undoable disks'. Just run your Postgres /DATA in such a disk and you can restore to a base platform by simply discarding a session. Very nice for setup/upgrade testing.

Comming back to ACS on Win2k. I wanted to see if it could be done. It can. If we are to support this (waaaay too early for me), it should be properly documented first. Again I am fairly certain there are all kinds of nasty Win32 snares.

Collapse
Posted by Don Baccus on
Ahhh...I'm just running Win98 on my VMWare installation, and it's fine  with the special VMWare video driver - you need to run it full screen, though, or else it is very sluggish (because it paints within a regular X window rather than on the root window, I guess).

The linux file buffer cache actually means that win98 stuff runs really quite nicely, doesn't seem to keep the disk chattering around nearly as much as it does when running native.

Why do I use win98?  'cause I just read e-mail, browse, sometimes use word, and filemaker pro (my homebrew slide database for tracking photo sales, etc).  Nothing *real* :)

Of course, if I did any real windows work I'd get Win2K.

Collapse
Posted by Pascal Scheffers on
As I have had more-recent-than-the-windows release hardware since, oh, 1996, I have (unfortunately) always had to stay with a rather recent version of Windows. Especially running M$ Visual C or Borland C Builder manages to crash a lot more often on older windows versions on newer hardware. Running '98 in the VMWare just hadn't crossed my mind yet (mind you, at work we can't as we are using it to test server applications with permissions and all), but VMWare would not have those problems.

I wasn't talking about disk performance, though. It seems that the SysMalloc()/SysFree() calls of [D]COM[+] are really inefficient within the VMWare client. That means that each time a VisualBasic app is splicing and merging strings CPU usage goes to 100%. 's probably got to do with allocating 'cleaned' memory pages, where the content is guaranteed to be all zeroes.

Collapse
Posted by Jerry Asher on
Pascal,

Can you explain a bit more about how you got the pgdriver to link?

I'm using PG 7.1.2 (which is distributed with cygwin) and see no libpqdll.lib or libpqdll.(anything)  (I do see the libpq and yep that's really wrong.)

Thanks,

Collapse
Posted by Pascal Scheffers on
You need to get the PG sources and follow the compile-on-win32 instructions, cygwin alone will not work. You'll end up with client libraries for pg, both dll and static. I could only link against the DLL version (libpqdll.lib or something).

I compiled with the cygwin pg-include files and the win32 library files.

Hope this helps.

Collapse
Posted by Jerry Asher on
Thanks Pascal,

I found doc/src/sgml/install-win32.sgml which details how you make the client library (libpq.dll and libpqdll.lib and some other stuff) using Visual C++.  Sure enough, I can now see that the src tree has several win32.mak files to feed VC++.

Since I've been Visual C++ free for several years now, I just want to confirm: did you use VC++ to build the dll and lib, or did you get gcc to do the trick (and if so, how?)

I note that the config.h built by configure for cygwin is significantly different the cygwin.h.win32 that would be used by Visual C++ iff no other config.h existed.  A make clean prior to building with VC++ would appear to build the client libs conflicting with the way pg itself was built.  So am I right to assume you built the client libraries over the already configured for cygwin tree?

Thanks once more,

Collapse
Posted by Pascal Scheffers on
I have compiled without reconfiguring or anything, I don't remember
exactly how (this was only a test for me, nothing serious). I have
used VC++ 6 for compiling, I have never tried GCC on cygwin.