Linux下部署Nginx
程序员文章站
2022-06-04 13:15:31
...
安装pcre
[[email protected] home]# yum install -y gcc gcc-c++
[[email protected] home]# wget https://jaist.dl.sourceforge.net/project/pcre/pcre/8.42/pcre-8.42.tar.gz
[[email protected] home]# tar -zxvf pcre-8.42.tar.gz
[[email protected] home]# cd pcre-8.42/
[[email protected] pcre-8.42]# ./configure --prefix=/usr/local/pcre
[[email protected] pcre-8.42]# make
[[email protected] pcre-8.42]# make install
安装zlib
[[email protected] home]# yum install -y zlib*
安装nginx
[[email protected] home]# wget http://nginx.org/download/nginx-1.14.0.tar.gz
[[email protected] home]# tar -zxvf nginx-1.14.0.tar.gz
[[email protected] home]# cd nginx-1.14.0/
[[email protected] nginx-1.14.0]# ./configure --sbin-path=/usr/local/nginx/sbin/nginx --conf-path=/usr/local/nginx/conf/nginx.conf --pid-path=/usr/local/nginx/sbin/nginx.pid --with-http_ssl_module --with-pcre=../pcre-8.42
[[email protected] nginx-1.14.0]# make
[[email protected] nginx-1.14.0]# make install
测试nginx配置
[[email protected] nginx-1.14.0]# /usr/local/nginx/sbin/nginx -t
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
[[email protected] nginx-1.14.0]# /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
可以配置软连接
[[email protected] WebSite]# ln -s /usr/local/nginx/sbin/nginx /usr/bin/nginx
若修改nginx配置,需reload
[[email protected] WebSite]# nginx -s reload
上一篇: PyQt4设置窗口左上角的小图标
推荐阅读
-
linux系统下用户管理相关介绍
-
Linux下PHP添加扩展库
-
linux中查看nginx、apache、php、mysql配置文件路径实例
-
linux查看nginx、apache、php、php-fpm、mysql及配置项所在目录
-
Asp.net Core应用程序在Linux上部署的图文详解
-
Ubuntu 下 nginx , php , mysql 和 golang 的简单安装
-
浅析linux下apache服务器的配置和管理
-
Linux下HTTP服务配置教程
-
Linux下安装PHP环境
-
Hat Enterprise Linux Server release 5.4 (Tikanga) 下MySQL 5.5