---
# System prepended metadata

title: 建置Galaxy

---

# 建置Galaxy
0. 設定可以用密碼登入
vi /etc/ssh/sshd_config
PasswordAuthentication yes


systemctl restart sshd
systemctl restart ssh
sudo su
passwd ubuntu

1. 新增機器 Ubuntu 20.04
2. 掛載資料硬碟/初始化
sudo mkfs -t ext4 /dev/vdb
sudo mount /dev/vdb /srv
sudo chmod 777 /srv
sudo vim /etc/fstab
新增 /dev/vdb /srv ext4 defaults,nofail,x-systemd.device-timeout=1m
sudo apt update
sudo apt upgrade -y
sudo reboot now
3. 新增80到安全性群組 (TWCC後台)
sudo ufw allow ssh
sudo ufw allow http
sudo ufw allow https
sudo ufw enable
4. 設定DNS/SSL
https://man.twcc.ai/@twccdocs/howto-vcs-lb-build-secure-web-handle-high-traffic-zh/https%3A%2F%2Fman.twcc.ai%2F%40twccdocs%2Fhowto-vcs-lb-build-secure-web-handle-high-traffic-intro-zh
sudo apt-get install -y nginx
sudo apt-get install -y python3-certbot-nginx
sudo certbot --nginx -d {剛剛申請的DNS}
5. 下載galaxy
cd /srv
git clone -b release_22.01 https://github.com/galaxyproject/galaxy.git
cd galaxy
cp config/galaxy.yml.sample config/galaxy.yml
6. 修改galaxy.yml
![](https://i.imgur.com/DMANQlY.png)


設定管理員email
admin_users:{管理員email}
設定需要登入
require_login: true

7. 運行galaxy 安裝需要的套件 (過程會有點久)
sh run.sh

8. 修改nginx
sudo vim /etc/nginx/sites-available/default
![](https://i.imgur.com/OLM9SeO.png)

 (這時候galaxy服務已經可以上線)
 
9. 修改galxay多工
cp config/job_conf.xml.sample_basic config/job_conf.xml
(根據機器規格修改裡面參數)

10. 安裝必要功能

注意!有幾個額外的東西要先安裝
sudo apt install -y build-essential libncurses5-dev zlib1g-dev libbz2-dev liblzma-dev

wget https://github.com/samtools/samtools/releases/download/1.15.1/samtools-1.15.1.tar.bz2

wget https://github.com/samtools/bcftools/releases/download/1.15.1/bcftools-1.15.1.tar.bz2

wget https://github.com/samtools/htslib/releases/download/1.15.1/htslib-1.15.1.tar.bz2

![](https://i.imgur.com/1TyFapM.png)

export PAHT=/srv/tools/samtools/bin:$PATH
export PAHT=/srv/tools/bcftools/bin:$PATH
export PAHT=/srv/tools/htslib/bin:$PATH

都安裝完成之後 把export xxx放到 run.sh裡面


11. 設定完成之後就可以提供服務了

sh run.sh




