CentOS 7 安裝後要裝的東西
[FIX]yum無法update
dhclient
yum update
[FIX]設定時區
* sudo ln -sf /usr/share/zoneinfo/Asia/Taipei /etc/localtime
查看時間
date
校時
* yum -y install ntp # 安裝校時工具
* ntpdate time.stdtime.gov.tw #校時
* hwclock -w # 寫入BIOS
* date ; hwclock -r # 比對系統及 BIOS 時間
[安裝]1. fail2ban
sudo yum install epel-release1
sudo yum install epel-release
2.安裝fail2ban
sudo yum install fail2ban
3.設定啟動時開啟fail2ban (fail2ban start on boot)
sudo systemctl enable fail2ban
4.啟動fail2ban
sudo systemctl start fail2ban
5.修改 vi /etc/ssh/sshd_config
* port {port} #port
* AllowUsers {user1 user2} #允許使用者
* PermitRootLogin no #限制 root 登入
[安裝]2. docker
https://docs.docker.com/engine/installation/linux/docker-ce/centos/
1.增加docker repo
$ sudo yum install -y yum-utils \
device-mapper-persistent-data \
lvm2
$ sudo yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo
2.安裝docker
$ sudo yum install docker-ce
$ yum list docker-ce --showduplicates | sort -r
安裝版本
*注意看你要裝的版本
$
sudo yum install docker-ce-17.12.0.ce
$
sudo systemctl enable docker
$
sudo systemctl start docker
4.測試sudo docker run hello-world
5.修改預設DOCKER 檔案區域
systemctl stop docker
vi /etc/docker/daemon.json
{ "graph":"/18T/dev/docker_iso" }
systemctl start docker
測試完成
其他node sql系列 等等的都在docker做
sudo chmod +x /usr/local/bin/docker-compose
補充 docker compose 安裝
sudo curl -L https://github.com/docker/compose/releases/download/1.21.2/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
docker-compose --version
[安裝]3. git
$ sudo yum install git