本篇目的
安装nginx
配置http_status、gzip、http_ssl模块
命令开始
PS:出现选择输入的都选y或者yes
yum install -y pcre pcre-devel ,依赖包
yum install -y zlib zlib-devel ,依赖包
yum install -y openssl openssl-devel ,依赖包
wget http://nginx.org/download/nginx-1.13.9.tar.gz 下载
tar -zxvf nginx-1.13.9.tar.gz 解压
cd nginx-1.13.9 进入文件夹
./configure --prefix=/usr/local/nginx --pid-path=/var/run/nginx/nginx.pid --lock-path=/var/lock/nginx.lock --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --http-client-body-temp-path=/var/temp/nginx/client --http-proxy-temp-path=/var/temp/nginx/proxy --http-fastcgi-temp-path=/var/temp/nginx/fastcgi --http-uwsgi-temp-path=/var/temp/nginx/uwsgi --http-scgi-temp-path=/var/temp/nginx/scgi --with-http_gzip_static_module --with-http_stub_status_module --with-http_ssl_module 配置
make 编译
make install 安装
/usr/local/nginx/sbin/nginx -v 查看版本,检测安装状态
cd /var 下面四步创建上面配置路径中的/var/temp/nginx/**
mkdir temp
cd /temp
mkdir nginx
/usr/local/nginx/sbin/nginx 启动
然后访问你的ip,nginx-1.13.9可以删掉,下载的压缩包不要删除,方便后期添加模块.
当然你还可以更简单:
Centos/Redhat .......
yum install nginx
Ubuntu/Debian/KaliLinux/Pear OS .....
apt install nginx
ArchLinux
pacman -S nginx
Gentoo
emerge -av nginx
Slackware
slackpkg install nginx
FreeBSD
pkg install nginx
MacOS
brew install nginx
Openwrt
dpkg install nginx

