您的位置:首页 > 运维架构 > Nginx

Nginx简单编译安装

2019-07-13 20:50 1296 查看

1、 安装依赖包

yum install -y wget gcc gcc-c++ make pcre pcre-devel zlib zlib-devel openssl openssl-devel

2、 安装nginx

wget http://nginx.org/download/nginx-1.14.2.tar.gz

tar zxf nginx-1.14.2.tar.gz

cd nginx-1.14.2

./configure --prefix=/usr/local/nginx

make

make install

3、 启动

环境变量:

Vi  /etc/profile

加入:export PATH=$PATH:/usr/local/nginx/sbin/

 source /etc/profile 


nginx –t #检查nginx配置

nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok

nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful

nginx #启动

 

ss -lntup |grep nginx #启动检查

tcp    LISTEN     0      128       *:80                    *:*                   users:(("nginx",pid=38818,fd=6),("nginx",pid=38817,fd=6))

nginx -s stop #关闭nginx


内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: