Hi,
This is a step by step guide starting from a clean slate installation of
Ubuntu. There were some emails a while back asking which distro is
best... I think Ubuntu is pretty good.
If the formatting gets messed up in the email, you can get it at
http://weems.uwindsor.ca/geonetwork/install.html for a little while at
least. Feel free to put it in the help section of the website if you so
desire.
Paul
HOWTO: GeoNetwork opensource Installation on Ubuntu
This is a step-by-step guide to installing GeoNetwork opensource 2.0.3 on
Ubuntu. It was tested with Dapper Drake 6.06.1 LTS and Feisty Fawn 7.04.
It is assumed that Ubuntu is installed already and that networking is set
up.
Please direct any queries, comments, corrections regarding this document
to me:
Paul Grzeszczak, pgrzeszcATuwindsorDOTca
University of Windsor's Centre for Geospatial Analysis
Last updated: 2007-06-28
Ubuntu - Initial Configuration
1. Edit apt sources to include extra repositories - remove "#" in
front of all lines starting with "deb" or "deb-src"
sudo nano /etc/apt/sources.list
2. Initial updates (install and restart):
sudo apt-get update
sudo apt-get dist-upgrade
sudo shutdown -r now
3. Install SSH for remote access and NTP for time synchronization
sudo apt-get install ssh ntp
4. Install Sun Java 1.6
sudo apt-get install sun-java6-jdk
5. Select which Java to use by default (and check)
sudo update-java-alternatives -s java-6-sun
java -version
The above should return something like:
java version "1.6.0"
Java(TM) SE Runtime Environment (build 1.6.0-b105)
Java HotSpot(TM) Client VM (build 1.6.0-b105, mixed mode, sharing)
6. Install Tomcat 5
sudo apt-get install tomcat5
7. Update default settings for Tomcat and restart
sudo nano /etc/default/tomcat5
JAVA_HOME line should read (remove "#" if needed):
JAVA_HOME=/usr/lib/jvm/java-6-sun
TOMCAT5_SECURITY line should read (remove "#" if needed):
TOMCAT5_SECURITY=no
sudo /etc/init.d/tomcat5 restart
8. Install MySQL server
sudo apt-get install mysql-server
9. Change default MySQL root user password
mysql -u root
use mysql
update user set password=password(?mynewpassword?) where user=?root?;
flush privileges;
exit
Create a database and a user for geonetwork
1. Create a database (use the newly created root password):
mysqladmin create databasename -u root -p
2. Create a user with privileges to the database
mysql -u root -p
grant all privileges on databasename.* to ?username?@?localhost?
identified by ?userpassword?;
grant all privileges on databasename.* to ?username?@?%? identified by ?
userpassword?;
exit
Install and configure GeoNetwork opensource
1. Install GeoNetwork opensource (customize path if not installing
from CD)
sudo java -jar
/media/cdrom/geonetwork/geonetwork-intermap-2.0.3-install.jar
Use default location (i.e. /usr/local/geonetwork).
Install Geonetwork and optionally Intermap and sample metadata.
Do not install Jetty (Tomcat is installed already)
General Settings Dialog (1/4)
Servlet name can be ?geonetwork? - this is what follows http://
hostname.domain.tld:port/ in the URL
Host port should be 8180, which is the default Tomcat 5 port
Site ID is a unique name of the site
General Settings Dialog (2/4)
The username and password are for logging into the site via web, it will
be created according to the values entered
General Settings Dialog (3/4)
The username, password and database name for DB created above
Connection url: jdbc:mysql://localhost/databasename
Use MySQL DBMS driver
Ignore instructions regarding copying the driver to /WEB-INF/lib
Consult network administrator regarding SMTP host
Public host is the fully qualified domain name of the server
Public port is 8180
2. Edit server.xml to add new contexts within the ?Host? element (see
file /usr/local/geonetwork/docs/post-install.txt):
sudo nano /usr/share/tomcat5/conf/server.xml
For GeoNetwork opensource, include:
<Context path="/geonetwork" docBase="/usr/local/geonetwork/web"
crossContext="false" debug="0" reloadable="false" />
If Intermap was installed, also include:
<Context path="/geonetwork/intermap"
docBase="/usr/local/geonetwork/web-intermap" crossContext="false"
debug="0" reloadable="false" />
3. Install xalan libraries required for Geonetwork
Get the tar archive
wget http://www.apache.org/dist/xml/xalan-j/xalan-j_2_7_0-bin.tar.gz
Extract the archive
tar xvzf xalan-j_2_7_0-bin.tar.gz
Copy required jar files
sudo cp xalan-j_2_7_0/*.jar /usr/share/tomcat5/common/endorsed/
Delete files
rm -rf xalan-j_2_7_0/
rm xalan-j_2_7_0-bin.tar.gz
4. Change permissions for some directories (IMPORTANT: this step
should be revised for security reasons)
sudo chown -R tomcat5 /usr/local/geonetwork/web*
sudo chown -R tomcat5 /var/lib/tomcat5
5. Restart Tomcat
sudo /etc/init.d/tomcat5 restart
6. Check with browser: http://hostname.domain.tld:8180/geonetwork
Integrate with Tomcat5 with Apache2 using mod_jk
1. Install mod_jk
sudo apt-get install apache2 libapache2-mod-jk
2. Create file /etc/apache2/mods-available/jk.conf
sudo nano /etc/apache2/mods-available/jk.conf
Contents of jk.conf:
JkWorkersFile /etc/apache2/workers.properties
JkLogFile /var/log/apache2/mod_jk.log
JkShmFile /var/log/apache2/mod_jk.shm
JkLogLevel info
3. Create file /etc/apache2/workers.properties
sudo nano /etc/apache2/workers.properties
Contents of workers.properties:
worker.list=worker1
worker.worker1.type=ajp13
worker.worker1.host=localhost
worker.worker1.port=8009
4. Enable mod_jk
sudo a2dismod jk
sudo a2enmod jk
5. Create site configuration
sudo nano /etc/apache2/sites-available/geonetwork
Contents of geonetwork:
<IfModule mod_jk.c>
Alias /geonetwork /usr/local/geonetwork/web/
JkMount /geonetwork/* worker1
</IfModule>
6. Enable site
sudo a2ensite geonetwork
7. Restart Apache2
sudo /etc/init.d/apache2 force-reload
8. Check with browser: http://hostname.domain.tld/geonetwork