Set up dbNP instance on an NBX

Set up tomcat user

  • Login as manager
  • Create user tomcat:
    sudo adduser tomcat
  • Switch to user tomcat and its home directory
    sudo su - tomcat
  • Change default shell to bash:
    chsh -s /bin/bash
  • Check out deploy scripts and virtual host configurations
    svn checkout --username=anonymous
    svn checkout --username=anonymous
  • Download Tomcat (to find the newest version, go to, find it, click Download and look up the Core .tar.gz file)
    tar -zxvf apache-tomcat-7.0.16.tar.gz
  • Add CATALINA_OPTS parameter to default bash environment of Tomcat user (convenient when restarting Tomcat manually)
    echo "export CATALINA_OPTS=\"-Xms128m -Xmx2048m -XX:MaxPermSize=720m -XX:MaxHeapFreeRatio=70 -XX:MaxGCPauseMillis=10 -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled\"" >> ~/.bashrc
  • Return to your own (manager) shell

Set up Apache virtual host configuration

  • Copy the appropriate virtual host configuration from the SVN templates to the apache virtual host directory and adjust the

sudo cp /home/tomcat/vhost/dbnp.org_gscf-www.conf /etc/apache2/sites-available cd /etc/apache2/sites-enabled sudo ln -s ../sites-available/dbnp.org_gscf-www.conf sudo vi dbnp.org_gscf-www.conf }}}

  • Install modproxy and restart Apache webserver
    sudo apt-get install libapache2-mod-proxy-html
    sudo ln -s /etc/apache2/mods-available/proxy* /etc/apache2/mods-enabled/
    sudo ln -s /etc/apache2/mods-available/rewrite.load /etc/apache2/mods-enabled/
    sudo /etc/init.d/apache2 reload

Set up Postgres database

  • As user postgres, create a new database user account
    sudo -u postgres createuser -d -R -P dbnp;

You will be asked for a password, it is advisable to create a secure (e.g. 20 characters) random password, for example with a password generator website

  • Create a gscf database and make the newly created database account owner
    sudo -u postgres createdb -O dbnp gscf-www;

Set up custom GSCF configuration

You can create the configuration by running GSCF setup wizard. Alternatively, you can write it from scratch:

  • As user tomcat, write the GSCF configuration:
    sudo -u tomcat nano /home/tomcat/.gscf/

You can copy the default configuration from, but make sure to change the application URL, the database driver, the database user name and password (to what you just entered).

Last modified 11 years ago Last modified on Jun 20, 2011, 5:20:02 PM