Source tree compilation on Debian/Ubuntu: Difference between revisions

From genomewiki
Jump to navigationJump to search
No edit summary
No edit summary
Line 5: Line 5:
[http://genome-source.cse.ucsc.edu/gitweb/?p=kent.git;a=tree;f=src/product;hb=HEAD src/product]
[http://genome-source.cse.ucsc.edu/gitweb/?p=kent.git;a=tree;f=src/product;hb=HEAD src/product]


These commands compile the UCSC genome browser and all source tools on Debian Lenny (64 and 32bit), Ubuntu Maverick and Ubuntu 13.04. They will put all binaries in /usr/local, all cgi-bins in /usr/lib/cgi-bin and all html-like things into /var/www/genome.
These commands compile the UCSC genome browser and all source tools. They have been tested on Debian Lenny (64 and 32bit), Ubuntu Maverick and Ubuntu 13.04. They will put all binaries in /usr/local, all cgi-bins in /usr/lib/cgi-bin and all html-like things into /var/www/genome.


In theory, once you have installed the samtools library, you can just copy-paste this script into a command line
In theory, once you have installed the samtools library, you can just copy-paste this script into a command line
Line 45: Line 45:


Add the parameter HG_WARN=-w to DIRS if you don't want the compilation to stop on error messages. Dirty, but it works. :-)
Add the parameter HG_WARN=-w to DIRS if you don't want the compilation to stop on error messages. Dirty, but it works. :-)
== Run the mirror ==
I prefer to place the CGIs in the same location where UCSC has them.
sudo apt-get install ptrace apache2
sudo mkdir -p /usr/local/apache/htdocs /usr/local/apache/cgi-bin
sudo vim /etc/apache2/sites-enabled/000-default
sudo mkdir /usr/local/apache/trash
# apache needs to be able to create images
chown www-data:www-data /usr/local/apache/trash
# the cgis create links to images in /trash
cd /usr/local/apache/htdocs
ln -s ../trash
# setup the custom trash dir in the same way
sudo mkdir /usr/local/apache/trash/customTrash
chown www-data:www-data /usr/local/apache/trash/customTrash
Paste these lines:
      DocumentRoot /usr/local/apache/htdocs
        <Directory />
                Options FollowSymLinks +Includes
                XBitHack on
                AllowOverride None
        </Directory>
        ScriptAlias /cgi-bin /usr/local/apache/cgi-bin
        <Directory "/usr/local/apache/cgi-bin">
                XBitHack on
                AllowOverride None
                Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch +Includes FollowSymLinks
                Order allow,deny
                Allow from all
        </Directory>
  sudo service apache2 restart
  mysql -u root -p (you chose the password during installation of the package)
  create database customTrash
  create database hgcentral
  quit
  cd /usr/local/apache/cgi-bin
  wget 'http://genome-source.cse.ucsc.edu/gitweb/?p=kent.git;a=blob_plain;f=src/product/ex.hg.conf;hb=HEAD' -O hg.conf
  vim hg.conf
Set the mysql connection to the public mysql server:
  db.host=genome-mysql.cse.ucsc.edu
  db.user=genomep
  db.password=password
  customTracks.host=localhost
  customTracks.user=root
  customTracks.password=<enter the password you defined during mysql installation here>
  customTracks.useAll=yes
  customTracks.tmpdir=/usr/local/apache/trash/customTrash
  central.db=hgcentral
  central.host=localhost
  central.user=root
  central.password=<your password again>
  central.domain=<you internet domain>


[[Category:User Developed Scripts]]
[[Category:User Developed Scripts]]
[[Category:Installation]]
[[Category:Installation]]

Revision as of 16:54, 10 September 2013

These binaries can also be used to run a local UCSC genome browser mirror.

Please note the instructions and scripts in the source tree that can build the kent source tree on any Linux system: src/product

These commands compile the UCSC genome browser and all source tools. They have been tested on Debian Lenny (64 and 32bit), Ubuntu Maverick and Ubuntu 13.04. They will put all binaries in /usr/local, all cgi-bins in /usr/lib/cgi-bin and all html-like things into /var/www/genome.

In theory, once you have installed the samtools library, you can just copy-paste this script into a command line

# we need to be root to install packages and put stuff into /usr/local
su 
# install required packages from repository
# please not that these won't install the samtools library to handle bam files
apt-get install mysql-server-5.0 apache2 libmysqlclient15-dev libpng12-dev libssl-dev openssl mysql-client-5.5  mysql-client-core-5.5
# set variables for compilation
export MYSQLLIBS="-lmysqlclient -lz"
export MACHTYPE=$(uname -m)
export MYSQLINC=/usr/include/mysql
DIRS='SCRIPTS=/usr/local/bin CGI_BIN=/usr/lib/cgi-bin DOCUMENTROOT=/var/www/genome BINDIR=/usr/local/bin'
# this does not seem to be necessary anymore
#ENCODE_PIPELINE_BIN=/usr/local/bin'

# download
cd /usr/local
wget http://hgdownload.cse.ucsc.edu/admin/jksrc.zip
unzip jksrc.zip
mkdir -p /var/www/genome/

# compile libraries
cd kent/src/lib
make  

cd ../jkOwnLib
make 

# compile browser
cd ..
make $DIRS

# set permissions
cd /home/data/www
chown apache:apache -R *

Add the parameter HG_WARN=-w to DIRS if you don't want the compilation to stop on error messages. Dirty, but it works. :-)


Run the mirror

I prefer to place the CGIs in the same location where UCSC has them.

sudo apt-get install ptrace apache2 sudo mkdir -p /usr/local/apache/htdocs /usr/local/apache/cgi-bin sudo vim /etc/apache2/sites-enabled/000-default sudo mkdir /usr/local/apache/trash

  1. apache needs to be able to create images

chown www-data:www-data /usr/local/apache/trash

  1. the cgis create links to images in /trash

cd /usr/local/apache/htdocs ln -s ../trash

  1. setup the custom trash dir in the same way

sudo mkdir /usr/local/apache/trash/customTrash chown www-data:www-data /usr/local/apache/trash/customTrash


Paste these lines:

      DocumentRoot /usr/local/apache/htdocs
       <Directory />
               Options FollowSymLinks +Includes
               XBitHack on
               AllowOverride None
       </Directory>
       ScriptAlias /cgi-bin /usr/local/apache/cgi-bin
       <Directory "/usr/local/apache/cgi-bin">
               XBitHack on
               AllowOverride None
               Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch +Includes FollowSymLinks
               Order allow,deny
               Allow from all
       </Directory>
 sudo service apache2 restart
 mysql -u root -p (you chose the password during installation of the package)
 create database customTrash
 create database hgcentral
 quit
 cd /usr/local/apache/cgi-bin
 wget 'http://genome-source.cse.ucsc.edu/gitweb/?p=kent.git;a=blob_plain;f=src/product/ex.hg.conf;hb=HEAD' -O hg.conf
 vim hg.conf

Set the mysql connection to the public mysql server:

 db.host=genome-mysql.cse.ucsc.edu
 db.user=genomep
 db.password=password
 customTracks.host=localhost
 customTracks.user=root
 customTracks.password=<enter the password you defined during mysql installation here>
 customTracks.useAll=yes
 customTracks.tmpdir=/usr/local/apache/trash/customTrash
 central.db=hgcentral
 central.host=localhost
 central.user=root
 central.password=<your password again>
 central.domain=<you internet domain>