Go button for Search using swish_e Go button for Search using Google
 
A comet
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 all DNS records for the domain
  2. Create a new postgres user for the site
  3. Create a new postgres database for the site
  4. Create a new directory for the site
  5. Download the timeLines application software, untar it into the site directory
  6. Create a virtual host entry for the site in the apache (or ssl) configuration file
  7. Run the timeLines Installation script

Create all DNS records for the domain:
Create DNS Forward Zone file and Reverse Name Records on all appropriate name servers. If skyPipes is involved, make sure that zones and records for the nonroutable space are also created.

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 the template database "template1" and to 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.
       Enter a password for user "www_example_tld":
  5. The password will be challenged for a second time for confirmation.
       Enter it again:
  6. Finally the postgres admin password will be asked for, to authorize the new user. Enter the postgres admin password.
       Password:
    createuser should reply CREATE USER
    The new user has now been created!
    (man createuser for details, man dropuser for deleting 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.
       bash-2.05a$ exit
  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. The psql command will now challenge you for a password. Enter the password for the new database user at the prompt:
       Password:
    Upon authentication, the postgresql interactive terminal will open, allowing database queries:
    Welcome to psql, 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=>
  4. 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;
  5. Connect to the new database. This will confirm its existence.
       template1=> \c <dbname>;
    The terminal should respond You are now connected to database <dbname>.
    The database for this timeLines installation has now been created!
  6. Exit the psql terminal to return to the root shell:
       www_example_tld=> \q

Create a new directory for the site

  1. Navigate to the directory above the default web root (in this case "/var/www/html/"):
       # cd /var/www/
  2. Make a new directory using the fully qualified domain name of the new site (in our example "www.example.tld").
       # mkdir www.example.tld
  3. Move into the new site directory:
       # cd www.example.tld/

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

  1. Download the installation archive file (currently ~2.3MB) from downloads.skybuilders.com using the command wget (or your favorite http download tool).
       # wget http://downloads.skybuilders.com/skylatest.tar.gz
    The wget command will output the progress of the download. Wait for it to complete.
  2. Decompress the installation archive into the the new directory. All necessary application server pages, directories, and image files will now be in place.
       # tar -xvf skylatest.tar.gz -z
    The tar command will output the name of each file it extracts to display its progress.
  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 apache:skyapp www.example.tld
  4. Set permissions for the site directory (recursively, for all the files and directories below it).
       # chmod -R 770 www.example.tld

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 using emacs or your favorite editor:
       # emacs /etc/httpd/conf/httpd.conf
  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 example.tld
         ServerAlias www.example.tld
         DocumentRoot /var/www/www.example.tld
         AddType application/x-httpd-php .php .php4 .php3 .phtml .html .xsd .xml .rss .rdfs .rdf
       </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 
Authors: orion, dtd
skyCalendar

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

Requests
 Version: 11405 | Series: 21922 

Search: Site | Web | Groups