1:搭建http仓库
yum install -y httpd
echo $?
systemctl start httpd
ps -ef|grep httpd
ss -antl
ls /var/www/html
cd /var/www/html
mkdir lin.d
mount /dev/sr0 /mnt
cp -r /mnt/* /var/www/html/lin.d
vi /etc/yum.repos.d/haha.repo
【haha】
name=haha
baseurl=http://192.168.118.100/lin.d
enable=1
gpgcheck=0
mv /etc/yum.repos.d /haha.repo
yum clean all
iptables -L
getenforce
setenforce 0
iptables -F
iptables -X
iptables -Z
systemctl stop firewalld.service
netstat -nltp | grep 80
2:添加3块5G硬盘做lvm,2块新建,1块做扩展
181 lsblk
fdisk /dev/sdb
fdisk /dev/sdc
fdisk /dev/sdd
pvcreate /dev/sdb1
pvcreate /dev/sdc1
pvcreate /dev/sdd1
pvs
vgcreate vg1 /dev/sdb1
vgcreate vg2 /dev/sdc1
vgcreate vg3 /dev/sdd1
vgs
lvcreate -L 1G -n lv1 vg1
lvcreate -L 1G -n lv2 vg2
lvcreate -L 1G -n lv3 vg3
lvscan
mkfs.ext4 /dev/vg1/lv1
mkfs.ext4 /dev/vg2/lv2
mkfs.ext4 /dev/vg3/lv3
mkdir h1
mkdir h2
mkdir h3
ls
mount /dev/vg1/lv1 h1
mount /dev/vg2/lv2 h2
mount /dev/vg3/lv3 h3
df
lvextend -L +1G /dev/vg3/lv3
lsblk
3:添加2块网卡做bond5聚合
nmcli connection
nmcli device
nmcli connection add type bond con-name bond5 ifname bond5 mode balance-tlb ipv4.method m ipv4.addresses 192.168.118.111/24 ipv4.gateway 192.16.118.2 ipv4.dns 8.8.8.8
nmcli connection add type bond-slave con-name bond-slave1 ifname ens38 master bond5
nmcli connection add type bond-slave con-name bond-slave2 ifname ens39 master bond5
nmcli connection up bond5
nmcli connection
cat /proc/net/bonding/bond5
nmcli device disconnect ens38
cat /proc/net/bonding/bond5
nmcli connection
4:编译安装nginx.并启动nginx服务
gunzip nginx-1.12.2.tar.gz
ls
tar -xf nginx-1.12.2.tar
ls
cd nginx-1.12.2/
ls
mkdir /opt/kk
./configure --prefix=/opt/kk
echo $?
yum -y install pcre-devel openssl openssl-devel
./configure --prefix=/opt/kk
make && make install
echo $?
cd
cd /opt/kk
ls
cd sbin/
ls
systemctl stop firewalld.service
./nginx
5:使用ps命令查看nginx进程是否启动
ps -ef|grep nginx
6:使用ss命令查看nginx端口是否起来
ss -antl|grep 80