Centos安装nginx

https://www.linuxidc.com/Linux/2018-09/154437.htm

安装插件

安装c++

yum -y install gcc

pcre、pcre-devel安装

pcre、pcre-devel安装

安装zlib

yum install -y zlib zlib-devel

安装openssl

yum install -y openssl openssl-devel

安装nginx

下载nginx

# 下载
wget http://nginx.org/download/nginx-1.18.0.tar.gz 
# 解压
tar -zxvf nginx-1.18.0.tar.gz -C  /usr/local/
# 编译
cd  /usr/local/nginx-1.18.0
# 安装
make && make install
# 启动
nginx -c /etc/nginx/nginx.conf

启动错误提示

出现 [emerg] mkdir() “/var/temp/nginx/client” failed (2: No such file or directory) 错误,执行下述命令

sudo mkdir -p /var/tem/nginx/client

常用命令

# 启动
nginx -c /etc/nginx/nginx.conf

# 停止
nginx -s stop

# 测试配置文件
nginx -t 

# 重新加载配置
nginx -s reload

参考文章

https://blog.csdn.net/weixin_55939638/article/details/135695395

评论

公众号:mumuser

企鹅群:932154986

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×