Install VariantDB on local hardware
Prerequisites
- Operating system: Installation was tested on Ubuntu 12.04 LTS, 64bit.
- LAMP server with Perl: MySQL-databases can be located on remote servers.
- Mercurial : Used for installing the system
- Memcache (optional)
- ProFTPd (optional)
Install the VariantDB basics
- Clone the Installation Scripts: `hg clone https://bitbucket.org/medgenua/vdb_installer`
- Enter the cloned directory : `cd vdb_installer`
- Install databases: `sudo ./Install_databases.sh`
- Provide a mysql username and password to access VariantDB data. By default, a new user with random password is generated.
- Provide the mysql host that will host the VariantDB data
- Wild card access can be allowed to the VariantDB databases by using %
- Enter your mysql root password to generate the user.
- The program will now install a base version of the database
- DB-credentials are written to a file in the current folder: .dbpass.txt. Note them down for the next step.
- Install the web-interface: `sudo ./Install_Web_Interface.sh`
- Install dependencies : tofrodos is done automatically, others you have to agree for
- Install cpan Modules: done automatically. They are only installed if missing, not updated. Make sure to use the 'sudo' approach of cpan instead of local::lib if initial configuration is run. Otherwise, the modules might not be available to the dedicated runtime user!
- Provide Installation options (all documented in installer output)
- The system is downloaded (by mercurial) and installed
- The annotation databases are downloaded (from ucsc/annovar/snpEff). This totals in approximately 500Gb ! The first run installs a core set of annotations. Afterwards you get information on how to enable old and very large annotation sests, or how to install them anyway.
- Provide an email to perform administrative tasks.
- Provide a user to execute the annotation tasks. All VariantDB data will be owned by this user. By default, a new user with random password is generated.
- Provide the mysql user created in the previous step (install_databases) if asked. If you install databases and web from the same machine/folder, credentials are read in automatically. The credentials are available in the file .dbpass.txt
- An edit to sudoers.d is made to allow www-user to switch to the script user
- cgi-bin configuration is updated
- php.ini is updated
- You're done.
Tune Database
- VariantDB uses MyISAM databases. The following variables optimize the mysql server for large MyISAM tables.
- Open mySQL config file (/etc/mysql/my.cnf) on the databases server
- Edit the following settings to settings appriate for your server:
- [mysqld]
- key_buffer_size = 4048M
- max_allowed_packet = 512M
- thread_stack = 256K
- thread_cache_size = 8
- tmp_table_size = 2048M
- max_heap_table_size = 2048M
- bulk_insert_buffer_size = 128M
- connect_timeout = 15
- local_infile <= MANDATORY
- myisam_repair_threads = 4
- myisam_sort_buffer_size = 4048M
- open_files_limit = 8000
- query_cache_limit = 12M
- query_cache_size = 128M
- read_buffer_size = 16M
- read_rnd_buffer_size = 8M
- open_files_limit = 8000
- Restart MySQL server
Start Annotation Monitor
- The following script monitors triggers for new data and launches annotation jobs.
-
- open /etc/rc.local for editing (sudo vim /etc/rc.local)
- Just before 'exit 0', add the following line (%scriptuser% is listed in VariantDB/.Credentials/.credentials file):
su %scriptuser% -c 'cd /path_to/VariantDB/Web-Interface/Annotations/ && perl monitor.pl > /dev/null 2>&1 &'
- Reboot the system
Initialize VariantDB
- Go to your installation : http://<domain>/<path>
- Create the first user. This user will be a platform administrator
- Once you submit this form, access to VariantDB is activated for all users.
Set up ProFTPD
Note: Guidelines apply to Ubuntu 14.04 LTS
- Install Proftp (version ≥ 1.3.4) and mysql module : apt-get install proftpd proftpd-mod-mysql
- Activate mysql modules in /etc/proftpd/proftpd.conf:
LoadModule mod_sql.c
LoadModule mod_sql_mysql.c
LoadModule mod_sql_passwd.c
- Add to the /etc/proftpd/proftpd.conf:
# chroot users to their homes
DefaultRoot ~
# Create home directories as needed, using chmod 755
# chmod 755 is set to make them www-user readable. Adapt to use groups
CreateHome on 755 dirmode 755
#activate mysql backend
SQLEngine on
SQLBackend mysql
# Set up mod_sql_password - VariantDB passwords are stored as sha1-encoded
SQLPasswordEngine on
SQLPasswordEncoding hex
AuthOrder mod_sql.c
# adapt 'NGS-Variants".$_SESSION['dbname']."' after a Genome Build update
SQLConnectInfo NGS-Variants-hg19@<DB-HOST> <DBUSER> <DBPASS>
SQLAuthTypes SHA1
SQLAuthenticate users
# set default homedir to some existing folder. It's not actually used.
SQLDefaultHomedir /tmp
# define the query to authenticate users against VariantDB database.
SQLUserInfo custom:/LookupVariantDBUser
SQLNamedQuery LookupVariantDBUser SELECT "email, password_sha1, '<scriptuser_UID>', '<scriptuser_GID>', '<path_to_variant_db_ftp-data>/%U', '/bin/bash' FROM Users WHERE email = '%U'"
- The parameters to replace are found in /<VariantDB>/.Credentials/.credentials file
- Restart proftpd : sudo /etc/init.d/proftpd restart
- Set the following lines in /VariantDB/.Credentials/.credentials
FTP=1
FTP_HOST=YOUR FTP SERVER IP/NAME
FTP_PORT=YOUR FTP SERVER PORT
FTP_DATA=/path/to/the/ftp/data/base/dir