CentOS 7.7 服务器搭建

更新CentOS国内的163源

wget http://mirrors.163.com/.help/CentOS7-Base-163.repo
cp CentOS7-Base-163.repo /etc/yum.repos.d/
cd /etc/yum.repos.d/
mv CentOS-Base.repo CentOS-Base.repo.bak
mv CentOS7-Base-163.repo CentOS-Base.repo
yum clean all
yum makecache
yum update

修改主机名

hostnamectl set-hostname primary.ccdev.com

安装fish shell

yum-config-manager --add-repo https://download.opensuse.org/repositories/shells:fish:release:2/CentOS_7/shells:fish:release:2.repo
yum install fish -y

安装docker

mount以前存在的数据盘

重建数据目录(要和原来的同名)

mkdir /data
mkdir /data/ssd0
mkdir /data/ssd1

编辑配置文件
重启服务器

安装VNC

安装Docker

yum install -y yum-utils
device-mapper-persistent-data
lvm2

yum-config-manager
--add-repo
https://download.docker.com/linux/centos/docker-ce.repo

yum install docker-ce docker-ce-cli containerd.io

systemctl start docker

systemctl enable docker

定制指定位置存Docker数据

87 mkdir /data/ssd0/docker-data
88 service docker stop
89 ls /data/ssd0/docker-data/
90 cp -r /var/lib/docker/* /data/ssd0/docker-data/
91 docker info
92 vim /etc/docker/daemon.json
93 systemctl start docker

安装 Nexus

docker run -d -p 8081:8081 --name nexus -v /data/ssd0/nexus-data:/nexus-data sonatype/nexus3

安装 DNS服务器

docker start mailserver
reboot
getenforce
setenforce 0
systemctl stop firewalld
firewall-cmd --reload 
firewall-cmd --permanent --add-port=25/tcp
firewall-cmd --reload 
firewall-cmd --permanent --add-port=465/tcp
firewall-cmd --permanent --add-port=993/tcp
firewall-cmd --permanent --add-port=995/tcp
firewall-cmd --permanent --add-port=143/tcp
firewall-cmd --permanent --add-port=443/tcp
firewall-cmd --permanent --add-port=80/tcp
firewall-cmd --permanent --add-port=110/tcp
firewall-cmd --permanent --add-service=smtp
curl http://127.0.0.1/webmail
curl http://127.0.0.1
docker start mailserver
curl http://127.0.0.1
curl 127.0.0.1
sudo docker run \
    --net=host \
    -v /etc/localtime:/etc/localtime:ro \
    -v /mail/data:/data \
    --name "mailserver" \
    -h "mail.ccdev.com" \
    -t analogic/poste.io
docker rm mailserver
curl http://192.168.3.11
curl 192.168.3.11
docker run \
    --net=host \
    -v /etc/localtime:/etc/localtime:ro \
    -v /mail/data:/data \
    --name "mailserver" \
    -h "mail.ccdev.com" \
    -t analogic/poste.io
dig www.ccdev.com
systemctl restart NetworkManager.service 
vim ifcfg-ens33 
ls
vim /etc/resolv.conf
vim /etc/hosts
mkdir /mail/data
mkdir /mail
systemctl status named.service
systemctl restart named
vim /var/named/fwd.ccdev.com.db
vim /var/named/3.168.192.db
vim /var/named/1.168.192.db
mv /var/named/1.168.192.db /var/named/3.168.192.db
vim /etc/named.conf
ifconfig
journalctl -xe
hostname
host
name
hostnamectl set-hostname primary.ccdev.com
nameserver 192.168.1.11
firewall-cmd --reload
firewall-cmd --permanent --add-port=53/udp
gedit /etc/named.conf
ifconfig 
yum -y install bind bind-utils
docker ps -a
doker ps -a
Server status
dockerps -a
docker ps
systemctl enable docker
systemctl start docker
yum install docker-ce docker-ce-cli containerd.io
yum-config-manager \
    --add-repo \
    https://download.docker.com/linux/centos/docker-ce.repo
yum install -y yum-utils \
  device-mapper-persistent-data \

你可能感兴趣的:(CentOS 7.7 服务器搭建)