||
Installing a Browser Mirror on Linux Red Hat
#环境:Red Hat Enterprise Linux Server release 6.2 (Santiago);Linux version 2.6.32-220.el6.x86_64
#安装Mysql数据库。
yum -y install mysql-server
#新建一个用户。mysql –u 用户名 –p 密码
create user 'user'@'localhost' identified by 'PASSWORD';
grant all privileges on hg19.* to 'user'@'localhost'
flush privileges;
#安装Apache。
yum -y install httpd
sudo service apache2 restart
sudo yum install libssl0.9.8
sudo ln -s /usr/lib/libssl.so.0.9.8 /usr/lib/libssl.so.6
sudo ln -s /usr/lib/libcrypto.so.0.9.8 /usr/lib/libcrypto.so.6
sudo mkdir /var/www/genomebrowser
sudo rsync -avzP rsync://hgdownload.cse.ucsc.edu/htdocs/ /var/www/genomebrowser/
sudo mkdir -p /var/www/genomebrowser/cgi-bin
sudo rsync -avzP rsync://hgdownload.cse.ucsc.edu/cgi-bin/ /var/www/genomebrowser/cgi-bin/
sudo chown -R 755 /var/www/genomebrowser/cgi-bin/
sudo chown -R 755 /var/www/genomebrowser/
sudo rm /var/www/genomebrowser/trash
sudo mkdir /var/www/genomebrowser/trash
sudo chown -R 755 /var/www/genomebrowser/trash
sudo mkdir -p /usr/local/apache/htdocs/
sudo ln -s /var/www/genomebrowser/js/ /usr/local/apache/htdocs/js
sudo ln -s /var/www/genomebrowser/style/ /usr/local/apache/htdocs/style
gedit /var/www/genomebrowser/cgi-bin/hg.conf
# Configuration file for the UCSC Human Genome server
defaultGenome=Human
browser.documentRoot=/var/www/genomebrowser
# the format is in the form of name/value pairs, written as 'name=value'
# note that there is no space between the name and its value. Also, no blank lines #should be in this file.
# db.host is the name of the MySQL host to connect to
db.host=localhost
# db.user is the username used when connecting to the host
db.user=user
# this is the password to use with the above hostname
db.password=PASSWORD
db.trackDb=trackDb
# central.host is the name of the host of the central MySQL
# database where stuff common to all versions of the genome
# and the user database is stored.
central.db=hgcentral
central.host=localhost
central.user=user
central.password=PASSWORD
central.domain=
backupcentral.db=hgcentral
backupcentral.host=localhost
backupcentral.user=user
backupcentral.password=PASSWORD
backupcentral.domain=
sudo chown -R 755 /var/www/genomebrowser/cgi-bin/hg.conf
#配置Apache服务器,使下载的html、cgi-bin可以正常显示。gedit /usr/local/apache/conf/httpd.conf
###########################以下为添加的内容#####################Setting for genomebrowser in httpd.conf
#Enable SSI
XBitHack on
<Directory /var/www/genomebrowser/>
AllowOverride AuthConfig
Options Indexes FollowSymLinks MultiViews Includes
Order allow,deny
allow from all
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
</Directory>
#Enable CGI
ScriptAlias /genomebrowser/cgi-bin/ "/var/www/genomebrowser/cgi-bin/"
<Directory "/var/www/genomebrowser/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
AddHandler cgi-script cgi pl
</Directory>
#重启apache2服务器
sudo service apache2 restart
#若此时出现CGI "Internal Server Error" 错误,则可以通过更改/var/www/genomebrowser/cgi-bin/的权限来解决chmod 755 -R /var/www/genomebrowser/cgi-bin
sudo service apache2 restart
sudo chown -R mysql:mysql /var/lib/mysql
#重启mysqlsudo service mysql restart
#此时可以看到genomebrowser,如果显示不正常,导航栏异常,原因在于Redhat下Apache没有默认地读取htdocs(Ubuntu下Apache默认是读htdocs的)cp -R /var/www/genomebrowser/style /var/www/
cp -R /var/www/genomebrowser/js /var/www/
chmod 777 -R /var/www/genomebrowser/trash/
#如果遇到导航栏中某些链接指向www/cgi-bin的问题(因为默认的UCSC浏览器是放在www下的),目前比较保守的解决办法是将genomebrowser/cgi-bin下的文件复制到www/cgi-bin(注意此方法并未完全解决链接问题)cp -Rf /var/www/genomebrowser/cgi-bin/* /var/www/cgi-bin/
#建立Mysql tables。wget http://hgdownload.cse.ucsc.edu/admin/hgcentral.sql
mysql -u root -p -e "create database hgcentral"
mysql -u root -p hgcentral < /home/download/hgcentral.sql
mysql -u root -p -e "grant all privileges on hgcentral.* to 'user'@'localhost'"
mysql -u root -p -e "create database hgFixed"
mysql -u root -p -e "grant select on hgFixed.* to 'user'@'localhost'"
sudo mkdir /var/lib/mysql/hg19
sudo rsync -avzP rsync://hgdownload.cse.ucsc.edu/mysql/hg19/ /var/lib/mysql/hg19
sudo rsync -avzP rsync://hgdownload.cse.ucsc.edu/mysql/hg19/grp.MYD /var/lib/mysql/hg19
sudo rsync -avzP rsync://hgdownload.cse.ucsc.edu/mysql/hg19/grp.MYI /var/lib/mysql/hg19
sudo rsync -avzP rsync://hgdownload.cse.ucsc.edu/mysql/hg19/grp.frm /var/lib/mysql/hg19
sudo rsync -avzP rsync://hgdownload.cse.ucsc.edu/mysql/hg19/trackDb.MYD /var/lib/mysql/hg19
sudo rsync -avzP rsync://hgdownload.cse.ucsc.edu/mysql/hg19/trackDb.MYI /var/lib/mysql/hg19
sudo rsync -avzP rsync://hgdownload.cse.ucsc.edu/mysql/hg19/trackDb.frm /var/lib/mysql/hg19
sudo rsync -avzP rsync://hgdownload.cse.ucsc.edu/mysql/hg19/hgFindSpec.MYD /var/lib/mysql/hg19
sudo rsync -avzP rsync://hgdownload.cse.ucsc.edu/mysql/hg19/hgFindSpec.MYI /var/lib/mysql/hg19
sudo rsync -avzP rsync://hgdownload.cse.ucsc.edu/mysql/hg19/hgFindSpec.frm /var/lib/mysql/hg19
sudo rsync -avzP rsync://hgdownload.cse.ucsc.edu/mysql/hg19/chromInfo.MYD /var/lib/mysql/hg19
sudo rsync -avzP rsync://hgdownload.cse.ucsc.edu/mysql/hg19/chromInfo.MYI /var/lib/mysql/hg19
sudo rsync -avzP rsync://hgdownload.cse.ucsc.edu/mysql/hg19/chromInfo.frm /var/lib/mysql/hg19
sudo rsync -avzP rsync://hgdownload.cse.ucsc.edu/mysql/hg19/gold.MYD /var/lib/mysql/hg19
sudo rsync -avzP rsync://hgdownload.cse.ucsc.edu/mysql/hg19/gold.MYI /var/lib/mysql/hg19
sudo rsync -avzP rsync://hgdownload.cse.ucsc.edu/mysql/hg19/gold.frm /var/lib/mysql/hg19
sudo rsync -avzP rsync://hgdownload.cse.ucsc.edu/mysql/hg19/gap.MYD /var/lib/mysql/hg19
sudo rsync -avzP rsync://hgdownload.cse.ucsc.edu/mysql/hg19/gap.MYI /var/lib/mysql/hg19
sudo rsync -avzP rsync://hgdownload.cse.ucsc.edu/mysql/hg19/gap.frm /var/lib/mysql/hg19
sudo rsync -avzP rsync://hgdownload.cse.ucsc.edu/mysql/hg19/oregannoAttr.MYD /var/lib/mysql/hg19
sudo rsync -avzP rsync://hgdownload.cse.ucsc.edu/mysql/hg19/oregannoAttr.MYI /var/lib/mysql/hg19
sudo rsync -avzP rsync://hgdownload.cse.ucsc.edu/mysql/hg19/oregannoAttr.frm /var/lib/mysql/hg19
sudo rsync -avzP rsync://hgdownload.cse.ucsc.edu/mysql/hg19/refLink.MYD /var/lib/mysql/hg19
sudo rsync -avzP rsync://hgdownload.cse.ucsc.edu/mysql/hg19/refLink.MYI /var/lib/mysql/hg19
sudo rsync -avzP rsync://hgdownload.cse.ucsc.edu/mysql/hg19/refLink.frm /var/lib/mysql/hg19
sudo rsync -avzP rsync://hgdownload.cse.ucsc.edu/mysql/hgFixed/ /var/lib/mysql/hgFixed
sudo rsync -avzP rsync://hgdownload.cse.ucsc.edu/mysql/uniProt/ /var/lib/mysql/uniProt/sp120323/
sudo rsync -avzP rsync://hgdownload.cse.ucsc.edu/mysql/swissProt/ /var/lib/mysql/uniProt/sp111004/
sudo rsync -avzP rsync://hgdownload.cse.ucsc.edu/mysql/proteome/ /var/lib/mysql/proteinDB/proteins120806/
sudo rsync -avzP rsync://hgdownload.cse.ucsc.edu/mysql/proteins/ /var/lib/mysql/proteinDB/proteins111004/
sudo mkdir /gbdb
chmod 755 -R /gbdb
sudo rsync -avzP rsync://hgdownload.cse.ucsc.edu/gbdb/hg19/ /gbdb/hg19/
sudo ln -s /var/run/mysqld/mysqld.sock /var/lib/mysql/mysql.sock
sudo chmod 666 /var/lib/mysql/mysql.sock
sudo chmod 755 /var/lib/mysql/
4、如果已经下载了本地化相关的大量文件,完全可以通过复制的办法来重新本地化,无需再次从UCSC网站下载。
5、如果本地根目录空间太小,无法存放mysql和gbdb两个超级文件夹,可以通过软链接(ln)的方式将其转移至较大的空间内。
(1)转移mysql目录:
cp -aR /var/lib/mysql/. /pub3/mysql
cd /var/lib/
mv mysql mysql_bei #将原有的mysql重命名,作为备份以防万一,同时也为成功做软链接做准备
ln -s /pub3/mysql /var/lib/mysql
chown -R mysql:mysql /pub3/mysql
service mysql start
cp -aR /gbdb/. /pub3/gbdb
mv gbdb gbdb_bei #以防万一
ln -s /pub3/gbdb /gbdb
其他供参考的UCSC本地化教程:
UCSC Genome Browser 本地化官方指南 (详细wiki)
UCSC Genome Browser 本地化Google论坛
UCSC Genome Browser 本地安装指南 by 卢金龙
UCSC Genome Browser 本地化安装指南(Ubuntu)by 吕杰
For any more questions, please contact hongbo919@gmail.com.
Archiver|手机版|科学网 ( 京ICP备07017567号-12 )
GMT+8, 2024-12-27 01:02
Powered by ScienceNet.cn
Copyright © 2007- 中国科学报社