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 ...
随机推荐
- SQL中的连接可以分为内连接,外连接,以及交叉连接 。
SQL中的连接可以分为内连接,外连接,以及交叉连接 . 1. 交叉连接CROSS JOIN 如果不带WHERE条件子句,它将会返回被连接的两个表的笛卡尔积,返回结果的行数等于两个表行数的乘积: 举例, ...
- oracle 存储过程发邮件
CREATE OR REPLACE PROCEDURE PROCSENDEMAIL(P_TXT VARCHAR2, ...
- log4j里面的info,debug,error级别有什么区别
一共分为五个级别:DEBUG.INFO.WARN.ERROR和FATAL.这五个级别是有顺序的,DEBUG < INFO < WARN < ERROR < FATAL,明白这一 ...
- HDU 3487:Play with Chain(Splay)
http://acm.hdu.edu.cn/showproblem.php?pid=3487 题意:有两种操作:1.Flip l r ,把 l 到 r 这段区间 reverse.2.Cut a b c ...
- 通过HtmlEmail 发送邮件
今天第一次来上海市虹口图书馆上自习,感觉还是很爽的.自己撸代码学会了发送邮件.啥都不说了,直接撸代码吧! 首先 必须引进来三个jar包: compile 'javax.mail:mail:1.4.7' ...
- day3 python 集合 文件
字典是无序的,列表是有序的 a='zhangsan' print (a[1]) a[2]=222 #字符串不能赋值 集合(set):把不同的元素组成一起形成集合 info=[1,2,34,5,6,7] ...
- rtc关机闹钟7 jni层 com_android_server_AlarmManagerService
frameworks/base/services/core/jni/com_android_server_AlarmManagerService.cpp int AlarmImplAlarmDrive ...
- 20151224001 GridView 多按钮的各种使用方法
<asp:GridView ID="GridView1" runat="server" AllowPaging=" ...
- GOICE项目初探
GOICE项目初探 在图像拼接方面,市面上能够找到的软件中,要数MS的ICE效果.鲁棒性最好,而且界面也很美观.应该说有很多值得学习的地方,虽然这个项目不开源,但是利用现有的资料,也可 ...
- UVa 10047,独轮车
题目链接:https://uva.onlinejudge.org/external/100/10047.pdf 题目链接:http://vjudge.net/contest/132239#proble ...