Customizing DocDB

  1. Login to the document database account.
    This account is used to administer the various DocDB scripts and html pages.
  2. Checkout DocDB from CVS as described in the previous page if you haven't already.
  3. cd to DocDB/cgi
    1. cp
    2. cp
    3. cp
    4. cp ProjectHelp.xml.template ProjectHelp.xml
    5. Edit the global variables in You can also look at and put new values for those variables in
    6. Customized web page headers and footers are defined in
    7. If you need a customized keyword message, edit
    8. If you need customized help instructions, edit ProjectHelp.xml
  4. Check the files in DocDB/html.
  5. copy the files in DocDB/cgi to $script_root (your private DocDB cgi directory)
    $script_root is defined in, it is not an actual environmental variable. (If you installed from the CVS repository, you can use the command cvs update to update the running software here.)
  6. If you are using HTTP Basic Authorization, create a .htaccess file in $script_root. If you are using client certificate authorization, you can skip this step.
    Here is a sample .htaccess file:
           AuthType Basic
           AuthName "My Document Database"
           AuthUserFile  /somedir/somedir/.htpasswd
           < Limit GET POST >
           require valid-user
           < /Limit >
    The .htpasswd file should not be in any web-accessable directory. Also, the POST option must be present or DocDB will not work (most of the form posts to cgi scripts will fail).
  7. Setup the documentation and Cascading Style Sheets with the command
    cp -r DocDB/html $file_root/Static
    where $file_root is defined in
  8. Set permissions on $file_root.
  9. Create the public access scripts. The suggested way to do this is to create a directory where the relevant scripts (some scripts have no valid public use) are links to the corresponding private scripts. In this configuration, two additional files must be present in the public area: and
    1. mkdir /www/cgi-bin/public/DocDB/, chosing an appropriate directory for the public scripts.
    2. cp DocDB/scripts/PublicInstall.csh /www/cgi-bin/public/DocDB/.
    3. cp DocDB/cgi/ /www/cgi-bin/public/DocDB/.
      This script will make links to the private DocDB cgi area. Edit this script as necessary.
    4. Execute PublicInstall.csh.
    5. rm PublicInstall.csh
    6. Edit the public, taking particular care to be sure these definitions point ONLY to the public directories. Be sure to remove the $Administrator definition from the public Uncomment the "Public" lines in
    7. Copy from the scripts/ directory and edit it to point at your main installation. This is needed to pick up the DocDB .pm files.
    8. Edit your Apache httpd.conf file and make sure FollowSymLinks is added to the Options for this directory.
  10. mysql SomeDocDB -u docdbadm -p < DocDB/sql/CreateDatabase.SQL
  11. If you are using client certificate based authorization:
    1. Edit the apache config files to require a client certificate for the $cgi_root/$web_root directory. (See SSL and DocDB for an explanation of this.)
    2. Make sure the client certificates you are using are from a CA you trust.
    3. As the administrator, import your certificate into your web browser if you haven't done so.
    4. Point your web browser at $web_root/DocumentDatabase. Follow the link to request access and request access in the docdbadm (or DocDBAdm) group and whatever other groups you would like to access.
    5. Now you have to verify that you are an administrator. The easiest way to do this is to start mysql in shell mode (mysql -h xxxx -u docdbadm -p SomeDocDB), then do the following:
      mysql> select EmailUserID,Name from EmailUser;
      and find the EmailUserID of the desired administrator (should be "1" unless you've done something strange).
      mysql> update EmailUser set Verified=1 where EmailUserID=x;
      where "x" is the number from the previous step (1).
    6. Again, point your web browser at $web_root/DocumentDatabase. You should no longer see a message indicating that you are need to request access. If you follow the "Create or Change Documents..." link, you should have access to all adminstration functions.
  12. At this point, you can verify that DocDB is running properly. Point your web browser at $web_root/DocumentDatabase and log in as administrator if necessary. From here you can follow the "Create or Change Documents..." link, where you should have access to all adminstrative functions. Use the administrator functions to create topics, authors, other security groups, etc.
  13. mkdir $file_root/Static/Lists
  14. mkdir $file_root/Static/Lists/group-name for every permission group defined in DocDB.
  15. Setup the listing and notification cron jobs
  16. Customize CSS files:
    The appearance of many pages in DocDB is controlled by CSS (Cascading Style Sheets). The .css files reside in $file_root/Static/css. The naming scheme is as follows:
    DocDB.css The CSS file with global and common settings for all pages.
    DocDB_IE.css Changes to the master setting for Internet Explorer, which has broken CSS support.
    DocDBSomeScript.css CSS unique to a particular page
    DocDBSomeScript_IE.css Changes to the CSS for a page needed by IE
    To any of these scripts you can make your own changes. Append MyProject to the original name of the CSS file and it will be included after the DocDB defaults, changing any settings. MyProject is what you set $ShortProject to in For example, if your project is "Joe" and you want to change the settings for the IE only CSS for the ShowDocument page, create a file JoeDocDBShowDocument_IE.css and place it in the $file_root/Static/css directory.

    See html/css/ProjectDocDB.css.example for examples of what might be changed. Note that not all pages have CSS files and that at this time, and that use of CSS in DocDB is new but expanding.

DocDB License