nginx安装配置域名转发
1.安装pcre
1.[root@localhost home]# tar zxvf pcre-8.10.tar.gz //解压缩 2.[root@localhost home]# cd pcre-8.10 //切换到该目录下 3.[root@localhost pcre-8.10]#./configure //配置 4.[root@localhost pcre-8.10]#make 5.[root@localhost pcre-8.10]#make install //安装 6. [root@localhost home]#tar -xvzf zlib-1.2.3.tar.gz 7. [root@localhost home]#cd zlib-1.2.3.tar.gz 8.[root@localhost home]#./configure 9. [root@localhost home]#make
2.安装zlib
10. [root@localhost home]#sudo make install
3.安装nginx
11.[root@localhost home]# tar zxvf nginx-1.0.2.tar.gz 12.[root@localhost home]#cd nginx-1.0.2 13.[root@localhostnginx-1.0.2]#./configure 14.[root@localhost nginx-1.0.2]#make &&make install
4.配置Nginx开机启动
15. [root@localhost nginx-1.0.2]#vi /etc/rc.d/rc.local 16. 在文件末尾添加“/usr/local/nginx/sbin/nginx”
5.启动操作
17. /usr/nginx/sbin/nginx (/usr/nginx/sbin/nginx -t 查看配置信息是否正确) 18. [root@localhost nginx-1.0.2]#cd/usr/nginx/sbin/ 19. [root@localhost nginx-1.0.2]#./nginx
6.停止操作
停止操作是通过向nginx进程发送信号(什么是信号请参阅linux文 章)来进行的
步骤1:查询nginx主进程号
ps -ef | grep nginx
在进程列表里 面找master进程,它的编号就是主进程号了。
步骤2:发送信号
从容停止Nginx:
kill -QUIT 主进程号
快速停止Nginx:
kill -TERM 主进程号
强制停止Nginx:
pkill -9 nginx
7.平滑重启
20. /usr/nginx/sbin/nginx -s reload
8.配置nginx反向代理用做内网域名转发
21. location / { 22. proxy_pass http://127.0.0.1:8686/; 23. proxy_redirect off; 24. proxy_set_header X-Real-IP $remote_addr; 25. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 26. }
注意:
一、配置https需要
# cd nginx-1.0.3 # ./configure--with-http_ssl_module –with-openssl=/soft/openssl(此处为openssl解压路径,无需安装) # make # make install
二、启动nginx提示:error while loading shared libraries: libpcre.so.1: cannot open shared object file: No such file or directory,意思是找不到libpcre.so.1这个模块,而导致启动失败。
1. [root@localhost nginx-1.0.2]# ./usr/local/webserver/nginx/sbin/nginx 2. nginx: error while loading shared libraries: libpcre.so.1: cannot open shared object file: No such file or directory
要解决这个方法非常容易
如果是32位系统
3. [root@localhost nginx-1.0.2]# ln -s /usr/local/lib/libpcre.so.1 /lib
如果是64位系统
4. [root@localhost nginx-1.0.2]# ln -s /usr/local/lib/libpcre.so.1 /lib64
然后在启动nginx就OK了
5. [root@localhost nginx-1.0.2]# /usr/local/webserver/nginx/sbin/nginx
nginx安装配置域名转发的更多相关文章
- 【nginx】 配置域名转发到相同地址不同端口下执行相应业务
#doctor upstream doc { server 52.**.**.***:8090; } #patient upstream pat { server 52.**.**.***:8088; ...
- Nginx安装配置|Nginx反向代理|Nginx支持HTTPS|Nginx重定向
Nginx安装配置 可以直接看到最下面的HTTPS. Nginx安装 我的系统如下: No LSB modules are available. Distributor ID: Ubuntu Desc ...
- Nginx安装配置(转)
Nginx 安装配置 Nginx("engine x")是一款是由俄罗斯的程序设计师Igor Sysoev所开发高性能的 Web和 反向代理 服务器,也是一个 IMAP/POP3/ ...
- Nginx安装配置PHP(FastCGI)环境的教程
这篇是Nginx安装配置PHP(FastCGI)环境的教程.Nginx不支持对外部程序的直接调用或者解析,所有的外部程序(包括PHP)必须通过FastCGI接口来调用. 一.什么是 FastCGI F ...
- nginx安装配置_runoob_阅读笔记_20190917
Nginx 安装配置_runoob菜鸟教程 Nginx 安装配置 Nginx("engine x")是一款是由俄罗斯的程序设计师Igor Sysoev所开发高性能的 Web和 反向 ...
- Nginx安装配置与HelloWorld
<深入理解Nginx>阅读与实践(一):Nginx安装配置与HelloWorld 最近在读陶辉的<深入理解Nginx:模块开发与架构解析>,一是想跟着大牛练练阅读和编写开源代码 ...
- Nginx 安装 配置 使用
Nginx 安装 配置 使用 基本的HTTP服务器特性 处理静态文件,索引文件以及自动索引:打开文件描述符缓存(缓存元数据和文件描述符,下一次可以直接从内存找到数据或者文件的位置): 使用缓存加速反向 ...
- VMware Linux 下 Nginx 安装配置 - nginx.conf 配置 [负载两个 Tomcat] (三)
首先启动Nginx 1. 相关浏览 两个 Tomcat 配置: VMware Linux 下 Nginx 安装配置 - Tomcat 配置 (二) Nginx 安装配置启动: VMware Linu ...
- VMware Linux 下 Nginx 安装配置 - Tomcat 配置 (二)
准备工作 相关浏览: VMware Linux 下 Nginx 安装配置 (一) 1. 选在 /usr/local/ 下创建 softs 文件夹,通过 ftp 命令 把 apache-tomcat-7 ...
随机推荐
- HDU 5968:异或密码(暴力)
http://acm.hdu.edu.cn/showproblem.php?pid=5968 题意:中文题意. 思路:一开始不会做,后来发现数据范围很小,而且那个数要是连续的,所以可能把所有情况枚举出 ...
- 杭电1097-A hard puzzle
Problem Description lcy gives a hard puzzle to feng5166,lwg,JGShining and Ignatius: gave a and b,how ...
- YTU 3008: 链串的基本运算
3008: 链串的基本运算 时间限制: 1 Sec 内存限制: 128 MB 提交: 1 解决: 1 题目描述 编写一个程序,实现链串的各种基本运算,主函数已给出,请补充每一种方法. 1.建立串s ...
- C#读取Excel显示到repeater中
首先需要一个用来存储我们需要显示的内容,防止页面回发丢失(添加时使用) #region 缓存文件 private DataTable excelData; /// <summary> // ...
- 实现multbandblend
一.首先实现 laplacian金字塔的分割和重构 #include "stdafx.h" #include <iostream> #include <vecto ...
- Unity-Animator深入系列---目标匹配Target Matching
回到 Animator深入系列总目录 一开始会理所当然的觉得,匹配是这样的: 但结果却是这样的(右边的Cube是匹配目标): 感觉这个接口应该是专门为攀爬之类的动画准备的,属于被动匹配位置,移动整个对 ...
- Linux下c++中的atoi、atol、atoll、atof函数调用实例
本文中调用的四个函数如下: atoi函数:将字符串转化为int类型变量 atol函数:将字符串转化为long类型变量 atoll函数:将字符串转化为long long类型变量 atof函数:将字符串转 ...
- git总结
1.先画个图,先对git的操作有个直观了解 2.分析下git中文件是怎么存储的 正如下面所示git存储不是每次更改就会产生一个新的文件,而是产生一个版本,这个版本对应着记录每个文件的不同情况 具体的存 ...
- lua中特殊用法
th> a=torch.zeros(,) [.0001s] th> a [torch.DoubleTensor of size 1x5] [.0001s] th> a[{,floor ...
- nn package
1.nn模块是神经网络模块 2.父类module,子类Sequential, Parallel和Concat 3.Linear:做线性变换 4.criterion 这个模块包含了各式各样的训练时的损失 ...