Interesting links (in no particular order):
RedHat
The GNU Project
The Apache Software Foundation
The Comprehensive Perl Archive Network
PHP Hypertext Preprocessor (documentation)
PostgreSQL (documentation)
Open Secure Shell
The National Institute of Standards and Technology
WebMin
This is the process for configuring a new RedHat 7.3/8.0 installation to become a skyBox capable of running (and developing) skyBuilders timeLines. No other distributions have been tested as of this date, but there are no known issues to prevent the Apache/PHP/PostgreSQL version of timeLines from running in any Linux or other Unix-like environment. In order to be capable of this, there are a few required services and utilities:
Install RedHat 7.3 or 8.0
See the RedHat site for full distribution and documentation.
Unless otherwise noted, the following commands expect to be run as root.
Add crontab for NIST clock synchronization
(add other things like updating the root hints file and the file db later)
# cd /root
# mkdir scripts
# cd scripts
Download http://jesse.skybuilders.com/scratch/other/misc_linux/miscScripts.tar
# tar -xvf miscScripts.tar
# crontab clockSynch.cron
To see current settings, # crontab -l
Enable ssh for all users who will require remote access.
SSH lives in /etc/ssh
Edit sshd_config
Use the PermitRootLogin instruction to restrict or allow remote root access.
Go to the end of the file
After the last line, add a line that reads "AllowUsers" followed by a tab followed by a space-delimited list of usernames to allow
Test login
There is an upgrade for openSSH (possibly available from the website), which patches a security hole to which we are not, under our current settings, vulnerable. The ideal version would be 0.9.6e
To report current version:
# rpm -q <rpmname>
To upgrade with verbose and progress bar:
# rpm -Uvh <rpmname>
Locate Apache httpd
Set httpd to start on boot
To check the current setting:
# chkconfig httpd --list
To set the service to start on boot:
# chkconfig httpd --level 3456 on
Test http service
Open any browser to the fully qualified domain name or the IP Address of the machine
The index page should be the Apache test page
If there is an error, then the httpd service is not running. To start it:
# service httpd start
service should reply OK. Retest.
Make appropriate changes to php.ini
php.ini is in /etc
Here are the lines to look for that show their default values, each followed by the line that should replace it (the preferred method is to comment out the default line to preserve it, and put the new setting on the following line - the comment character is a semicolon ';'):
Set postgresql to start on boot
To check the current setting:
# chkconfig postgresql --list
To set the service to start on boot:
# chkconfig postgresql --level 3456 on
Test postgresql
Check whether postgresql is running:
# service postgresql status
If service replies that postgresql is stopped, then:
# service postgresql start
service should reply OK
postgresql helpful hints
This section is just a few helpful pointers and links about how to handle you postgres installation. Actual instruction begins again in the next section (Enable proper logging for postgresql).
PostgreSQL configuration is in /var/lib/pgsql/data/postgresql.conf
Host Based Access configuration file is in /var/lib/pgsql/data/pg_hba.conf
To make a database (which will be owned by the operating system user who issues the command):
bash-2.05b$ createdb <dbname>
All user and db management can be done through the PostgreSQL interactive terminal (which accepts both SQL statements and Postgres metacommands) called psql (man psql for reference):
bash-2.05b$ psql <dbname>
which takes you to a prompt which looks like:
<dbname>=#
To add/manage users:
PGSQL User Management
To create users:
<dbname>=# CREATE USER <username>
Every db must be VACUUMed at least once every billion transactions with the vacuum command in psql (or risk catastrophic data loss). See Routine Vacuuming.
A few useful tools.
To list all postgresql users:
<dbname>=> SELECT * FROM pg_user;
To list all postgresql databases:
<dbname>=> SELECT * FROM pg_database;
To find out the currently selected database, look at the name in the prompt:
<dbname>=>
Enable proper logging for postgresql
Edit the file /etc/init.d/postgresql
Find the line that reads:
su -l postgres -s /bin/sh -c "/usr/bin/pg_ctl -D #PGDATA -p /usr/bin/postmaster start > /dev/null 2>&1" < /dev/null
Edit the line to read (changes marked in bold, note double greater than after 'start'):
su -l postgres -s /bin/sh -c "/usr/bin/pg_ctl -D #PGDATA -p /usr/bin/postmaster -o '-i' start >> /var/log/pgsql 2>&1" < /dev/null
Save the file
Restart postgresql:
# service postgresql restart
service should reply OK
Configure pgsql users and databases
First, the user called 'postgres', who is the superuser for the postgresql service, must have a new, secure password assigned both in the operating system and in the postgresql service. Next, a file called 'admins' must be created to indicate that the postgres user can connect to any database with a password challenge. Then, other users must be added to pgsql. One user should be defined for each timeLines installation on the machine. Finally, the new database(s) for the timeLines installation(s) must be created.
Create the postgresql admin user and set permissions for postgresql users:
passwd
:
# passwd postgres
# su postgres
bash-2.05b$
psql
, which opens the PostgreSQL interactive terminal. (Whenever in the terminal, be sure to expect confirmations of any action; a null response is a sure sign of no action performed.)
bash-2.05b$ psql template1
passwd
command above, 'ALTER USER' will not automatically conceal the password as it is being typed. Be sure to enter it only in a secure environment.)
template1=# ALTER USER postgres WITH PASSWORD '<newpassword>';
template1=# \q
bash-2.05b$ exit
# service postgresql restart
Create new users and databases:
# su postgres
bash-2.05a$ createuser <options> <username>
bash-2.05a$ createuser -d -P -A www_example_tld
createuser
should reply CREATE USER
# psql template1 <username>
template1=# CREATE DATABASE <username>;
template1=# CREATE DATABASE www_example_tld;
template1=> \c <dbname>;
template1=> \q
Install the timeLines application
# /usr/sbin/groupadd skyApp
# /usr/sbin/usermod -G skyApp apache
# /usr/sbin/usermod -G skyApp <username>
# cd /var/www
# chown -R :skyApp www.example.tld
# chmod -R 775 www.example.tld
# service httpd restart
Enable virtual servers under apache
Open the file /etc/httpd/conf/httpd.conf for editing
Add these lines to the virtual servers section (substituting the appropriate machine name and domain name), with an extra VirtualHost section for each timeLines installation:
NameVirtualHost *
<VirtualHost *>
ServerName www.example.tld
DocumentRoot /var/www/html
AddType application/x-httpd-php .php .php4 .php3 .phtml .html .xml .xsd .rdf .rdfs
</VirtualHost>
Note: Apache 2.0.40-8 (RedHat 8.0 distribution) does not currently support the IP wildcard, '*' in the example above. This version requires IP number(s) to entered directly into the httpd.conf entries for NameVirtualHost and VirtualHost entries.
Save the file
Restart the web server httpd.
# service httpd restart
Run the timeLines installation script
This script will build the new database's schema and populate it with initial data. Open a timeLines-compatible browser (Mozilla > 1.1, Netscape > 4.0, Internet Explorer > 4) and navigate to the following URL (where <domain name> is the domain name of your new site):
http://<domain name>/timelines/Install.html
timeLines will now challenge for the database password for the new site (as set in the section Configure pgsql users and databases). Initialization should take around two minutes.
skyBuilders timeLines installation should now be complete!
Please report any bugs at our interactive Bug Report. Thank you.