From 3e3e0bb9a47af4901c3ab5a5ebfdc9fe576f4c26 Mon Sep 17 00:00:00 2001 From: Dan Scott Date: Thu, 18 Aug 2011 15:32:53 -0400 Subject: [PATCH] Update README to reflect the --create-database option Now that eg_db_config.pl is intelligent enough to create the database, update the README to free people from the tyranny of having to manually issue database creation (and contrib-adding) commands. Signed-off-by: Dan Scott --- README | 64 ++++++++++++++++++++++++++++++---------------------------- 1 file changed, 33 insertions(+), 31 deletions(-) diff --git a/README b/README index fe105db8e5..b9c3eb021a 100644 --- a/README +++ b/README @@ -280,57 +280,59 @@ cpan MARC::File::XML cpan UUID::Tiny ------------------------------------------------------------------------------ -Once the PostgreSQL database server has been installed, you must -create the database and add the appropriate languages and extensions to -support Evergreen. Issue the following commands as the `postgres` user to set -up a database called `evergreen`. Note that the location of the PostgreSQL -`contrib` packages may vary depending on your distribution. In the following -commands, we assume that you are working with PostgreSQL 9.0 on a Debian-based -system: - -[source, bash] ------------------------------------------------------------------------------- -createdb --template template0 --lc-ctype=C --lc-collate=C --encoding UNICODE evergreen -createlang plperl evergreen -createlang plperlu evergreen -psql -f /usr/share/postgresql/9.0/contrib/tablefunc.sql -d evergreen -psql -f /usr/share/postgresql/9.0/contrib/tsearch2.sql -d evergreen -psql -f /usr/share/postgresql/9.0/contrib/pgxml.sql -d evergreen -psql -f /usr/share/postgresql/9.0/contrib/hstore.sql -d evergreen ------------------------------------------------------------------------------- - -Once you have created the Evergreen database, you need to create a PostgreSQL -user to access the database. Issue the following command as the `postgres` -user to create a new PostgreSQL superuser named `evergreen`. When prompted, -enter the new user's password: +You need to create a PostgreSQL superuser to create and access the database. +Issue the following command as the `postgres` user to create a new PostgreSQL +superuser named `evergreen`. When prompted, enter the new user's password: [source, bash] ------------------------------------------------------------------------------ createuser -s -P evergreen ------------------------------------------------------------------------------ -Once you have created the Evergreen database, you also need to create the -database schema and configure your configuration files to point at the +Once you have created the Evergreen superuser, you also need to create the +database and schema, and configure your configuration files to point at the database server. Issue the following command as root from inside the Evergreen source directory, replacing , , , , and -with the appropriate values for your PostgreSQL database, and and - with the values you want for the default Evergreen administrator -account: +with the appropriate values for your PostgreSQL database (where and + are for the PostgreSQL superuser you just created), and replace + and with the values you want for the default +Evergreen administrator account: [source, bash] ------------------------------------------------------------------------------ perl Open-ILS/src/support-scripts/eg_db_config.pl --update-config \ - --service all --create-schema --create-offline \ + --service all --create-database --create-schema --create-offline \ --user --password --hostname --port \ --database --admin-user --admin-pass ------------------------------------------------------------------------------ -This creates the database schema and configures all of the services in +This creates the database and schema and configures all of the services in your `/openils/conf/opensrf.xml` configuration file to point to that database. It also creates the configuration files required by the Evergreen cgi-bin -administration scripts, and set the user name and password for the default +administration scripts, and sets the user name and password for the default Evergreen administrator account to your requested values. +Creating the database on a remote server +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +In a production instance of Evergreen, your PostgreSQL server should be +installed on a dedicated server. To create the database in that case, you +can either: + + * Install the PostgreSQL contrib modules on the machine on which you + are installing the Evergreen code, and use the --create-database + option from that machine, or + * Copy the `Open-ILS/src/sql/Pg/create-database.sql` script to your + PostgreSQL server and invoke it with: ++ +[source, bash] +------------------------------------------------------------------------------ +psql -vdb_name= -vcontrib_dir=`pg_config --sharedir`/contrib +------------------------------------------------------------------------------ + +Then you can issue the `eg_db_config.pl` command as above _without_ the +`--create-database` argument to create your schema and configure your +configuration files. + Developer instructions: ----------------------- -- 2.43.2