How to install OpenDocMan on FreeBSD

This article was written for OpenDocMan head 2012-01-01 and FreeBSD 8.2

Pre-Requisites

 * Basic FreeBSD server with configured PHP web application stack. See How to build a FreeBSD server, the following references may also be useful:
 * The FreeBSD Handbook by the FreeBSD Project ("The Handbook"),
 * Bulding a Server with FreeBSD 7 by Bryan Hong ("Hong"),
 * Absolute FreeBSD by Michael Lucas ("Lucas"),

Install Procedure

 * Clone the OpenDocMan repository:


 * 1) cd /usr/local/www/
 * 2) [svn|git|hg} ....


 * Review /usr/local/www/opendocman/docs/opendocman.txt


 * Modify permissions on the install directory hierarchy to give system administrators write access to files without needing to login as root (assuming they are members of group www).  Modifying permissions will likely mess up Mercurial!
 * Set the owner:group of /usr/local/www/opendocman/... to www:www
 * Set permissions on the files in the directory hierarchy to read-write for owner and group and no permission for others
 * Set permissions on the directory hierarchy to read-write-execute for owner and group, and no permission for others


 * 1) chown -R www:www /usr/local/www/opendocman
 * 2) chmod -R 660 /usr/local/www/opendocman
 * 3) chmod -R a+X /usr/local/www/opendocman


 * Create a repository directory for OpenDocMan and modify its permissions so OpenDocMan has write access


 * 1) mkdir /usr/local/www/opendocman_data
 * 2) chown www:www /usr/local/www/opendocman_data
 * 3) chmod 660 /usr/local/www/opendocman_data
 * 4) chmod a+X /usr/local/www/opendocman_data


 * Create an OpenDocMan Apache configuration file /usr/local/etc/apache22/Includes/opendocman.conf (read by Apache during start up)

Alias /opendocman /usr/local/www/opendocman/ AcceptPathInfo On  AllowOverride None Order Allow,Deny Allow from all 


 * Restart Apache so it reads new or edited config files


 * 1) /usr/local/etc/rc.d/apache22 restart


 * Copy the sample OpenDocMan configuration file /usr/local/www/opendocman/config_local_php.sample to /usr/local/www/opendocman/config_local.php and edit config_local.php as needed.
 * it is to be determined if using treeview is beneficial
 * add the OpenOffice.org v3 text file format to the allowed file types

$GLOBALS['database'] = 'opendocman'; // Enter the name of the database here $GLOBALS['user'] = 'opendocman'; // Enter the username for the database $GLOBALS['pass'] = 'opendocman_mysql_password'; // Enter the password for the username $GLOBALS['hostname'] = 'localhost'; // Enter the hostname that is serving the database $GLOBALS['CONFIG']['base_url'] = 'http://www.scc.com/opendocman'; $GLOBALS['CONFIG']['title'] = 'Maestro Document Repository'; $GLOBALS['CONFIG']['site_mail'] = 'mnestor@dalescott.net'; $GLOBALS['CONFIG']['dataDir'] = '/usr/local/www/opendocman_data/'; $GLOBALS['CONFIG']['treeview'] = 'Off'; $GLOBALS['CONFIG']['allow_signup'] = 'Off'; $GLOBALS['allowedFileTypes'] = array(...snip...,'application/vnd.oasis.opendocument.text');


 * Create the SCC database with appropriate privileges using the MySQL command line tool (the database name cannot contain a hyphen or other special character, and for consistency with other Maestro component projects should be in lower-case only).

> mysql -u root -p Enter password: mysql> use mysql; mysql> create database opendocman; mysql> grant select,insert,update,delete,create on opendocman.* to opendocman@localhost identified by 'opendocman_mysql_password'; mysql> flush privileges; mysql> exit; >


 * Configure the database using the provided sql script

> mysql -u opendocman -p opendocman < /usr/local/www/opendocman/database.sql Enter password: >


 * Verify basic functionality and change the default admin password
 * Use a web browser to access the OpenDocMan URL (e.g., http://www.scc.com/opendocman/).
 * Login with username admin with no password.
 * Access the "Admin / Users / Update" menu and set the admin user password
 * The root username (who has access to all files and authority for everything) is set in config_local.php to admin.
 * An e-mail address with appropriate format must be given
 * Change the install directory name to prevent access

> mv /usr/local/www/opendocman-1.2.5/install /usr/local/www/opendocman-1.2.5/install.orig

Old Procedure - Windows Install (2007.07.19)


 * Download entire SVN repository from Sourceforge
 * Copy ~/branches/1.2/ to ~/opendocman/ (version.php identifies version as v1.2.6, although is probably more correctly v1.2.6pre, as 1.2.6 hasn’t been released yet)
 * Copy config_local.php.sample to config_local.php and configure parameters appropriately:
 * Database name and root password, database user name and database user password as per Component Configuration spreadsheet.
 * base_url = 'http://www.scc.com/opendocman'
 * title = 'AlchemyBPM Document Repository'
 * site_mail = 'dalescott@shaw.ca'
 * root_username 'dscott'
 * dataDir 'C:\\opendocman_vault\\' (escape back-slashes)
 * revision_expiration = '180'; (review docs every 6 mo’s)
 * file_expired_action = “send email to reviewer”
 * authorization = Off (docs pubished without review)
 * secureurl = Off (for access to URLs for linking to ERP)
 * treeview = On (preference)
 * allow_signup = Off (preference)
 * allowedFileTypes = (minimum: Word, Excel, PowerPoint, Visio, text, ZIP, and PDF).


 * Access http://www.scc.com/opendocman/install to create and setup database.
 * Login as admin (no password), update user to change admin user password, logout
 * Install patch #1739854 Configurable Columns and UDF Text fields.
 * Install patch #1735861 HTML fixes in delete.php – NOT CURRENTLY INSTALLED, MAY HAVE PREVIOUSLY EXPERIENCED INCORRECT BEHAVIOR TRYING TO DELETE A FILE AFTER INSTALLING THE PATCH.
 * Rename (or delete) directory ~/opendocman/install

Old Notes - Maximum File Size (2007.07.19)

Php.ini (1) file_uploads = On  upload_max_filesize = 40M max_execution_time is 200 post_max_size = 40M mysql.connect_timeout = 60 Php.ini (2) max_execution_time = 60 max_input_time = 90 memory_limit = 18M post_max_size = 45M upload_max_filesize = 45M php.conf (3) LimitRequestBody 524288 -> LimitRequestBody 10485760 ODM config.php max_filesize

Updating
TODO: OPENDOCMAN UPDATE PROCEDURE TO BE COMPLETED


 * Copy Sourceforge Subversion repository as per Sourceforge project page:


 * 1) mkdir /usr/home/maestro/repo/distrib/opendocman-temp
 * 2) cd /usr/home/maestro/repo/distrib/opendocman-temp
 * 3) svn co https://opendocman.svn.sourceforge.net/svnroot/opendocman opendocman


 * copy relevant sub-directory to /usr/local/www
 * update /usr/local/etc/apache22/Includes/opendocman.conf
 * update database if necessary (how? automatically?
 * review readme