Document Manager Administration manual INSTALLATION INSTRUCTIONS ------------------------- 1. get latest version of Document Manager from http://www.rot13.org/~dpavlin/docman.html 2. go to installation directory (which doesn't have to be under your web server) and un-tar distribution cd /home/httpd/docman tar xvfz docman-*.tar.gz If you decide to install docman in some other directory, change $gblIncDir to that directory in docman.php! 3. go to directory which you want to have under Document Manager control (this directory needs to be accessible from your web server tree) cd /home/httpd/html chmod that directory so that web server can write in it. chown nobody /home/httpd/html 4. make a symlink from that directory to file which will be directory index ln -s /home/httpd/docman/docman.php /home/httpd/html/.index.php 5. add new DirectoryIndex entry to your apache configuration file. If your apache has config files in /etc/httpd/conf/httpd.conf find a line like DirectoryIndex index.html index.htm and add .index.php at the end. DirectoryIndex index.html index.htm .index.php It is important that new directory index file begins with dot -- that ensures that files won't be visible from Directory Manager interface. 6a. (if you don't want to users in SQL database) Go to you web server and check if you got authorization request. If you did, you also have .htusers in same directory in which is .index.php edit .htusers file to add users. You can do that by calling adduser.pl script. If you press just enter for password or enter auth_pop3 docman will user e-mail address to connect to pop3 server and check password on it. For that e-mail address must be in following form: pop3login@pop3server.mydomain E-mail addresses are not used for anything else right now, so it's safe to enter invalid e-mail address it that's valid pop3 account. But, that WILL change, so you are warned! 6b. (alternative to 6a if your users are in SQL database) change $gblUsers in .docman.conf to $gblUsers = "htusers_sql"; Download php-dbi class from http://pil.dk/downloads/dbi.tar.gz and untar it in docman's directory cd /home/html/docman tar xvfz dbi.tar.gz Construct SQL query which returns login, full name, password and email from your tables(s). If you don't have some of that data, replace them with literal strings. e.g. if your table is called my_users with columns who in which is login and column pw in which is plain text password you can use following query to get requested format: select who,'Auth user',pw,'nobody@com' from my_users Enter that SQL query under $dbi_sql in .docman.conf Construct $dbi in .docman.conf in following format: $dbi = "driver:database:user:password" driver can be: pgsql, mysql, oracle or odbc (as supported by php-dbi), database is name of database in which are your users and user/password is credentials for user which connects to database 6c. (alternative to 6b you want to authorize users based on IP numbers, client DNS names of HTTP Referrer header (URI from which they accessed docman site). Put $gblUsers = "htusers_header"; in .docman.conf use following form in your .htusers file: REMOTE_ADDR=10.0.0.3:Full name:auth_header:e-mail@foo.bar remote_hostname=myworkstation:Full name:auth_header:e-mail@foo.bar http_referer=test.foo.bar:Full name:auth_header:e-mail@foo.bar Please note that you *have to* put "auth_header" in password field and that valid options for left side of = in login field are: remote_addr, remote_hostname or http_referer. 6d. (if you want some combination of 6a, 6b and/or 6c) put in .docman.conf $gblUsers = "htusers_union" and uncomment which htusers auth modules you want to use and in which order 7. (optional) You can create file named .info.inc in /home/httpd/html directory for some kind of motd file. You can use html mark-up in it also! 8. (optional) Copy docman.conf into /home/httpd/html/.docman.conf and edit values which override default values in docman.php 9. if you want to upload files which are bigger than 2Mb increase upload_max_filesize to more than 2Mb in php.ini. If you still get errors on files bigger than 8Mb increase post_max_size also. You are ready to go. DIRECTORY AND FILE STRUCTURE ---------------------------- Break-out of files in /home/httpd/docman/: docman.php - main docman php file (to be installed as DirectoryIndex) docman.conf - configuration file which will be copied in document root of site auth_pop3.php - authorization module ($gblIncDir in docman.php must point to location of this file) htusers_file.php - module for access to users in .htusers files htusers_sql.php - module for access to users which are in SQL database adduser.pl - perl script for adding of users (you can also add users manually by editing .htusers file) docman.txt - user documentation admin.txt - administrator's documentation contrib/ - directory with optional useful scripts dbi/ - optional directory for dbi classes is users are stored in SQL database, it will be created after unpacking of http://pil.dk/downloads/dbi.tar.gz Break-out of files in /home/httpd/html/ (root directory of site under docman management): .changelog - changes of files under docman management .htusers - file with users .info.inc - file with MOTD which is included in interface .docman.conf - configuration file for this site Files in each directory under docman management (some of them may be missing, they will be created automatically): .bak/ - directory for backup copies of files .del/ - directory with deleted files .lock/ - directory with lock informations .log/ - directory with change-logs for each file .note/ - directory with notes for files MISC ---- You can use document manager behind secure http server (https) simply by installing it. For information take a look at http://www.modssl.org HTUSERS FILE FORMAT ------------------- .htusers file used by docman doesn't have same format as .htusers file used by web server. That's because docman's file have more information about user (include full name and e-mail address). Format of file is: # comment login:Full Name:password:email@domain.com for password, I use md5 sum of login and password appended together. So, If you want to create password and your login is 'foo' and password 'bar' you have following entry: foo:Foo Bar:3858f62230ac3c915f300c664312c63f:foo@bar.com Different htuser_* and auth_* modules can (and they actually do) re-use login, password and e-mail fields for it's own purpose.