centos7-1——节点服务器1
安装环境包:
yum install pcre-devel zlib-devel gcc gcc-c++ make -y
网卡模式:仅主机
固定IP:192.168.100.100
vim /etc/sysconfig/network-scripts/ifcfg-ens33
BOOTPROTO=static
IPADDR=192.168.100.100
NETMASK=255.255.255.0
GATEWAY=192.168.100.1
service network restart
创建挂载点并挂载:
mkdir /abc
mount.cifs //192.168.100.7/LAMP-C7 /abc/
解压缩包:
cd /abc/
tar zxvf nginx-1.12.2.tar.gz -C /opt/
创建进程管理用户:
cd /opt/
useradd -M -s /sbin/nologin nginx
配置nginx:
cd nginx-1.12.0/
./configure \
--prefix=/usr/local/nginx \
--user=nginx \
--group=nginx
编译并安装:
make && make install
在站点目录下创建测试页面:
cd /usr/local/nginx/html/
echo "this is accp web" > test.html
建立软连接:
ln -s /usr/local/nginx/sbin/nginx /usr/local/sbin/
nginx -t //验证
启动服务:
nginx
查看端口服务开启状态:
netstat -ntap | grep 80
关闭防火墙:
systemctl stop firewalld.service
setenforce 0