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 ...
随机推荐
- E2PROM的尺寸
买的E2PROM是128*8bit的, 就是只能存储128个byte, 妈的, 买小了. 实际需要的是10句, 可能加两个特殊句, "新手"跟"故障", 一共1 ...
- oracle日期函数2!
1.日期时间间隔操作 当前时间减去7分钟的时间 select sysdate,sysdate - interval '7' MINUTE from dual 当前时间减去7小时的时间 ...
- inupt textarea提示文字(点击消失,不输入恢复)及限制字数
效果: input: textarea: 限100字 源码: input: <input name="textfield" type="text" max ...
- PHP中判断字符串是否含有中文
<?php /** * [1.测试一] * 当$str = '中文测试'; 时输出"全部是汉字";当$str = '中a文3测试'; 时输出"不全是汉字" ...
- Codeforces 743D:Chloe and pleasant prizes(树形DP)
http://codeforces.com/problemset/problem/743/D 题意:求最大两个的不相交子树的点权和,如果没有两个不相交子树,那么输出Impossible. 思路:之前好 ...
- DOM元素尺寸和位置
一.获取元素 CSS大小 1.通过style 内联获取元素的大小 var box = document.getElementById('box'); //获取元素 box.style.width; / ...
- Python+Django+Eclipse 在Windows下快速开发自己的网站
一.配置开发环境 我的开发环境是:Python3.3.2 + Django1.5.2 + Eclipse 1.安装Python 下载地址:http://www.python.org/getit/ 安装 ...
- hbase 停止regionserver
每个regionserver节点可以自由启动或停止,可以不随hbase整体一起. 停止后regionserver上的数据会被移到其他regionserver上,不影响hbase的使用. 停止reg ...
- java.lang.IllegalStateException异常简单分析和简单解决
我们在做文件上传或者下载,或者过滤等操作时,可能要用到页面的输出流. 例如在JSP使用: response.reset(); response.setContentType(”application/ ...
- android Activity的启动模式
Android中Activity启动模式详解 在Android中每个界面都是一个Activity,切换界面操作其实是多个不同Activity之间的实例化操作.在Android中Activity的启 ...