こちらを参照: https://wiki.galaxyproject.org/Admin/Config/ApacheProxy
まず、サーバー名を設定しておく。これが誤っているとうまくRewriteされない。
$ sudo vi /etc/httpd/conf/http.conf
ServerName 192.168.56.10:80
Rewrite により /galaxy/ で参照できるようにする
$ sudo vi /etc/httpd/conf/http.conf
RewriteEngine on
RewriteRule ^/galaxy$ /galaxy/ [R]
RewriteRule ^/galaxy(.*)
http://localhost:8080$1
[P]
静的コンテンツを Http サーバーで扱うようにすることができるが、今回、権限エラー(You don’t have permission to access)が出たので設定していない。未調査。
$ sudo vi /etc/httpd/conf/http.conf
RewriteRule ^/galaxy/static/style/(.*) /home/nate/galaxy-dist/static/june_2007_style/blue/$1 [L]
RewriteRule ^/galaxy/static/scripts/(.*) /home/nate/galaxy-dist/static/scripts/packed/$1 [L]
RewriteRule ^/galaxy/static/(.*) /home/nate/galaxy-dist/static/$1 [L]
RewriteRule ^/galaxy/favicon.ico /home/nate/galaxy-dist/static/favicon.ico [L]
RewriteRule ^/galaxy/robots.txt /home/nate/galaxy-dist/static/robots.txt [L]
Galaxy 側の設定
$ vi ~/galaxy-dist/config/galaxy.ini
[filter:proxy-prefix]
use = egg:PasteDeploy#prefix
prefix = /galaxy
[app:main]
filter-with = proxy-prefix
cookie_path = /galaxy
それぞれ再起動
$ sudo service httpd restart
$ sudo service galaxy restart
python ~/galaxy-dist/scripts/api/install_tool_shed_repositories.py -a 126a89c98a5d1a2c234edf2651024a03 -l
http://localhost:8080
-u
https://testtoolshed.g2.bx.psu.edu/
-n tool_shed_test_1 -o pitagora-mak -r 3bbc8d428ef1 --panel-section-name
“Variant
Call
” --repository-deps --tool-deps
Galaxy に BAM ファイルをアップロードすると、自動的に BAM インデックスを作成する。この際、samtools コマンドが実行されるため、パスに samtools を追加しておく必要がある。ここでは、Tool Shed 経由でインストールされている samtools を参照させているが、Galaxy 必須のコマンドと考えて Galaxy のインストール手順に含めるのがよいかもしれない。
$ vi .bash_profile
export PATH=$HOME/tool_dependency/samtools/0.1.19/devteam/package_samtools_0_1_19/95d2c4aefb5f/bin:$PATH
$ . .bash_profile
$ vi ~/galaxy-dist/static/welcome.html
<br/>
<p><b>ピタゴラ・ギャラクシーへようこそ!</b></p>
<p>上のメニューから User > Login と進み、次のどちらかのユーザーでログインしてください。</p>
<ul>
<li>・管理用ユーザー: admin@pitagora-galaxy.org (password: galaxy) </li>
<li>・通常のユーザー: test@pitagora-galaxy.org (password: galaxy)</li>
</ul>
<br/>
sudo wget
http://ftp-srv2.kddilabs.jp/Linux/distributions/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm
sudo rpm -ivh epel-release-6-8.noarch.rpm
sudo yum -y install pam_mysql
$ sudo vi /etc/vsftpd/vsftpd.conf
guest_enable=YES
guest_username=galaxy
local_root=/home/galaxy/galaxy-dist/database/ftp/$USER
user_sub_token=$USER
virtual_use_local_privs=YES # galaxyユーザーとしての書き込み権限
chroot_local_user=YES # ルートディレクトリをユーザーのホームに設定
sudo /etc/init.d/vsftpd restart
sudo chkconfig vsftpd on
sudo chkconfig --list vsftpd
#%PAM-1.0
auth required pam_mysql.so user=galaxy passwd=galaxy host=localhost db=galaxy table=galaxy_user usercolumn=email passwdcolumn=password crypt=4
account required pam_mysql.so user=galaxy passwd=galaxy host=localhost db=galaxy table=galaxy_user usercolumn=email passwdcolumn=password crypt=4
ftp_upload_dir = /home/galaxy/galaxy-dist/database/ftp
ftp_upload_site = 192.168.56.10
[app:main]
use_pbkdf2 = False
これを設定した後に作成されたユーザーのパスワードに適用される
cd ~/galaxy-dist
rm database
mkdir database
sudo mount --bind /disk/database /home/galaxy/galaxy-dist/database
sudo vi /etc/fstab
/disk/database /home/galaxy/galaxy-dist/database none bind 0 0
sudo -u galaxy mkdir -p /home/galaxy/galaxy-dist/database/ftp/
sudo wget http://ftp-srv2.kddilabs.jp/Linux/distributions/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm
sudo rpm -ivh epel-release-6-8.noarch.rpm
sudo yum --enablerepo=epel -y install proftpd proftpd-mysql
sudo yum -y install mysql-devel
ftp_upload_dir = /home/galaxy/galaxy-dist/database/ftp
ftp_upload_site = 192.168.56.10
[app:main]
use_pbkdf2 = False
これを設定した後に作成されたユーザーのパスワードに適用される
rm database
mount --bind /disk/database /home/galaxy/galaxy-dist/database
# Common SQL authentication options
SQLEngine on
SQLPasswordEngine on
SQLBackend mysql
SQLConnectInfo galaxy@localhost:3306 galaxy galaxy
SQLAuthenticate users
# Set up mod_sql/mod_sql_password - Galaxy passwords are stored as hex-encoded SHA1
SQLAuthTypes SHA1
SQLPasswordEncoding hex
# An empty directory in case chroot fails
SQLDefaultHomedir /var/opt/local/proftpd
# Define a custom query for lookup that returns a passwd-like entry. Replace 512s with the UID and GID of the user running the Galaxy server
SQLUserInfo custom:/LookupGalaxyUser
SQLNamedQuery LookupGalaxyUser SELECT "email,password,500,500,'/home/galaxy/galaxy-dist/database/ftp/%U','/bin/bash' FROM galaxy_user WHERE email='%U'"
sudo service proftpd restart
起動は問題なしだが、接続できなかった!
Command: USER test2@pitagora-galaxy.org
Response: 331 Password required for test2@pitagora-galaxy.org
Command: PASS ******
Response: 530 Login incorrect.
Error: Critical error: Could not connect to server
$ cd ~/galaxy-dist
$ ./run.sh --stop
$ rm database
$ mv database_bak database
$ hg pull
$ hg update --clean
$ hg update latest_2015.01.13
$ ./run.sh
$ rm -rf /disk/database/*
$ cp -r database/* /disk/database
$ mv database database_bak
$ ln -s /disk/database
$ ./run.sh --daemon
$ git clone
https://github.com/pitagora-galaxy/install-0.2.3.git
$ sh ~/install-0.2.3/scripts/install-tools.sh
$ cp ~/install-0.2.3/config/tool_data_table_conf.xml ~/galaxy-dist/config/
$ cp ~/install-0.2.3/tool-data/*.loc ~/galaxy-dist/tool-data/
ACPI シャットダウンを可能にする
$ sudo yum install acpid
$ sudo service acpid start
$ sudo chkconfig acpid on
$ sh ~/install-0.2.2/scripts/install-tools.sh
$ cp ~/install-0.2.2/config/tool_data_table_conf.xml ~/galaxy-dist/config/
$ cp ~/install-0.2.2/tool-data/*.loc ~/galaxy-dist/tool-data/
# set | grep LANG
LANG=ja_JP.UTF-8
# vi /etc/profile
export LANG=en_US.UTF-8
# source /etc/profile
# set | grep LANG
LANG=en_US.UTF-8
DEVICE=eth1
TYPE=Ethernet
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=dhcp
DEVICE=eth0
TYPE=Ethernet
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=none
IPADDR=192.168.56.10
NETMASK=255.255.255.0
GATEWAY=192.168.56.1
# vi /etc/rc.d/rc.local
echo > /etc/resolv.conf
ifdown eth0
ifup eth0
# useradd galaxy
# passwd galaxy
(galaxy)
$ su -
# visudo
%wheel ALL=(ALL) ALL
%wheel ALL=(ALL) NOPASSWD: ALL
# usermod -G wheel galaxy
$ sudo vi /etc/selinux/config
SELINUX=disabled
$ sudo reboot
$ getenforce
Disabled
$ sudo chkconfig iptables off
$ sudo chkconfig ip6tables off
$ sudo chkconfig --list
$ sudo reboot
$ sudo yum install -y \
vim wget gcc sqlite-devel zlib-devel bzip2-devel openssl-devel git vsftpd mysql-server \
php php-mbstring php-mysql java gcc-c++ gcc-gfortran
# exit
$ mkdir galaxy-python
$ cd galaxy-python
$ wget http://www.python.org/ftp/python/2.7.9/Python-2.7.9.tgz
$ mkdir install
$ tar xvzf Python-2.7.9.tgz
$ cd Python-2.7.9
$ ./configure --prefix=/home/galaxy/galaxy-python/install
$ make
$ make install
$ which python
/usr/bin/python
$ cd
$ .bash_profile
export PATH=$HOME/galaxy-python/install/bin:$PATH
export PYTHONPATH=$HOME/galaxy-python/install/lib/python2.7/site-packages
$ source .bash_profile
$ which python
~/galaxy-python/install/bin/python
$ python --version
Python 2.7.9
$ cd ~/galaxy-python
$ wget "https://bootstrap.pypa.io/get-pip.py"
$ python get-pip.py
$ pip install mercurial
$ cd ~
$ hg clone
https://bitbucket.org/galaxy/galaxy-dist/
$ cd galaxy-dist
$ ./run.sh
$ tail -f paster.log
..
..
serving on 0.0.0.0:8080 view at
http://127.0.0.1:8080
$ cd ~
$ git clone
https://github.com/pitagora-galaxy/install.git
$ cp ~/install/galaxy.ini ~/galaxy-dist/config/
(元々の方法)
$ cd ~/galaxy-dist/config
$ cp galaxy.ini.sample galaxy.ini
$ vi galaxy.ini
host = 0.0.0.0
admin_users = admin@pitagora-galaxy.org
tool_dependency_dir = ../tool_dependency
allow_user_dataset_purge = True
$ sudo cp ~/install/galaxy-init.sh /etc/init.d/galaxy
$ sudo chmod 755 /etc/init.d/galaxy
$ sudo service httpd start
$ sudo service mysqld start
$ sudo service galaxy start
$ sudo chkconfig galaxy on
$ sudo chkconfig httpd on
$ sudo chkconfig mysqld on
$ sudo chkconfig --list
galaxy 0:off 1:off 2:on 3:on 4:on 5:on 6:off
httpd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
mysqld 0:off 1:off 2:on 3:on 4:on 5:on 6:off
$ sudo mysql
mysql> SET PASSWORD FOR root@localhost=PASSWORD('galaxy');
Query OK, 0 rows affected (0.00 sec)
mysql> exit
# mysql -u root
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
# mysql -u root -p
Enter password:
...
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
$ sudo chown galaxy:galaxy /var/www/html
$ cd /var/www/html/
$ wget
http://
...
$ tar xvzf phpMyAdmin-4.0.10.8-all-languages.tar.gz
$ mv phpMyAdmin-4.0.10.8-all-languages phpmyadmin
$ mkdir phpmyadmin/config
$ chmod 777 phpmyadmin/config
$ mv phpmyadmin/config/config.inc.php phpmyadmin/config.inc.php
$ rmdir phpmyadmin/config
$ mysql -u root -pgalaxy
mysql> CREATE DATABASE galaxy DEFAULT CHARACTER SET utf8;
mysql> CREATE USER 'galaxy'@'localhost' IDENTIFIED BY 'galaxy';
mysql> GRANT ALL ON galaxy.* TO 'galaxy'@'localhost';
$ mysql -u galaxy -pgalaxy -D galaxy
$ vi ~/galaxy-dist/config/galaxy.ini
#database_connection = sqlite:///./database/universe.sqlite?isolation_level=IMMEDIATE
database_connection = mysql://galaxy:galaxy@localhost:3306/galaxy?unix_socket=/var/lib/mysql/mysql.sock
#database_engine_option_pool_recycle = -1
database_engine_option_pool_recycle = 7200
$ ~/galaxy-restart.sh
$ vi ~/galaxy-dist/static/scripts/galaxy.masthead.js
'
Pitagora-Galaxy ' + brand_text + '
' +
$ vi ~/galaxy-dist/templates/webapps/galaxy/base_panels.mako
<%def name=
“title()
”>Pitagora-Galaxy</%def>
$ cd ~/galaxy-dist/static
$ rm favicon.ico
$ wget
http://download.pitagora-galaxy.org/data/resource/favicon.ico
$ cd ~/galaxy-dist/static/images
$ rm galaxyIcon_noText.png
$ wget
http://download.pitagora-galaxy.org/data/resource/galaxyIcon_noText.png
$ sudo mkfs -t ext4 /dev/sdb
$ sudo mkfs -t ext4 /dev/sdc
$ sudo mkdir -p /disk/reference
$ sudo mkdir -p /disk/database
$ sudo vi /etc/fstab
/dev/sdb /disk/reference ext4 defaults 0 0
/dev/sdc /disk/database ext4 defaults 0 0
$ sudo mount -a
$ sudo chown galaxy:galaxy /disk/reference
$ sudo chown galaxy:galaxy /disk/database
$ cd ~/galaxy-dist
$ cp -r database/* /disk/database
$ mv database database_bak
$ ln -s /disk/database
$ sh ~/install/install-tools.sh
$ cp ~/install/config/tool_data_table_conf.xml ~/galaxy-dist/config/
$ cp ~/install/tool-data/*.loc ~/galaxy-dist/tool-data/
$ cd /var/www/html
$ git clone https://github.com/pitagora-galaxy/filebrowser
$ cd filebrowser
$ mysql -u root -pgalaxy
mysql> source sql/setup.sql
mysql> source sql/sample.sql
mysql> GRANT ALL ON filebrowser_03.* TO 'galaxy'@'localhost';
mysql> exit