Centos6.9安装Nginx1.10.3

下载Nginx依赖

yum install -y pcre-devel openssl-devel

创建Nginx软件目录

mkdir /application 

获取Nginx安装包并解压

wget -q http://nginx.org/download/nginx-1.10.3.tar.gz
tar zxf nginx-1.10.3.tar.gz

编译安装软件

配置编译参数

cd nginx-1.10.3
useradd -s /sbin/nologin -M www
./configure --prefix=/application/nginx-1.10.3 --conf-path=/application/nginx-1.10.3/nginx.conf --user=www --group=www --with-http_stub_status_module  --with-http_ssl_module

检查

echo $?

返回值为0即为正确

编译安装

make && make install

启动Nginx

/application/nginx/sbin/nginx

检查80端口是否启用

netstat -ant |grep 80
tcp        0      0 0.0.0.0:80                  0.0.0.0:*                   LISTEN 

本地访问

curl localhost
  • 网页访问
    这里写图片描述

猜你喜欢

转载自blog.csdn.net/qq_33235529/article/details/80660605