标签:yum sbin href tar grep fir gcc-c++ 名称 搭建
创建虚拟机主机ip:192.168.0.215
账号:root 密码:Zxit@2018
后面参考https://www.cnblogs.com/yybrhr/p/9809707.html
只是分区改下大小:
# 1、查看当前主机名
hostname
# 2、修改名称
vi /etc/hostname
# 3、重启
reboot
date
tzselect
TZ=‘Asia/Shanghai‘; export TZ
vi /usr/local/auto_install_nginx.sh
#!/bin/bash
##2019 03 12 15:45:55
###设置相关参数
NGINX_URL=http://nginx.org/download/nginx-1.14.2.tar.gz
#NGINX_YL=gcc openssl openssl-devel zlib zlib-devel gcc-c++ pcre pcre-devel libgcc
NGINX_HOME=/usr/local/nginx
###判断是否需要安装wget###
WGET=`rpm -qa | grep wget`
if [$WGET -z ];then
yum install -y wget
fi
###下载安装包###
wget $NGINX_URL
###安装相关依赖包###
yum install -y gcc openssl openssl-devel zlib zlib-devel gcc-c++ pcre pcre-devel libgcc
###解压并进入到相关目录###
tar -xzf nginx-1.14.2.tar.gz
cd nginx-1.14.2/
###预编译###
./configure --prefix=$NGINX_HOME --with-http_stub_status_module --with-http_ssl_module
###编译###
make
###安装###
make install
###启动###
$NGINX_HOME/sbin/nginx
###关闭防火墙###
service firewalld stop
###查看进程###
ps -ef | grep nginx
###判断是否安装net-tools,如果未安装则安装###
NET=`rpm -qa | grep net-tools`
if [$NET -z ];then
yum install -y net-tools
fi
###查看端口
netstat -ntlp | grep 80
参考https://www.cnblogs.com/yybrhr/p/9810764.html
标签:yum sbin href tar grep fir gcc-c++ 名称 搭建
原文地址:https://www.cnblogs.com/yybrhr/p/10677719.html