标签:direct ade status figure cdb demo zlib 重启 lib
https://www.jianshu.com/p/97cdbeebef96
yum -y install make zlib zlib-devel gcc-c++ libtool openssl openssl-devel
#下载最新版本的,注意不要用pcre2
wget https://jaist.dl.sourceforge.net/project/pcre/pcre/8.42/pcre-8.42.tar.gz
tar -xvf pcre-8.42.tar.gz
cd pcre-8.42
#安装编译
./configure
make && make install
#查看pcre版本
pcre-config --version
#下载
wget https://nginx.org/download/nginx-1.15.9.tar.gz
tar -xvf nginx-1.15.9.tar.gz
cd nginx-1.15.9
#编译安装
./configure --prefix=/usr/local/webserver/nginx --with-http_stub_status_module --with-http_ssl_module --with-pcre=/usr/local/src/pcre-8.42
make && make install
#查看版本
/usr/local/webserver/nginx/sbin/nginx -v
#创建 Nginx 运行使用的用户 www
/usr/sbin/groupadd www
/usr/sbin/useradd -g www www
#设置包含多个配置文件,在nginx.conf底部添加
include vhost/*.conf;
#启动
/usr/local/webserver/nginx/sbin/nginx
/usr/local/webserver/nginx/sbin/nginx -s reload # 重新载入配置文件
/usr/local/webserver/nginx/sbin/nginx -s reopen # 重启 Nginx
/usr/local/webserver/nginx/sbin/nginx -s stop # 停止 Nginx
# /usr/local/webserver/nginx/conf/vhost/demo.tilesrow.com.conf
server
{
listen 80;
#listen [::]:80;
server_name xx.com;
index index.html index.htm index.php default.html default.htm default.php;
root /data/project/demo1;
access_log /usr/local/webserver/nginx/logs/xx.com.log;
}
内网映射端口配置
server
{
listen 80;
#listen [::]:80;
server_name demo.xx.com;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://127.0.0.1:8001;
}
access_log /usr/local/webserver/nginx/logs/demo.xx.com.log;
}
标签:direct ade status figure cdb demo zlib 重启 lib
原文地址:https://www.cnblogs.com/YrRoom/p/11762208.html