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 ...
随机推荐
- Windows cmd 颜色,字体,color font set up
windows的cmds默认的字体很丑,丑的不认直视,『如花』一般. 但是总有用到的时候 这是我有优化的一种结果,怎么来弄呢 要字体颜色漂亮,先要在注册表的Console中注册你要使用的字体,这个至关 ...
- peak num
class Solution {public: int findPeakElement(vector<int>& nums) { int i=0; int n=nums ...
- Hibernate,JPA注解@DynamicInsert和@DynamicUpdate,Hibernate如何插入sysdate
@DynamicInsert属性:设置为true,设置为true,表示insert对象的时候,生成动态的insert语句,如果这个字段的值是null就不会加入到insert语句当中.默认false. ...
- 更改MySQL数据文件目录位置
运维mysql,某些时候需要将数据文件更改到别的路径.以下介绍将mysql的数据文件从/var/lib/mysql迁移到/home/mysqldata/mysql下. 1.停止mysql $ serv ...
- HDU 4635:Strongly connected(强连通)
http://acm.hdu.edu.cn/showproblem.php?pid=4635 题意:给出n个点和m条边,问最多能添加几条边使得图不是一个强连通图.如果一开始强连通就-1.思路:把图分成 ...
- mongo 学习教程(全)
看的是爱酷学习网的视频:http://www.icoolxue.com/album/show/98 01 安装 1.先建mongoDB-data文件夹存数据 2.安装DB 3.设置环境变量:把bin目 ...
- Effective C++:条款27——条款
条款27:尽量少做转型动作 单一对象可能拥有一个以上的地址!
- android应用的数据应该保存到哪儿
王永超王永超嫖娼 做android app开发会涉及到不同数据的保存,比如数据缓存,客户登陆信息保存,客户状态的保存等等. 那针对这不同的数据我们应该保存在什么地方呢? 1.应用卸载也不会删除的数据 ...
- JavaScript DOM 编程艺术(第2版)读书笔记(3)
DOM DOM:文档对象模型: 节点 元素节点:DOM的原子是元素节点.<body>.<p>.<ul>之类的元素.元素可以包含其他的元素.没有被包含在其他元素里的唯 ...
- c# 财务数据编号的生辰
实现逻辑: 根据票号前戳+生成的6位数据编号=收据号(010+000001=010000001) 作废票号 将票号作废,插入到编号表中,以此下次在使用 作废票号使用 编号表中 现在只有2,当 ...