To the Brass 
Cannon Webboard
Established 1986

Kevin Martin - PO Box 82783 - Portland, OR 97282

Application Software

  1. Oracle -
    The dba asks that we install Oracle with $ORACLE_HOME set to /oracle/app/oracle/product/8.1.6 on all systems, whether server or client. [But our hosting site, bless them, installed it into /home/ohome]

    On servers only, update /etc/system to handle Oracle's memory requirements -- shmmax should be equal to total system RAM (1GB in the example below); this is a Solaris thing:

        * Oracle changes 7/5/00:
        set shmsys:shminfo_shmmax=1073741824
        set shmsys:shminfo_shmmin=1
        set shmsys:shminfo_shmmni=100
        set shmsys:shminfo_shmseg=10
        set semsys:seminfo_semmni=2000
        set semsys:seminfo_semmsl=300
        set semsys:seminfo_semmns=1024
        set semsys:seminfo_semopm=100
        set semsys:seminfo_semvmx=32767
        * End Oracle changes
    
    
    You'll need corrected "dbstart" and "dbshut" scripts from the dba for Oracle 8.1.6 -- they are broken as delivered. Once you have installed those, use this pair of /etc/init.d scripts and link them appropriately. That means creating symlinks into rc2.d and rc3.d as S97oracle and S98tns for startup, and into rc0.d, rc1.d, and rcS.d as K20tns and K21oracle for shutdown. The exact numbers aren't really important, only their relative ordering matters -- they will be run in numeric order, and you want Oracle to come up before TNS, and TNS to shut down before Oracle. The rc.x scripts are only run when the machine enters a new run level, so putting a K script into rc2.d will NOT perform the desired clean shutdown!

    To connect to the database (e.g. with sqlplus) the dba must set up

    Run /opt/bin/oraenv -- it should only ask for the value of ORACLE_SID. If it also asks you for ORACLE_HOME, it means the Oracle configuration is incomplete or incorrect.

  2. Weblogic -
    Our clustered weblogic.properties file and startWebLogic script are archived on the administration machine, whorfin. Sample versions available through the links above, but NOTE that these components are under continual revision by the developers. I give examples here so you can recognize them when you see them, but always assume these examples are out of date!

    Update /etc/system:

        * Increase max file descriptors in /etc/system according to
        * http://www.weblogic.com/doc51/platforms/sun/ - KM 7/17/00
        set rlim_fd_max = 4096
        set rlim_fd_cur = 1024  
    	
    

    To connect to Oracle, the db.properties file must be updated with the correct username and password. You may need to use 'find' because it's buried very deeply beneath the /weblogic directory:

        # find /weblogic -name db.properties
    

    For a clustered install, place the weblogic content under "/production/ftcluster".

  3. Apache -
    I'm going to break my own rule here about this being a document of "historical interest only." There are probably a lot of people rebuilding their Apache installs because of the June 2002 "chunking" exploit, and they don't need two-year-old advice. So here's an update -- this is for an upgrade to Apache 1.3.26, with PHP and SSL as modules.

    Because we're doing this to fix the "chunk" exploit, we only want to rebuild as little as we have to. These instructions cover the new Apache, mod_ssl, and PHP. That's assuming you need SSL support.

    Other Assumptions:

    Okay, let's dive in. The order of the steps below is critical.

    1. Build and install the mm (shared memory) module with
         ./configure --prefix=/usr/local/mm; make; make install
      

      8/30/02 -- If you're trying to compile specifically for Solaris, and getting all sorts of errors that seem to be centered around the mm package, get yourself a 3.x version of gcc and start over! The new gcc package at sunfreeware.com is a godsend.

    2. gunzip and untar all the new parts so they are at the same level under a sensible directory such as /usr/local/src. A lot of the packages assume they can refer to ../otherpackage, so try to make that possible by keeping them at the same "depth" in the tree. Once they're all unpacked, I like to use a trick that the Linux kernel people use -- let's assign a symbolic link for each version-numbered directory:
         ln -s /usr/local/src/apache_1.3.26  /usr/local/src/apache
         ln -s /usr/local/src/mod_ssl-2.8.9-1.3.26  /usr/local/src/mod_ssl
         ln -s /usr/local/src/php-4.1.2  /usr/local/src/php
      
      This will save a little typing and a lot of hassle, since we no longer have to type all the hyphens and underscores and dots perfectly.

    3. Existing SSL certs

      Find them (the path to them is in the existing Apache's httpd.conf) and copy them to the new Apache SOURCE tree. See next step.

    4. mod_ssl

      mod_ssl is a glue module that connects Apache to openssl. I'm assuming you've already built openssl (e.g. openssl-0.9.6g) -- if not, and if the client is using SSL, DO THAT FIRST.

      The order is important because this configure step puts source into the Apache tree (so it will be built when we build Apache), and it also "patches" the existing Apache source.

      
         cd /usr/local/src/mod_ssl  # Taking advantage of our symlinks!
      
         ./configure \
          --with-apache=../apache \
          --with-crt=/usr/local/apache/conf/ssl.crt/www.mydomain.com.crt \
          --with-key=/usr/local/apache/conf/ssl.key/www.mydomain.com.key 
      
    5. Apache

      PHP demands that you use apxs, a Perl-based Apache utility, in order to configure it as a DSO (dynamic module). But apxs doesn't exist until you build Apache... so you have to build Apache and tell it to take it on faith that libphp4.so *will* exist when it is needed.

      Notice that we're telling Apache where to find openssl, NOT mod_ssl. Also notice that we are using the "Apache" layout. This should put the compiled httpd into /usr/local/apache/bin -- make sure this is not where your production httpd is currently running! If it is, you'll need to change the "layout" just enough to put your new httpd into a version-number directory. (Again, I'd do this the same way Linux handles its kernel: build into /usr/local/apache_1.3.26, then make /usr/local/apache a symlink to that directory. It's sweet for the next time you need to upgrade!)

      Note that this should create the apxs binary which we will need in the next step.

         cd /usr/local/src/apache
      

      DO NOT 'enable-modules' that you do not want compiled in! If you're going to load them as DSO's, they don't belong in the configure command.

         EAPI_MM="/usr/local/mm" \
         SSL_BASE="../openssl" \
         ./configure \
         --with-layout=Apache \
         --prefix=/usr/local/apache \
         --enable-module=so \
         --enable-rule=EAPI \
         --enable-module=rewrite \
         --enable-module=ssl \
         --enable-shared=max \
         --enable-shared=ssl \
         --enable-shared=rewrite \
         --disable-rule=SSL_COMPAT \
         --enable-rule=SSL_SDBM \
         --enable-rule=SSL_EXPERIMENTAL \
         --enable-rule=SSL_VENDOR 
      

      Note that we're defining a couple of variables (EAPI_MM and SSL_BASE) as part of the same process as our .configure command. That is, we are entering all of that stuff as one long logical line. The continuation character, "\", is important. Don't leave it out.

      If all goes well, then:

      
         make
      
      

      In the 1.3.26 version of Apache I ran into some old library-related problems that came back even though they had been fixed in the versions immediately prior. There is clearly a -L pointing to /usr/local/mm/lib, yet the compile and link of "gen_test_char" doesn't see it. Why? I don't know. Being a pragmatist, I fixed it by creating a symlink:

         ln -s /usr/local/mm/lib/libmm.so.12  /usr/lib/libmm.so.12
      
      

      If you try to build the mod_auth_mysql module you'll hit another couple of snags -- the first is a complaint about "No rule to make target `../../include/alloc.h'". It's already there, but as "ap_alloc.h". You can solve it by copying it:

         cp ap_alloc.h  alloc.h
      

      (I tried just making a symlink, but Apache's 'make install' copies the include library (.h) files for future use -- and that copy step doesn't like symlinks.)

      The second problem is more serious; including mysqlclient.a will blow up your build because someone forgot to add two required libraries to the Makefile. See markround.com for one solution. (I'm grateful for Mark's help in finally beating this problem.) The symptom, for those of you using Google, is unresolved references to "floor, compress, and uncompress." The first comes from the math library, the latter two from zlib. The fix is to edit Apache's "src/Makefile" to insert these two link libraries, -lm and -lz, like so (-l is a hyphen and a lowercase letter 'L'):

         LIBS1= -L/usr/local/mysql/lib -lmysqlclient -lm -lz -lcrypt [and so forth]
      

      At least, that's supposed to do it. I found that just adding them isn't enough -- it also matters that you put them after -lmysqlclient rather than in front of it.

      This may not be related, but I recently encountered an issue trying to add Perl's DBD::mysql package to my CPAN toolkit. Even though it did include -lz it still wouldn't build until I symlinked libz.so.1 to create a "/usr/lib/libz.so" with no number. Perhaps doing that helped the problem above as well...? Figured I'd better include it as a tip, just in case.

      Whew! If the sucker finally builds, you can test a few things at this point by running "src/httpd -l" (shows the compiled-in modules; there should be very few) and "src/httpd -t" (see that it likes your httpd.conf file). If it's OK, the next step is:

         make install
      
    6. PHP (or ColdFusion... in fact, almost anything that says it uses apxs)
      
         cd /usr/local/src/php
      
         ./configure --prefix=/usr/local/php \
          --with-mysql=/usr/local/mysql \
          --with-EAPI \
          --with-config-file-path=/usr/local/src/php \
          --with-apxs=/usr/local/apache/bin/apxs \
          --enable-track-vars
      
         make
         make install
      
      

      This "make install" step puts libphp4.so into the Apache libexec subdirectory - check that it's there.

      You do NOT want the static libphp4.a module, so don't use the "activate-module" version of the configure command.

    7. Test the new httpd against the old httpd.conf. If it doesn't see the PHP or SSL module, you'll need to merge the httpd.conf created by the install with the client copy. The old httpd.conf probably has all the complex virtual host stuff in it, so back it up and update it carefully in the NEW httpd.conf directory.
      
         /usr/local/apache/bin/httpd -t  # assumes /usr/local/apache/conf
                                         # as the location of httpd.conf
      

      Did you get a "Syntax OK"? Give it a try. If not, figure out why. It's pretty good about telling you where it hurts.

    8. See if it serves pages!
      
         cd /usr/local/apache-1.3.24/bin  # the old or production Apache
         # Stop the old Apache, wait a few seconds for things to wind down... 
         ./apachectl stop
         cd /usr/local/apache/bin
         ./apachectl startssl    # or just "start" if they don't use SSL
      

      Tip: Cut and paste the SSL passphrase somewhere on screen so you can enter it correctly and quickly!

      CHECK, CHECK, CHECK! Does it answer on :80? :443? Be prepared to bring the old one back up if the new one doesn't start!!!


    Okay, at this point we go back to the old notes from Fall 2000...

    As with much software in the LAMP (Linux Apache MySQL PHP) family, you start an Apache "build" by running a script called "configure". It figures out your operating system and which C compiler you have, among other things. It's quite clever, actually. Each time you run the Apache configure command, it saves the parameter values you gave it as a file called "config.status"; running that as a shell script will recreate the last run of the "./configure" command. Of course if you are running it for the first time, you have to provide those parameters yourself. Here's my own (heavily customized) layout:

    
        # ./configure --prefix=/opt/apache \
    	--sysconfdir=/httpd/conf \
    	--enable-rule=SHARED_CORE \
    	--enable-module=most \
    	--enable-shared=max \
    	--htdocsdir=/httpd/htdocs \
    	--localstatedir=/var/lock/apache \
    	--logfiledir=/var/log/apache \
    	--cgidir=/httpd/cgi-bin \
    	--runtimedir=/var/lock/apache \
    	--proxycachedir=/var/lock/apache
    
    
    To upgrade to a new version of Apache, I should be able to take "config.status", copy it to the new source directory, and run it there as a shell script to recreate my prior configuration. Very handy!

    After running ./configure, you'll need to do a 'make' and 'make install':

        # make
        # make install
    
    
  4. PHP -
    PHP is a lightweight application language; think of it as an alternative to JSP.

    We updated to 4.0.3 on 10/12/2000 due to an announcement in Bugtraq of a "format string" compromise (this is a generic C-library issue which has affected many applications in Q3 2000, not just PHP). To unpack it:

        # cd /opt/src
        # cp php-4.0.3.tar.gz .
        # gunzip php-4.0.3.tar.gz
        # cd ..
        # tar xf src/php-4.0.3.tar
        # cd /opt/php-4.0.3
    
    
    Then configure it -- you must define ORACLE_HOME for the OCI_8 database interface to work. These configuration instructions are saved in the source directory as an executable file named "DO_CONFIG":
        ORACLE_HOME=/oracle/app/oracle/product/8.1.6 ; export ORACLE_HOME
        ./configure --with-config-file-path=/opt/php \
         --with-oci8 --with-apxs=/opt/apache/bin/apxs \
         --with-config-file=/opt/apache/conf \
         --enable-track-vars \
         --enable-sigchild \
         --without-mysql
    
    Then do a 'make' and 'make install' as usual.

    You'll need to copy /opt/php-4.0.3/.libs/libphp4.so to /opt/apache/libexec and enable it by making the recommended changes to /httpd/conf/httpd.conf (see the php INSTALL document for details - it's in the php-4.0.3 directory).

  5. Content ownership and permissions -
    To fix the file and directory permissions, run these three commands as root:
    chown -R nobody:web /httpd
    find /httpd -type f | xargs -i chmod 664 {}
    find /httpd -type d | xargs -i chmod 775 {}
    
    If you want to be fancy about it, here's a script that provides a minimal sanity check:
    #!/bin/sh
    if [ -d /httpd/htdocs ] ; then
    	cd /httpd
    else
    	echo Cannot find docroot
    	exit 2
    fi
    chown -R nobody:web /httpd 
    find /httpd -type f | xargs -i chmod 664 {}
    find /httpd -type d | xargs -i chmod 775 {}
    

  6. AltaVista Search Engine (AVS) proxy -
    AltaVista provided source for an Apache module which will let it 'proxy' requests to their mhttpd engine, which runs on a separate port (9000 by default, we changed it to 8999 in production because 9000 was being used by the Webload performance testing engine). The proxy allows us to put a 'search' button on our main content page and NOT open the AltaVista port in the firewall -- all AltaVista activity goes through the regular Apache port instead. As far as any outside browser is concerned, the search seems to be happening on www.oursite.com.

    The source for the Apache proxy is on whorfin in "/opt/src/avsproxy". The compiled avsproxy.so module is copied to /opt/apache/libexec as usual. We encountered one problem which turned out to be due to a bad switch in the AltaVista Makefile; the symptom is a conflict with PHP that gives a "relocation error" message at runtime. To fix it, just remove the "-lc" switch from the avsproxy Makefile and rebuild avsproxy.so (this keeps it from trying to install the libc library twice).

    AltaVista's own instructions for incorporating the module into Apache are here.

  7. AltaVista Search Engine 3.0 -
    We have a CD and we also have a tarball - the CD is apparently pre-licensed, but the tarball is easier to handle and you enter the license information into it after installing.

    Once installed and started, you manage the product by accessing the "Management User Interface" or MUI. It's a java application running on a high port (default is 9000, but we're using 8999 in production).

    Be warned that the default install is configured to write logs into the install directory, and it leaves far too many files as WORLD-WRITEABLE. I tightened up the file permissions and moved the logs to /log/av by editing the file /app/AVSearchEngine30/httpd/config. When I finished, running "./avsetup -s" would no longer start the engine, but "./bin/startController" would, and the 'restart' button on the MUI still works. You must restart the engine after any changes, including changes to the static html templates; it caches all of the templates.

    A very odd thing: the way AltaVista has set up their scripts, you must be logged into the "AVSearchEngine30" directory, not in the bin directory below it. "cd bin ; ./startController" will not work.

    We're running the engine on production-4, owned by root but running as daemon; an attempt to install it on production-16 just plain didn't work, even when the colo admin tried to start it as root (it wants to run as daemon, regardless of who owns the binary).

    Styling of the results page to match the rest of the site was done "by hand" in the subdirectories beneath /app/AVSearchEngine30/httpd/avshe_languages/search, using the html guide provided by AltaVista. To make a long story short, [a designer] provided code for a complete sample "results" page, and I hacked it apart into the sections used by AltaVista.

    Longer version: The output page is made up of multiple parts: init, preamble, form, results, postamble. Each of those parts resides in its own subdirectory. I found it helpful to insert comments into each section to help figure out which of the parts needed to be the target of a specific change. Use your browser's "View Source" feature! And don't forget that you have to do a restart on the engine after each change, or else you won't see any effect.

    These files have to be edited in order to move the product to a different machine (assuming /app/AVSearchEngine30 is the working directory):

    Warning: Running the "./avsetup -i" script will undo all the changes you made to the files above, unless you first update its template file. It will copy the contents of that template over your production files! Better yet, just don't run avsetup. Ever.

    We have to use the MUI to configure indexes and update the database used by the search engine. I use port-tunneling provided by ttssh to forward my local ports to production-4. This means we did not open any ports in the firewall.

    On main (sabre), Apache allows proxy access to the MUI, but it uses an .htaccess file. If you go to sabre's port 9000 directly, the .htaccess restriction does not apply; it only affects you when you use the proxy provided by Apache. (http://main.oursite.com:1080/mui/mui.html) When you use port 9000, you are talking directly to AltaVista's mhttpd engine, not to Apache.

    In order to have separate indexes (e.g. JK Lasser, Breaking News, TaxPlanet Guide), we have to figure out the exact case-sensitive name we want to use, and when creating the index we have to do an "path_reject" for every link on the page that we do NOT want in that index. AltaVista is very crafty about finding links that you have not specifically excluded! The link that you DO want to index goes at the bottom of the list as a "path_include". (Follow the link to see a screen shot).

    The standard I'm following for indexes and their associated collectors looks like this:
    <index name><collector name>
    BreakingNewsnews
    LasserLasser
    TaxPlanettaxplanet
    EntireSiteallFTP

  8. JServ for Apache -
    We are NOT using JServ -- we did experiment with the Tomcat JSP engine, but now we've converted all our content-site jsp to php instead. The install info for JServ and Tomcat has been archived "just in case."

  9. Netscape -
    The admin password is in /opt/netscape/admin-serv/config/admpw - For example:
        admin:{SHA}C3LGQO8rAU6F5t7JwkJ6YILkMLM=
    
    This contains a SHA-encrypted password for user "admin". Replace it with this line to leave the same user with a null password:
        admin:
    
  10. iPlanet -
    Just like Netscape 3.6 only different. :-) Standard install per the instructions. Edit magnus.conf to fix the broken path to access_log and obj.conf to do the same for error_log (yes, two different config files; that tells you all you need to know about the inmates who are running the Netscape asylum).

    The Weblogic hooks go into obj.conf, and you need to make a 'text/jsp' MIME type for the .jsp file extension.

  11. Webtrends -
    Log analysis package. Nothing unusual here; the install script wants you to be root, but you can edit around that and run it on a high port (above 1024). Have root put the "wters" script into /etc/init.d to start and stop it.

    Interesting feature: It uses the Unix password file to authenticate users. At install time you specify an administrative user who has a shell account, and then that user can add other accounts (who also have valid usernames) through the Web-based GUI.

    Note: It should be able to analyze access logs from all our products including Apache, Netscape, Weblogic, and even AltaVista. It does NOT analyze error logs, however. Why not? Because error logs are allowed to have arbitrary text, whereas access logs have a common layout.

  12. Lyris -
    Mailing list manager. Lyris tech support will tell you it HAS to be installed as root. They lie. (OK, to be fair: incoming mail does arrive on a low port, which can only be assigned by root. We got around that by having our firewalls remap port 25 to a high port -- actually a double translation, Lyris being behind two layers of firewalls).

Back: Utility Software   -   Next: Content Management

Please Note

If a search engine dropped you directly into this document, you should go to the index page to find out what you're reading. This document is a record of a project from 1999-2000 -- it is not a current guide to installing any software product.