Shell script commands for installing a basic registry on an Ubuntu 8.04 system.

#
# Login as root
sudo su -

#
# Set the Tomcat account name and password.
TOMCAT_USER=astrogrid
TOMCAT_PASS=jw8s0F4

#
# Set the AstroGrid home
ASTROGRID_HOME=/var/lib/astrogrid

#
# Set the registry authority ID.
REGISTRY_AUTH=org.astrogrid.test

#
# Install misc tools.
apt-get -y install tar
apt-get -y install wget
apt-get -y install curl
apt-get -y install unzip
apt-get -y install patch
apt-get -y install tofrodos

#
# Install Java
apt-get -y install openjdk-6-jre
apt-get -y install openjdk-6-jdk

#
# Select the OpenJDK Java implementation.
update-alternatives --config java

#
# Select the OpenJDK Java implementation.
update-alternatives --config javac

#
# Install Tomcat
apt-get -y install tomcat5.5
apt-get -y install tomcat5.5-admin
apt-get -y install tomcat5.5-webapps

#
# Change the Tomcat port number
sed -i '
    s/Connector port="8180"/Connector port="8080"/
    ' /etc/tomcat5.5/server.xml 

#
# Disable Tomcat SecurityPolicy
sed -i '
    s/TOMCAT5_SECURITY=yes/TOMCAT5_SECURITY=no/
    ' /etc/init.d/tomcat5.5 

#
# Remove DOS characters (can cause patch to fail).
dos2unix /etc/tomcat5.5/tomcat-users.xml

#
# Add the astrogrid user account.
patch /etc/tomcat5.5/tomcat-users.xml << EOF
*** /old/tomcat5.5/tomcat-users.xml
--- /new/tomcat5.5/tomcat-users.xml
***************
*** 5,8 ****
--- 5,9 ----
    <user username="tomcat" password="tomcat" roles="tomcat"/>
    <user username="both" password="tomcat" roles="tomcat,role1"/>
+   <user username="${TOMCAT_USER}" password="${TOMCAT_PASS}" roles="manager,admin"/>
    <user username="role1" password="tomcat" roles="role1"/>
  </tomcat-users>
EOF

#
# Restart the Tomcat service
/etc/init.d/tomcat5.5 restart

#
# Create AstroGrid webapps  directory
if [ ! -e ${ASTROGRID_HOME}/webapps ]
then
    mkdir -p ${ASTROGRID_HOME}/webapps
fi

#
# Download the latest war file.
pushd ${ASTROGRID_HOME}/webapps
    wget http://www.astrogrid.org/maven/org.astrogrid/wars/astrogrid-registry-2008.2.01.war
popd

#
# Create context file.
cat > ${ASTROGRID_HOME}/webapps/astrogrid-registry.xml << EOF
<?xml version='1.0' encoding='utf-8'?>
<Context
    displayName="AstroGrid test registry"
    >

    <Environment
      name="reg.amend.authorityid"
      override="false"
      type="java.lang.String"
      value="${REGISTRY_AUTH}"
    />

</Context>
EOF

#
# Deploy the webapp.
curl --user ${TOMCAT_USER}:${TOMCAT_PASS} \
http://localhost:8080/manager/deploy\
?path=/astrogrid-registry\
\&config=file:${ASTROGRID_HOME}/webapps/astrogrid-registry.xml\
\&war=file:${ASTROGRID_HOME}/webapps/astrogrid-registry-2008.2.01.war

Last step is to goto the 'self register' page using your browser.

    http://hostname.example.org:8080/astrogrid-registry/admin/selfRegisterForm.jsp

-- DaveMorris - 08 Jan 2009

Topic revision: r2 - 2009-01-12 - 04:05:45 - DaveMorris
 
AstroGrid Service Click here for the
AstroGrid Service Web
This is the AstroGrid
Development Wiki

This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback