<?xml version='1.0' ?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
               "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
<!ENTITY % myvars SYSTEM "../variables.ent">
%myvars;
]>
<sect1 id="win2k-installation">
<title>OpenACS Installation Guide for Windows2000</title>

<authorblurb>
<para>by Matthew Burke and Curtis Galloway</para>
</authorblurb>
    
  <para><emphasis role="strong">NOTE:</emphasis> These instructions were
	valid for ACS v4, but have not been tested with OpenACS and the ArsDigita binary 
	distributions are no longer available.	
    Currently
    (10/2003), the best option to get OpenACS &version; running on Windows
    is to use <ulink url="http://vmware.com">VMware</ulink> and John
    Sequeira's <ulink
    url="http://www.pobox.com/~johnseq/projects/oasisvm/">Oasis VM
    distribution</ulink>
  </para>


    <itemizedlist>
      <listitem><para>Source: <ulink url="http://openacs.org/projects/openacs/download/">http://openacs.org/projects/openacs/download</ulink></para></listitem>

      <listitem><para>Bug reports: <ulink url="http://openacs.org/bugtracker/openacs/">http://openacs.org/bugtracker/openacs</ulink></para></listitem>

      <listitem><para>Philosophy: <ulink url="http://photo.net/wtr/thebook/community/">http://photo.net/wtr/thebook/community</ulink>
      (the community chapter of <emphasis>Philip and Alex&#39;s Guide to Web
      Publishing</emphasis>)</para></listitem>

      <listitem><para>Technical background: <ulink url="http://photo.net/wtr/thebook/">http://photo.net/wtr/thebook/</ulink></para></listitem>
    </itemizedlist>

  

<sect2 id="win2kinstall-overview">
<title>Overview</title>
<para>
    With the recent release of a win32 version of AOLserver, it is now
    possible to run the OpenACS on Windows2000 and Windows98. This document
    explains the steps necessary to get the OpenACS installed and running on your
    machine. <phrase>Note:</phrase> We do not recommend running a production
    server on Windows98. But the platform is more than sufficient for working
    the <ulink url="http://photo.net/teaching/one-term-web">problem sets</ulink> and
    for getting a feel for the OpenACS. 
</para>
    <para>You&#39;ll need to use the ArsDigita binary distribution of AOLserver
    for the Win32 platform, which contains patches for several problems we
    have come across in the default AOLserver binary distribution. See <ulink url="/aol3">the ArsDigita AOLserver 3 distribution page</ulink> for
    details.</para>

    <para>You can download the binary distribution from <ulink url="http://arsdigita.com/download">the ArsDigita download page</ulink>
    under &quot;ArsDigita AOLserver 3 Binary Distribution for Win32.&quot;
    Please read the release notes in the distribution for configuration notes
    specific to the version you are downloading.</para>

    </sect2>

<sect2 id="win2kinstall-prerequisites">
<title>Prerequisites</title>


    <itemizedlist>
      <listitem><para>Windows 2000 or Windows 98</para></listitem>

      <listitem><para><ulink url="http://www.winzip.com">WinZip</ulink> or any tool that can
      extract gzipped/tarred archives.</para></listitem>

      <listitem><para><ulink url="ftp://ftp.blarg.net/users/amol/zsh">zsh</ulink> (free;
      included in the binary distribution). If this link is broken try <ulink url="http://www.zsh.org">http://www.zsh.org</ulink>.</para></listitem>

      <listitem><para><ulink url="http://www.oracle.com">Oracle 8</ulink> relational database
      management system</para></listitem>

      <listitem><para><ulink url="http://www.aolserver.com">AOLserver</ulink> (free)</para></listitem>

      <listitem><para><ulink url="http://prdownloads.sourceforge.net/aolserver/nsoracle-2.6.tar.gz?download">
      Oracle driver for AOLserver</ulink> (free)</para></listitem>
    </itemizedlist>

<para>    It is helpful if you have Oracle interMedia Text for full-text searches.
    We&#39;re also trying to make our system work with the PLS System,
    available free from <ulink url="http://www.pls.com">http://www.pls.com</ulink>. 
</para>
    <para>Although the <computeroutput>zsh</computeroutput> shell is the only command-line tool
    required to install the OpenACS, if you are a UNIX person used to typing
    <computeroutput>ls</computeroutput> instead of <computeroutput>dir</computeroutput> you&#39;ll get along much
    better with the Cygwin toolkit from RedHat (available at <ulink url="http://sourceware.cygnus.com/cygwin">http://sourceware.cygnus.com/cygwin</ulink>).
    This is a development library and set of tools that gives you a very
    UNIX-like environment under Windows. In particular, it includes
    <computeroutput>bash</computeroutput>, <computeroutput>gzip</computeroutput> and <computeroutput>tar</computeroutput>, which you can
    use to perform the OpenACS installation instead of WinZip and zsh.</para>

    </sect2>
<sect2 id="win2kinstall-oracle">
<title>Your Oracle installation</title>
<para>
    When you install Oracle, a good rule of thumb is &quot;every default
    setting is wrong.&quot; We will not discuss Oracle configuration here
    except to mention that the OpenACS requires Oracle&#39;s NLS_DATE_FORMAT
    parameter be set to &#39;YYYY-MM-DD&#39;. Fixing this depends on whether
    Oracle Administration Assistant for Windows NT (<emphasis>yes,
    that&#39;s Windows <phrase>NT</phrase>)</emphasis> will run on your
    machine or not (in some cases, it will complain about Microsoft Managment
    Console not being installed). </para>

    <para>If it runs on your machine, proceed as follows:</para>

    <orderedlist>
      <listitem><para>Run Oracle Administration Assistant for Windows NT</para></listitem>

      <listitem><para>Navigate using the Explorer-style control in the left panel and
      select the Oracle Home for the database you wish to use.</para></listitem>

      <listitem><para>Bring up its properties dialog and add a parameter NLS_DATE_FORMAT
      with value &#39;YYYY-MM-DD&#39; (<emphasis>without the
      quotes</emphasis>)</para></listitem>

      <listitem><para>Verify the date format by logging into the database using SQL Plus
      and run the following query: <computeroutput>select sysdate from
      dual;</computeroutput></para></listitem>
    </orderedlist>

    <para>Otherwise you will need to perform a little registry surgery as
    follows:</para>

    <orderedlist>
      <listitem><para>Run <computeroutput>regedit</computeroutput> and navigate down the registry keys to
      <computeroutput>HKEY_LOCAL_MACHINE\Software\ORACLE</computeroutput>.</para></listitem>

      <listitem><para>
        Choose the appropriate subtree; this will be <computeroutput>HOME0</computeroutput> if
        you only have on einstallation of Oracle. 

        <blockquote><para>
          If you are an Oracle achiever and have more than one Oracle
          installation on your machine, you will see <computeroutput>HOME0, HOME1,
          HOME2</computeroutput>, etc. Choose the subtree that corresponds to the
          Oracle installtion you wish to use with the OpenACS.
        </para></blockquote>
      </para></listitem>

      <listitem><para>If the <computeroutput>NLS_DATE_FORMAT</computeroutput> key is already present,
      double-click on its value and change it to &#39;YYYY-MM-DD&#39; 
      (<emphasis>without the quotes</emphasis>). If the key does not
      exist, choose <computeroutput>Edit-&gt;New-&gt;String Value</computeroutput> from the menu
      and type <computeroutput>NLS_DATE_FORMAT</computeroutput> for the name of the new value to
      create it. Then double-click on the empty value to change it.</para></listitem>

      <listitem><para>Verify the date format by logging into the database using SQL Plus
      and run the following query: <computeroutput>select sysdate from
      dual;</computeroutput></para></listitem>
    </orderedlist>

    <para>For more information on Oracle configuration look at <ulink url="http://photo.net/wtr/oracle-tips">http://photo.net/wtr/oracle-tips</ulink>
    or search the <ulink url="http://openacs.org/forums/">OpenACS forums</ulink>. One other note: the &quot;nuke a user&quot; admin page and
    Intermedia won&#39;t run unless you set <computeroutput>open_cursors = 500</computeroutput>
    for your database.</para>

    </sect2>

<sect2 id="win2kinstall-acs-binary">
<title>The ArsDigita binary installation</title>
<para>
    Extract the ArsDigita AOLserver distribution onto the <computeroutput>C:</computeroutput>
    drive into the default <computeroutput>aol30</computeroutput> directory. You can install it
    on any drive, but it will make your life easier if you keep the AOLserver
    binary and your OpenACS instance on the same drive. For the rest of these
    instructions, we&#39;ll assume that you used drive <computeroutput>C:</computeroutput>. 
</para>
    </sect2>

<sect2 id="win2kinstall-untar-acs">
<title>Untar the OpenACS</title>
<para>
    We recommend rooting webserver content in <computeroutput>c:\web</computeroutput>. Since most
    servers these days are expected to run multiple services from multiple IP
    addresses, each server gets a subdirectory from <computeroutput>c:\web</computeroutput>. For
    example, <computeroutput>http://scorecard.org</computeroutput> would be rooted at
    <computeroutput>c:\web\scorecard</computeroutput> on one of our machines and if
    <computeroutput>http://jobdirect.com</computeroutput> were on the same box then it would be
    at <computeroutput>c:\web\jobdirect</computeroutput>. 
</para>
    <para>For the sake of argument, we&#39;re going to assume that your service
    is called &quot;yourdomain&quot;, is going to be at
    <computeroutput>http://yourdomain.com</computeroutput> and is rooted at
    <computeroutput>c:\web\yourdomain</computeroutput> in the Windows 2000 file system. Note that
    you&#39;ll find our definitions files starting out with
    &quot;yourdomain.com&quot;.</para>

    <itemizedlist>
      <listitem><para>download the OpenACS (see <ulink url="#source">above</ulink>) into
      <computeroutput>c:\temp\acs.tar.gz</computeroutput></para></listitem>

      <listitem><para>use WinZip (or equivalent) to extract the files to
      <computeroutput>c:\web\yourdomain</computeroutput></para></listitem>
    </itemizedlist>
<para>   
 You&#39;ll now find that <computeroutput>c:\web\yourdomain\www</computeroutput> contains the
    document root and <computeroutput>c:\web\yourdomain\tcl</computeroutput> contains Tcl scripts
    that are loaded when the AOLserver starts up. 
</para>
    </sect2>

<sect2 id="win2kinstall-data-model">
<title>Feeding Oracle the Data Model</title>
<para>
    The entire server will behave in an unhappy manner if it connects to
    Oracle and finds that, for example, the users table does not exist. Thus
    you need to connect to Oracle as whatever user the AOLserver will connect
    as, and feed Oracle the table definitions. 
</para>
    <itemizedlist>
      <listitem><para>
        load the <computeroutput>states</computeroutput>, <computeroutput>country_codes</computeroutput> and
        <computeroutput>counties</computeroutput> tables using the <computeroutput>load-geo-tables</computeroutput>
        shell script in the <computeroutput>c:\web\yourdomain\www\install</computeroutput>
        directory. You will need to open a console window and run </para>

<programlisting>
zsh load-geo-tables foo/foopassword
</programlisting>
<para>
        You most likely will see a slew of &quot;Commit point reached . . .
        &quot; messages. This does not indicate a problem. 

        
      </para></listitem>

      <listitem><para>
        cd to <computeroutput>c:\web\yourdomain\www\doc\sql</computeroutput> and feed Oracle the
        .sql files that you find there. There is a meta-loader file,
        load-data-model.sql, that includes the other files in the proper
        order. To use it, open a console window and run 
</para>
<programlisting>
sqlplus foo/foopassword &lt; load-data-model.sql
</programlisting>

      </listitem>

      <listitem><para>
        If you have interMedia installed, while still in
        <computeroutput>c:\web\yourdomain\www\doc\sql</computeroutput>, run 
</para>
<programlisting>
zsh load-site-wide-search foo foopassword ctxsys-password
</programlisting>

<para>
        Note that there&#39;s no slash between <computeroutput>foo</computeroutput> and
        <computeroutput>foopassword</computeroutput> here. The third argument,
        <computeroutput>ctxsys-password</computeroutput>, is the password for interMedia
        Text&#39;s special ctxsys user.
      </para></listitem>
    </itemizedlist>

    </sect2>

<sect2 id="win2kinstall-aolserver">
<title>Configuring AOLserver</title>


    <para>You will need two configuration files. The first is a Tcl file with
    configuration information for AOLserver. This should be called
    <computeroutput>yourdomain</computeroutput> and should be located in
    <computeroutput>c:\aolserve3_0</computeroutput>. The second is an .ini file that configures
    the OpenACS and is discussed <ulink url="#ini">below</ulink>. Note that pathnames in
    <computeroutput>yourdomain</computeroutput> must use forward slashes rather than the Windows
    back slashes. This is also true for the .ini file.</para>

    <para>The following items must be defined in <computeroutput>yourdomain</computeroutput>:</para>

    <itemizedlist>
      <listitem><para>three database pools: main, subquery, and log. They must be named
      as such. The default pool will be &quot;main&quot;.</para></listitem>

      <listitem><para>the auxconfig directory which contains the .ini file:
      <computeroutput>c:\web\yourdomain\parameters</computeroutput></para></listitem>

      <listitem><para>the pageroot: <computeroutput>c:\web\yourdomain\www</computeroutput></para></listitem>

      <listitem><para>the directory containing the TclLibrary:
      <computeroutput>c:\web\yourdomain\tcl</computeroutput></para></listitem>
    </itemizedlist>

<para>
    You can use <ulink url="/doc/files/winnsd.txt">our template file</ulink> as a starting
    point (<emphasis>you&#39;ll need to save this file with a rather than .txt
    extension</emphasis>). 
</para>
    </sect2>

<sect2 id="wint2install-configure-acs">
<title>Configuring OpenACS itself</title>
<para>
    If you want a system that works, go to
    <computeroutput>c:\web\yourdomain\parameters</computeroutput> and copy <computeroutput>ad.ini</computeroutput> to
    <computeroutput>yourdomain.ini</computeroutput> (<emphasis>or any other name different from
    <computeroutput>ad.ini</computeroutput></emphasis>). You don&#39;t actually have to delete
    <computeroutput>ad.ini</computeroutput>. 
</para>
    <para>Each section of <computeroutput>yourdomain.ini</computeroutput> has a hardcoded
    &quot;yourservername&quot; in the name (e.g.
    <computeroutput>[ns/server/yourservername/acs]</computeroutput>). This means that the OpenACS
    will ignore your configuration settings unless your AOLserver name
    happens to be &quot;yourservername&quot;. Therefore you must go through
    <computeroutput>yourdomain.ini</computeroutput> and change &quot;yourservername&quot; to
    whatever you&#39;re calling this particular AOLserver (<emphasis>look at the
    server name in the <computeroutput>nsd</computeroutput> file for a reference</emphasis>).</para>

    <para>Unless you want pages that advertise a community called
    &quot;Yourdomain Network&quot; owned by
    &quot;webmaster@yourdomain.com&quot;, you&#39;ll probably want to edit
    the text of <computeroutput>yourdomain.ini</computeroutput> to change system-wide parameters.
    If you want to see how some of these are used, a good place to look is
    <computeroutput>c:\web\yourdomain\tcl\ad-defs</computeroutput>. The Tcl function,
    <computeroutput>ad_parameter</computeroutput>, is used to grab parameter values from the .ini
    file.</para>

    </sect2>

<sect2 id="wi2kinstall-starting-service">
<title>Starting the Service</title>
<para>
    Now you&#39;re ready to start things up. Before installing as a Windows
    service, you might want to test the setup for configuration errors. Open
    up a console window and go to <computeroutput>c:\aol30</computeroutput>. Then run 
</para>

<programlisting>
bin\nsd -ft yourdomain.tcl
</programlisting>

   <para> This will print all the AOLserver messages to the console so you can see
    them. 
</para>
    <para>Try to connect to your new server with a web browser. If you see the
    message &quot;Error in serving group pages&quot;, you probably forgot to
    copy the ad.ini file in <computeroutput>c:\web\yourdomain\parameters</computeroutput> If
    everything seems ok, you can kill the server with Control-c and then
    issue the following command to install as a Windows service:</para>

<programlisting>
bin\nsd -I -s yourdomain -t yourdomain.tcl
</programlisting>

   <para> You can now configure error recovery and other Windows aspects of the
    service from the Services control panel. If you make further changes to
    <computeroutput>yourdomain</computeroutput> or <computeroutput>yourdomain.ini</computeroutput> you should stop
    and start the service from the Services control panel. 
</para>
    </sect2>

<sect2 id="win2kinstall-configure-permissions">
<title>Configuring Permissions</title>
<para>
    Now, you need to protect the proper administration directories of the
    OpenACS. You decide the policy although we recommend requiring the admin
    directories be accessible only via an SSL connection. Here are the
    directories to consider protecting: 
</para>
    <itemizedlist>
      <listitem><para>/doc (or at least /doc/sql/ since some AOLserver configurations
      will allow a user to execute SQL files)</para></listitem>

      <listitem><para>/admin</para></listitem>

      <listitem><para>any private admin dirs for a module you might have written that are
      not underneath the /admin directory</para></listitem>
    </itemizedlist>

    </sect2>

<sect2 id="win2kinstall-add-yourself">
<title>Adding Yourself as a User and Making Yourself a Sysadmin</title>
<para>
    OpenACS will define two users: system and
    anonymous. It will also define a user group of system administrators.
    You&#39;ll want to add yourself as a user (at /register/ ) and then add
    yourself as as member of the site-wide administration group. Start by
    logging out as yourself and logging in as the system user (email of
    &quot;system&quot;). Change the system user&#39;s password. Visit the
    <computeroutput>https://yourservername.com/admin/ug/</computeroutput> directory and add your
    personal user as a site-wide administrator. Now you&#39;re bootstrapped! 
</para>
    <para>If you do not know what the system user&#39;s password is connect to
    Oracle using SQL Plus and run the following query:</para>

<programlisting>
select password from users where last_name = &#39;system&#39;;
</programlisting>

    </sect2>

<sect2 id="win2kinstall-closing-down-access">
<title>Closing Down Access</title>
<para>
    The OpenACS ships with a user named &quot;anonymous&quot; (email
    &quot;anonymous&quot;) to serve as a content owner. If you&#39;re
    operating a restricted-access site, make sure to change the anonymous
    user&#39;s password. In recent versions of the OpenACS you cannot log into
    &quot;anonymous&quot; because the account does not have a valid user
    state. Log in as a sysadmin and change the anonymous user&#39;s password
    from <computeroutput>https://yourservername/admin/users</computeroutput>. You should read the
    documentation for <ulink url="user-registration">user registration and
    access control</ulink> and decide what the appropriate user state is for
    anonymous on your site. 
</para>
    </sect2>

<sect2 id="win2kinstall-where-is-what">
<title>Where to Find What</title>
<para>
    A few pointers: 
</para>
    <itemizedlist>
      <listitem><para>the /register directory contains the login and registration
      scripts. You can easily redirect someone to /register/index to have
      them login or register.</para></listitem>

      <listitem><para>the /pvt directory is for user-specific pages. They can only be
      accessed by people who have logged in.</para></listitem>
    </itemizedlist>

    </sect2>

<sect2 id="win2kinstall-make-sure-it-works">
<title>Making sure that it works</title>
<para>
    Run the acceptance tests in <ulink url="/doc/acceptance-test">/doc/acceptance-test</ulink> 
</para>
    </sect2>

<sect2 id="win2kinstall-multiple-acs">
<title>Running Multiple Instances of the OpenACS</title>
<para>
    You can run multiple instances of the OpenACS on a physical machine but they
    must each be set up as a separate Windows service. Each instance of the
    OpenACS must have its own:
</para>
    <itemizedlist>
      <listitem><para>Oracle tablespace and a user account with the appropriate
      permissions on that tablespace. Each of these tablespaces must have the
      OpenACS data model loaded.</para></listitem>

      <listitem><para>file with the appropriate settings including server name,
      auxconfig, ipaddress, and port.</para></listitem>

      <listitem><para>Copy of the acs files in an appropriate directory under
      <computeroutput>c:\web</computeroutput>.</para></listitem>
    </itemizedlist>
<para>    Suppose you wish to run two services: <computeroutput>lintcollectors.com</computeroutput> and
    <computeroutput>iguanasdirect.com</computeroutput>. You would need the following: 
</para>
    <itemizedlist>
      <listitem><para>an Oracle tablespace, <computeroutput>lintcollectors</computeroutput> with a user
      <computeroutput>lintcollectors</computeroutput> and password <computeroutput>secretlint</computeroutput></para></listitem>

      <listitem><para>an Oracle tablespace, <computeroutput>iguanasdirect</computeroutput> with a user
      <computeroutput>iguanasdirect</computeroutput> and password <computeroutput>secretiguanas</computeroutput></para></listitem>
    </itemizedlist>
   <para> For each of these tablespaces/users you would load the OpenACS data model as
    described <ulink url="#data">above</ulink>. Then in <computeroutput>c:\aolserver3_0</computeroutput>
    create files for each service, i.e. <computeroutput>lintcollectors</computeroutput> and
    <computeroutput>iguanasdirect</computeroutput>. These files would point to their respective
    pageroots, <computeroutput>c:\web\lintcollectors\www</computeroutput> and
    <computeroutput>c:\web\iguanasdirect\www</computeroutput>; their respective auxconfigdirs,
    <computeroutput>c:\web\lintcollectors\parameters</computeroutput> and
    <computeroutput>c:\web\iguanasdirect\parameters</computeroutput>; etc. In the respective
    auxconfigdirs would be the files <computeroutput>lintcollectors.ini</computeroutput> and
    <computeroutput>iguanasdirect.ini</computeroutput>. 
</para>
    <para>Now open a console window and go to <computeroutput>c:\aol30</computeroutput>. You&#39;ll
    start up the two services as follows:</para>

<programlisting>
bin\nsd -I -s lintcollectors -t lintcollectors.tcl
bin\nsd -I -s iguanasdirect -t iguanasdirect.tcl
</programlisting>
  
   <para> In the services control panel you should see two services:
    <computeroutput>AOLserver-lintcollectors</computeroutput> and
    <computeroutput>AOLserver-iguanasdirect</computeroutput>. 
    </para>

   

  
<para><phrase role="cvstag">($Id: win2kinstall.xml,v 1.10 2006/07/17 05:38:38 torbenb Exp $)</phrase></para>

</sect2>
</sect1>
