Home Get Informed Blogs 2007-01 Dwayne Lee: Setting Up TWiki with Cool Stack

Dwayne Lee: Setting Up TWiki with Cool Stack

PDF Print E-mail
Written by Dwayne Lee   
Wednesday, 17 January 2007 02:22
Here's my little guide (maybe not so little) to help with setting up TWiki on a Sun Fire T2000 running Solaris 10. I started with the Cool Stack but quickly found that I needed a few other pieces of software to get everything working properly. I also wanted LDAP support which wasn't enabled in Cool Stack. All of these software packages always have new releases, I provided version number just for reference. Please send me feedback, I'm sure some of this isn't as clear as it can be.
    Here's my little guide (maybe not so little) to help with setting up TWiki on a Sun Fire T2000 running Solaris 10. I started with the Cool Stack but quickly found that I needed a few other pieces of software to get everything working properly. I also wanted LDAP support which wasn't enabled in Cool Stack. All of these software packages always have new releases, I provided version number just for reference. Please send me feedback, I'm sure some of this isn't as clear as it can be.
    1. Setup Solaris 10 11/06 (or update 3, I'll cover this in a seperate entry) and install CoolTuner which will keep your Sun Fire T1000 or T2000 updated with the latest tunning parameters and patches.
    2. Install the Sun Studio 11 compilers. Grab them from here. Definitely get the latest compilers, every version of Sun Studio has improvements. Make sure you also have the latest patches for the compilers too.
    3. We also need a few additional pieces of software to support TWiki. The additional software pieces are:
      • rcs-5.7
      • patch-2.5.4
      • diffutils-2.8.1
      • grep-2.5.1a
      • make-3.81
      Download and untar each of the above packages and use the following commands to build. The compiler flags provide a very good level of optimization and we want the install to be placed in /usr/local. Make sure that the Sun Studio 11 compilers and /usr/local/bin are in your path first.
       CFLAGS="-xO4 -xtarget=generic" ./configure --prefix=/usr/local

      make

      make install

    4. Install CSQamp, CSQperl packages from Cool Stack. Cool Stack installs into /usr/local.
    5. I found that the CSQperl needed a number of extensions added to it. CSQperl is based on Perl 5.8.8. Here's are the key parameters need edwhen you run Configure. Use the defaults in most cases.
      Invoked as:  CFLAGS="-xO4 -xtarget=generic" ./Configure

      Use dynamic libraries

      Make libperl dynamic

      Use these flags: -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DPERL_USE_SAFE_PUTENV

      Use this library path: /lib /usr/lib

      Use these optimization flags: -x04 -xtarget=generic

      Here are the perl extensions to add. I used cpan to grab and build the additional extensions, it much easier this way since it understands dependences on other extensions and will grab and build those too.
      CFLAGS="-xO4 -xtarget=generic" /usr/local/bin/cpan





      install Bundle::CPAN

      PathTools 3.24 <==== those are the dependences

      Compress-Zlib-2.001

      Archive-Tar 1.30

      Net-Telnet 3.03

      TermReadKey 2.30

      TermReadLine-Perl 1.0302

      CPAN-WAIT 0.27

      CPAN 1.8802

      IO-Zlib 1.04

      IO-Compress-Zlib 2.001

      Compress-Raw-Zlib 2.001



      install libwww-perl 5.805

      URI 1.35

      HTML-Parser 3.55



      install Digest::SHA1 2.11

      install CGI::Session 4.20



      install NET::LDAP perl-ldap 0.33

      Convert-ASN1 0.20



      install Unicore::MapUTF8

      Unicore-MapUTF8 1.11

      Unicore-Map8 0.12

      Unicore-String 2.09

      Jcode 2.06

    6. Next we need to build OpenLDAP, I built version 2.3.27 but there is going to be newer versions.
       export CPPFLAGS="-I/usr/sfw/include"; export LDFLAGS="-L/usr/sfw/lib"; \

      export CFLAGS="-xO4 -xtarget=generic -D_AVL_H"

      ./configure --prefix=/usr/local \

      --sysconfdir=/etc/openldap \

      --with-openssl=/usr/sfw \

      --with-tls \

      --disable-slurpd \

      --disable-slapd

      make depend

      make

      make install

    7. Now Apache will need to be rebuild to include support for LDAP. The following is based on how CSQamp builds apache and I've added the additional options to build LDAP support with OpenLDAP.
       CFLAGS='-DSSL_EXPERIMENTAL -DSSL_ENGINE -xO4 -xtarget=generic' \

      CPPFLAGS="-I/usr/local/include" \

      LDFLAGS="-R/usr/local/lib -R/usr/sfw/lib -L/usr/local/lib -L/usr/sfw/lib" \

      ./configure --prefix=/usr/local/apache2 \

      --enable-mods-shared=all \

      --enable-cache \

      --enable-mem-cache \

      --enable-ssl \

      --with-mpm=prefork \

      --enable-so \

      --enable-suexec \

      --enable-rule=SSL_EXPERIMENTAL \

      --with-ssl=/usr/sfw \

      --enable-ldap \

      --enable-auth_ldap \

      --with-ldap \

      --with-ldap-dir=/usr/local \

      --with-ldap-include=/usr/local/include \

      --with-ldap-lib=/usr/local/lib

      make

      make install

    8. The package libiconv, libxml, php and mysql that are included in Cool Stack are included in CSQamp, don't need to be re-compiled but if you want here are the commands:
      • libiconv 1.9.2
         CFLAGS="-xO4 -xtarget=generic" ./configure

      • libxml2 2.6.26
         CFLAGS="-xO4 -xtarget=generic" ./configure

      • mysql 32-bit which is included in CSQamp
         CXXFLAGS="-xO4 -mt"

        export CXXFLAGS

        CFLAGS="-xO4 -mt -fsimple=1 -ftrap=%none -xbuiltin=%all -xlibmil -xlibmopt \

        -xstrconst -xchip=generic" ./configure --prefix=/usr/local/mysql_32bit \

        -localstatedir=/usr/local/mysql_32bit/data \

        --libexecdir=/usr/local/mysql_32bit/bin \

        --with-extra-charsets=complex --with-server-suffix=-standard \

        --with-archive-storage-engine --with-innodb --enable-shared --with-readline \

        --enable-thread-safe-client --enable-local-infile --with-named-z-libs=no \

        --with-big-tables --without-server

      • mysql 64-bit which is included in CSQmysql
         CXXFLAGS="-xO4 -noex -mt -fsimple=1 -ftrap=%none -xbuiltin=%all -xlibmil -xlibmo pt \

        -xarch=v9"

        export CXXFLAGS

        CFLAGS="-xO4 -mt -fsimple=1 -ftrap=%none -xbuiltin=%all -xlibmil -xlibmopt \

        -xstrconst -xarch=v9" ./configure --prefix=/usr/local/mysql \

        --libexecdir=/usr/local/mysql/bin --with-extra-charsets=complex \

        --with-server-suffix=-standard --with-archive-storage-engine --with-innodb \

        --enable-shared --with-readline --enable-thread-safe-client --enable-local-infile \

        --with-named-z-libs=no --with-big-tables --without-server

      • php_fastcgi 5.1.4 - PHP with fastcgi enabled for Apache
         CFLAGS='-xO4 -xtarget=generic ' \

        ./configure --prefix=/usr/local/php5_fastcgi \

        --enable-memory-limit --disable-all \

        --with-libxml-dir=shared,/usr/local --enable-fastcgi --enable-spl --with-pcre-regex \

        --enable-session --enable-shmop --enable-pear --enable-sysvshm --enable-sysvmsg \

        --with-dom --enable-dom --enable-simplexml --enable-sysvsem --enable-sockets \

        --enable-spl --with-pear --enable-xml --enable-libxml --disable-ipv6 \

        --with-iconv-dir=/usr/local --with-mysql=shared,/usr/local/mysql_32bit \

        --with-mysqli=shared,/usr/local/mysql_32bit/bin/mysql_config \

        --with-openssl=shared,/usr/sfw

      • php 5.1.4 w/o fastcgi for standalone install
         CFLAGS='-KPIC -xO4 -xtarget=generic ' \

        ./configure --prefix=/usr/local/php5 \

        --with-apxs2=/usr/local/apache2/bin/apxs --enable-memory-limit --disable-all \

        --with-libxml-dir=shared,/usr/local --with-dom --enable-dom --enable-spl \

        --enable-simplexml --with-pcre-regex --enable-session \

        --enable-shmop --enable-pear --enable-sysvshm --enable-sysvmsg \

        --enable-sysvsem --enable-sockets --enable-spl --with-pear \

        --enable-xml --enable-libxml --disable-ipv6 \

        --with-iconv-dir=/usr/local --with-mysql=shared,/usr/local/mysql_32bit \

        --with-mysqli=shared,/usr/local/mysql_32bit/bin/mysql_config \

        --with-openssl=shared,/usr/sfw

      • APC 3.0.11
         /usr/local/php/bin/phpize

        CFLAGS="-xO4 -xtarget=generic" \

        /bin/php-config --enable-apc-mmap --enable-apc-sem



        The following line should be used for the standalone php in CSQphp package

        CFLAGS="-xO4 -xtarget=generic" \

        ./configure --enable-apc --with-php-config=/usr/local/php5_fastcgi/bin/php-config \

        --enable-apc-mmap --enable-apc-sem

      • mod_perl 2.0.2
         CFLAGS="-xO4 -xtarget=generic" \

        perl Makefile.PL MP_APXS=/usr/local/apache2/bin/apxs --with-mysql

      • jakarta-tomcat-connectors-1.2.15
         CFLAGS="-xO4 -xtarget=generic" \

        ./configure --with-apxs=/usr/local/apache2/bin/apxs \

        --with-java-home=/usr/java --prefix=/usr/local/jk12

    9. Apache adds There are lots of parameters that can be placed into the httpd.conf file and I will not go through them all since it really depends on your specific setup. Here are a few essential ones.
       Add LoadModules for mod_perl and mod_ldap

      LoadModule perl_module modules/mod_perl.so

      LoadModule ldap_module modules/mod_ldap.so

      LoadModule auth_ldap_module modules/mod_auth_ldap.so



      Add parameters for mod_ldap

      LDAPSharedCacheSize 200000

      LDAPCacheEntries 1024

      LDAPCacheTTL 600

      LDAPOpCacheEntries 1024

      LDAPOpCacheTTL 600



      Add authentication for the twiki/bin directory

      Directory "{path to twiki install}/twiki/bin/">

      AllowOverride All

      Allow From All

      Options ExecCGI

      SetHandler cgi-script



      AuthType Basic

      AuthName "LDAP Login"

      AuthLDAPURL ldap://{server}:389/ou=people,dc=sun,dc=com?uid

      < / Directory>

    10. TWiki can be installed into the docroot root and here are a few things to add.
       edit all files in /bin to use /usr/local/bin/perl

      add lib/LocalSite.cfg

      add bin/LocalLib.cfg

      add bin/.htaccess

      add twiki/tools/mod_perl_starutp.pl from http://twiki.org/cgi-bin/view/Codev/ModPerlUnix

      when runnin configure for TWiki make sure to everything is clean, no error or warnings.



      Three essential plugins are:

      LdapContrb

      LdapNgPlugin

      NewUserPlugin



      Some other additional TWiki plugins I've found useful and the perl extensions that will be needed.

      ActionTrackerPlugin

      Time::ParseDate

      Time-modules-2006.0814

      CalendarPlugin

      Date::Calc

      Date-Calc-5.4

      Bit::Vector

      Bit-Vector-6.4

      Carp::Clan

      Carp-Clan-5.8

      HTML::CalendarMonthSimple

      HTML-CalendarMonthSimple-1.25

      EditInTablePlugin

      ImageGalleryPlugin

      LinkOptionsPlugin

      RedirectPlugin


      Read original article: http://blogs.sun.com/dwaynelee/entry/setting_up_twiki_with_cool1.

     
    online pokies aussie South Africa bonus