skyBuilders timeLines GNU/Linux/Apache/PHP/PostgreSQL HOWTO Add Additional Sites

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

To add an additional site:

  1. Create a new postgres user for the site
  2. Create a new postgres database for the site
  3. Create a new directory for the site
  4. Download the timeLines application software, untar it into the site directory
  5. Create a virtual host entry for the site in the apache (or ssl) configuration file
  6. Run the timeLines Installation script

Create a new postgres user for the site:

  1. Get to a shell as root
  2. Run a shell as the user postgres (the postgresql administrative user).
       # su postgres
  3. Create a new database user. The name of this new user should correspond to the fully qualified domain name of the site that the database will be supporting, subtituting underscores for the dots. For example, if your domain name is "www.example.tld", the corresponding user name should be "www_example_tld". This should also be the name of the database. Permissioning restricts users other than the admin user "postgres" to connect only to "template1" and the database with the same name as the user.
    The command to create a postgresql user is createuser. It looks like:
       bash-2.05a$ createuser <options> <username>
    The options that should be used in this case are:
    -d = user is allowed to create databases
    -P = the command will prompt for a password
    -A = user is not allowed to create users
    Using our example:
       bash-2.05a$ createuser -d -P -A www_example_tld
  4. The password for the new user will now be prompted for. This should be another equally secure password, preferably different from the postgres user password, especially if there will be multiple timeLines installations on this machine. This password will be required by the timeLines installation script later in order to initialize the database and enable the application.
  5. The password will be challenged for a second time for confirmation.
  6. Finally the postgres admin password will be asked for, to authorize the new user.
    createuser should reply CREATE USER
    The new user has now been created!
    (man createuser for details, dropuser to delete users, and ALTER USER from inside psql to change settings for a user)

Create a new postgres database for the site:

  1. Exit the postgres shell to get back out to the root shell.
  2. Connect to template1 as the new database user. You will be challanged for the new user's password. (Notice that the terminal prompt ends with a ">" rather than a "#", to show that you are not a superuser (postgres).)
       # psql template1 <username>
  3. Create the database for this user, named with the new user's username. Ownership of the new database is automatically assigned to its creator. The terminal should respond "CREATE DATABASE".
       template1=# CREATE DATABASE <username>;
    Using our example:
       template1=# CREATE DATABASE www_example_tld;
  4. Connect to the new database. This will confirm its existence. The terminal should respond "You are now connected to database <dbname>."
       template1=> \c <dbname>;
  5. The database for this timeLines installation has now been created!
  6. Exit the psql terminal to return to the root shell:
       template1=> \q

Create a new directory for the site

  1. Create a directory alongside the default web root (in this case "/var/www/html/") using the fully qualified domain name of the new site (in our example "/var/www/www.example.tld"). Move into the new directory and make another directory there called "timelines". Move into the timelines directory.

Download the timeLines application software, untar it into the site directory

  1. Download the installation archive file from downloads.skybuilders.com.
  2. Decompress the installation archive into the the new timelines directory. All necessary application server pages, directories, and image files will now be in place.
       # tar -xvf <archive_file_name> -z
  3. Permissions must be set on the application directory. Change the group setting for the site directory (recursively, for all the files and directories below it).
       # cd /var/www
       # chown -R :skyApp www.example.tld
  4. Set permissions for the site directory (recursively, for all the files and directories below it).
       # chmod -R 775 www.example.tld
  5. Restart the web server httpd.
       # service httpd restart

Create a virtual host entry for the site in the apache (or ssl) configuration file

  1. Open the file /etc/httpd/conf/httpd.conf for editing
  2. 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.
  3. Save the file
  4. 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.

  1. 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 Create a new user in postgres). Initialization should take around two minutes.

skyBuilders timeLines installation should now be complete!
Please report any bugs at our interactive Bug Report. Thank you.

Edit  |  workFlow  |  Subscribe
Language: fr  | it  | de  | es  | pt  | ar  | he  | da  | nl  | zh  | ja  | ko  | none 
Author: dtd
skyCalendar

This Version:
Archived at: https://www.skybuilders.com/Documentation/HowToLinuxAdditionalSites.20030929150324.html
Next Version:

Requests
 Version: 2861 | Series: 22571 

Search: Site | Web | Groups