Panel | ||||||
---|---|---|---|---|---|---|
Contents
|
Setting up multiple DSpace instances in one Tomcat Server.
From Kyle Dykstra
I had to set up a second DSpace instance that was a mirror of the original
at the time the copy was made, so following is a relatively step-by-step
procedure for setting up an identical DSpace instance. I called my second
instance dspace-test, but as long as you maintain the same name in your
config file and rename the .war files the same way, any name will do. All
instances run under the same user as the original dspace, and all instances
use one instance of PostGreSQL.
1. Do the following as root until told otherwise
Panel |
---|
• sudo bash |
2. Copy dspace-source/config/dspace.cfg to dspace-test.cfg
Panel |
---|
• cd dspace/src/dspace-1.3.2-source/config |
3. Edit all references of /dspace to /dspace-test
Panel |
---|
• nano dspace-test.cfg |
4. Make the dspace-test directory
Panel |
---|
• mkdir /dspace-test/ |
5. Own the dspace-test directory to user dspace
Panel |
---|
• chown dspace /dspace-test/ |
6. Change to user dspace
Panel |
---|
• su dspace bash |
7. Create the dspace-test database, owned by the dspace user (Note: this step can be done with a GUI tool such as PGAdminIII, this step is also not necessary, but if a database isn't created, you will receive lots of errors when you run the fresh_install)
Panel |
---|
• cd /usr/lib/postgresql/8.1 |
8. Add the new database to pg_hba.conf so dspace can connect (as root)
Panel |
---|
• exit (changes back to user root)
|
9. Shutdown Tomcat
Panel |
---|
• /etc/init.d/tomcat5 stop |
10. Change to the dspace-source directory
Panel |
---|
• cd /dspace/src/dspace-1.3.2-source/ |
11. Do a fresh install using the appropriate config file
Panel |
---|
• ant clean |
12. Copy the dspace-source/config/dspace-test.cfg file to /dspace-test/config/dspace.cfg
Panel |
---|
• cp config/dspace-test.cfg /dspace-test/config/dspace.cfg |
13. Change to the dspace-source/build directory and rename the WARs
Panel |
---|
• cd build |
14. Copy the new WAR files to tomcat/webapps and ensure they are there
Panel |
---|
• cp ./*.war /var/lib/tomcat5/webapps/ |
15. Copy the dspace assetstore to dspace-test
Panel |
---|
• cp --Rv /dspace/assetstore/ /dspace-test/ |
16. Restart Tomcat
Panel |
---|
• /etc/init.d/tomcat5 start |
17. Copy the dspace database to dspace-test
Panel |
---|
• su dspace bash |
- NOTE** This can be accomplished much easier by using a GUI tool such as PGAdminIII. Simply backup the dspace database, drop the dspace-test database, create a new database called dspace-test with user dspace, and restore the dspace-test database from this backup. The postgresql server may have to be restarted (/etc/init.d/postgresql restart) before you can drop the dspace-test database.
18. Rebuild the search indicesPanel • /dspace-test/bin/index-all
- NOTE** This can be accomplished much easier by using a GUI tool such as PGAdminIII. Simply backup the dspace database, drop the dspace-test database, create a new database called dspace-test with user dspace, and restore the dspace-test database from this backup. The postgresql server may have to be restarted (/etc/init.d/postgresql restart) before you can drop the dspace-test database.
19. Copy news-side.html and news-top.html so the homepage contains the same information
Panel |
---|
• cp /dspace/config/*.html /dspace-test/config/ |
From Mark H. Wood
Yes. With initial advice from others here I've set up a developers'
environment on an old server to support multiple independent DSpace
instances, so that several of us can tinker without stepping on each
others' work. For a user with OS username USERNAME:
- I set up empty directories /opt/dspace-USERNAME with mask rwx,rws,rx
owned by each user, with the group set to the one used by Tomcat.
These will be the users' DSpace directories. - I create an empty file 'dspace-USERNAME.war' in Tomcat's 'webapps'
directory with the same ownership and mask rw,r,r. Tomcat complains
about a null .war at startup, but doesn't quit. This permits the user
to copy a non-null .war in without throwing the directory wide open. - I create a PostgreSQL user USERNAME with create-database permission.
pg_hba is set up to permit connections from localhost to a database by
a valid user of the same name. Granting create-database lets each user
'DROP DATABASE username' and start completely over, if desired. Users
may be able to create other databases, but they can't thereafter access
them, which limits the fun thereof. - One other thing that's handy is to add each developer to Tomcat's
'manager' group so they can stop/start their applications themselves
instead of calling me. Unlike the other measures, this grants each
developer unlimited control of all Tomcat applications, so be wary.
From Mark Diggory
Its all a matter of configuration, you need to setup a
separate postgres database, and generate a new separate root dspace
implementation and dspace war file.
For instance, if you have dspace setup as
Panel |
---|
DSpace Database Name: dspace |
Your second configuration would need to be something like (you may
want a more obvious replacement for "dspace2":
Panel |
---|
DSpace Database Name: dspace2 |
To attain this currently, the best thing to do is to start with your
original DSpace source directory and copy/change the configuration
(are you running dspace as a "dspace" user or "tomcat4" user? I'd
recommend tomcat4, while others would suggest making a separate
dspace user. My issue, instead of running multiple tomcats, we want
to run just one, Just like the configuration for Apache HTTPD, its
best to run the Tomcat engine under its own user.
1.) You'll want to create a new database:
Panel |
---|
createuser -U postgres -d -A -P dspace2 |
2.) As Robert says, the build script can do this for you if you
maintain separate dspace.cfg files for each location. For instance,
heres a config with all the changes for "dspace2"
Panel |
---|
#
|
3.) You'd then run:
Panel |
---|
ant clean |
and then run something like
Panel |
---|
ant -Dconfig=/<yourinstalldir>/config/dspace2.cfg fresh_install |
Note, these are very rough directions, approach with caution and on a
test system first to make sure all is as you would like in production.
From Robert Tansely
This works no problem, I was running 4 or 5 different DSpaces on one
Tomcat. Just make sure each instance has a separate install dir (esp.
assetstore) and PostgreSQL database configured. Then just drop the
.war files in tomcat/webapps, and you're away.
One caveat – if you're building the instances off a single source
tree, be sure to do an 'ant clean' before each build/deploy, otherwise
the location of the dspace.cfg to use (stuffed away in the .war
WE-INF/web.xml file) might be wrong.