Red Hat Enterprise Linux Installation
From DocMGR
Contents |
[edit] Overview
This installation guide covers installing DocMGR on a Red Hat Enterprise Linux 4 system. Here are a few things to take note of about this guide:
- This guide does not cover installing RHEL and assumes a basic familiarity with Linux based operating systems.
- I only cover Apache configuration issues if they specifically relate to setting up DocMGR or PostgreSQL.
- I'm a complete PostgreSQL neophyte and thus try to explain that process in more detail.
[edit] Preparing the Operating System
The first step in the process of installing DocMGR on Red Hat Enterprise Linux 4 involves making sure that the operating system is ready to go. You want to make sure that you have the following packages installed. I performed the installation on RHEL 4 Update 1 so the RPM versions may change, but these are some of the Red Hat you should have.
- httpd-2.0.52-22.ent
- postgresql-server-7.4.8-1.RHEL4.1
- postgresql-7.4.8-1.RHEL4.1
- postgresql-libs-7.4.8-1.RHEL4.1
- postgresql-contrib-7.4.8-1.RHEL4.1
- php-pgsql-4.3.9-3.9
- php-4.3.9-3.9
- ImageMagick-c++-6.0.7.1-12
- ImageMagick-6.0.7.1-12
- ImageMagick-perl-6.0.7.1-1
- xpdf-3.00-11.10
I'm not 100% on all of the required RPM's so I essentially installed all of the Apache, PHP, ImageMagick and PostgreSQL packages available on the CD and then updated them through Red Hat Network.
[edit] Configuring Apache & PHP
[edit] Apache
The Apache web server is largely ready to go out of the box and while I typically make a number of modifications none are needed to install DocMGR. Just keep the following in mind.
- The default ServerRoot is: "/var/www"
- The default DocumentRoot is: "/var/www/html"
[edit] PHP
There isn't much to do with the PHP configuration as it is mostly ready to go out of the box. The only thing you should take care of now is increasing the maximum file upload size in "/etc/php.ini". The default is 2MB and its not uncommon for documents to reach that size these days. Look for the variable "upload_max_filesize" and increase it according to your needs.
WARNING: Redhat Enterprise Linux 4.x ships with PHP 4.x, but since version 0.56.x, the needed PHP version for DocMGR is PHP 5. So you should stick with DocMGR version 0.55.3, which is the last one which works on PHP 4 if you want to install on RHEL 4.
This is a pity, since a heavy duty document management system will surely be built upon RHEL much more than Fedora Core or similar. RHEL will in no way change the major PHP version in any of its 4.x updates, so you'll have to do with either installing an obsolete version of the software (DocMGR 0.55.3), or an OS which will not be supported in a year time (Fedora Core).
[edit] Add-Ons
[edit] AntiWord, ClamAV, GOCR
These Add-Ons can be obtained for EL4 from Dag Wieers APT/YUM Repo. Note: Always be careful about mixing packages from multiple third party repos.
[edit] Metamail
I can't seem to find an rpm for this add-on for RHEL4. It was last available for RHEL with version 2.1. I'll look in to this further and if needed provide instructions on building it for RHEL4.
[edit] XPDF
There is an RPM on the CD or via Red Hat Network for this add-on.
[edit] Directories & Files
The first order of business is downloading the latest version of DocMGR from http://wiki.docmgr.org/index.php/Downloads. Once you have the software I recommend creating a directory outside of your DocumentRoot for the software files and another directory for the data. My environment looks like this:
- ServerRoot = "/var/www/"
- DocumentRoot = "/var/www/html"
- DocMGR Install = "/var/www/html/docmgr --> /var/www/apps/docmgr-0.54"
- DocMGR Data = "/data/docmgr/files"
How you set up the directories is completely up to you, but do make sure to do the following:
- Change to the DocMGR data directory ("files").
- Change the permissions on data and tmp. "# chmod 777 data tmp"
- Change the ownership of the directories to apache:apache. "# chown apache:apache data tmp thumbnails"
[edit] PostgreSQL
Fortunately for those of us who know nothing about Postgresql, Red Hat does most of the work with the rpm's. The following steps are all that is needed to finish preparing the DocMGR database.
[edit] Configuring the Server
As the root user
- Edit the file "/var/lib/pgsql/data/postgresql.conf" and:
- Uncomment the line "port = 5432".
- Uncomment the line "tcpip_socket = false" and change the value to "true".
- Uncomment the line "password_encryption = true".
- Edit the file "/var/lib/pgsql/data/pg_hba.conf" to make the last few lines look like this:
# TYPE DATABASE USER IP-ADDRESS IP-MASK METHOD # Database administrative login by UNIX sockets local all postgres ident sameuser # # All other connections by UNIX sockets local all all ident sameuser # # All IPv4 connections from localhost host all all 127.0.0.1 255.255.255.255 md5 # # All IPv6 localhost connections host all all ::1 ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff ident sameuser host all all ::ffff:127.0.0.1/128 ident sameuser # # reject all other connection attempts host all all 0.0.0.0 0.0.0.0 reject # For DocMGR host docmgr docmgr 127.0.0.1 255.255.255.255 md5
- Restart the database.
- su postgres
[edit] Creating the Database and User
Taking a page from the HowTo for Debian, I too advocate creating a specific docmgr user for this application.
As the postgres user
bash-3.00$ createuser docmgr
Shall the new user be allowed to create databases? (y/n) y
Shall the new user be allowed to create more new users? (y/n) y
CREATE USER
bash-3.00$ psql template1
Welcome to psql 7.4.8, the PostgreSQL interactive terminal.
Type: \copyright for distribution terms
\h for help with SQL commands
\? for help on internal slash commands
\g or terminate with semicolon to execute query
\q to quit
template1=# alter user docmgr password 'ChangeMe';
ALTER USER
template1=# \q
-bash-3.00$ createdb -h localhost -W -U docmgr docmgr
Password:
CREATE DATABASE
[edit] Populating the Database
Because we changed the user that would own the database from "postgres" to "docmgr" we need to modify the included sql script to reflect this modification.
As the root user
# cd /var/www/apps/docmgr-0.54/scripts # perl -p -i -e s/postgres/docmgr/s docmgr.pgsql # psql -h localhost -W -U docmgr -d docmgr -f docmgr.pgsql Password: SET REVOKE GRANT SET CREATE SEQUENCE ... Lots of Statements ommitted ... CREATE VIEW
[edit] Restricting the User
When we created the user "docmgr" we gave it a bit more privileges then it should have for day-to-day operation. You should restrict it with the following:
# su postgres
bash-3.00$ psql template1
Welcome to psql 7.4.8, the PostgreSQL interactive terminal.
Type: \copyright for distribution terms
\h for help with SQL commands
\? for help on internal slash commands
\g or terminate with semicolon to execute query
\q to quit
template1=# alter user docmgr NOCREATEUSER NOCREATEDB;
ALTER USER
template1=# \q
[edit] DocMGR Configuration
[edit] Config File
Change to the install directory and open the file "config/config.php" with your favorite editor and make all of the necessary changes in the "Required Settings" section.
[edit] Initial Access
Open the path to your installation in a browser and log in for the first time with:
- User: admin
- Pass: admin
[edit] Conclusion
I tried to create this guide as I went through the process of creating a new installation and hope I didn't miss anything. Some of the sections are pretty weak and I'll try and address them in the near future.

