az nginx install and other
Nginx
1◆ nginx install
- 源码:https://trac.nginx.org/nginx/browser
- 官网:http://www.nginx.org/


=====>安装编译工具及库文件
|
yum -y install make zlib zlib-devel gcc-c++ libtool openssl openssl-devel |
=====>下载 PCRE 安装包
|
=====>解压安装包
|
|
|
|
=====>编译安装
|
=====>search version
pcre-config --version
=====>下载 Nginx
|
=====>unrar
|
cd nginx-1.6.2
=====>编译安装
|
make install |
./configure
make
make install
=====>search nginx version
|
创建 Nginx 运行使用的用户 www
[root@bogon conf]#
/usr/sbin/groupadd www
[root@bogon conf]#
/usr/sbin/useradd -g www www
|
yum install -y pcre pcre-devel yum install -y zlib zlib-devel yum install -y openssl openssl-devel |
=====>
|
tar -zxvf nginx-1.6.2.tar.gz -C /usr/local/ |
|
tar -zxvf nginx-1.6.2.tar.gz -C /usr/local/ |
=====>进行configure配置
|
./configure --prefix=/usr/local/nginx |
make && make install
/usr/local/nginx/sbin/nginx
=====>ps -ef | grep nginx

=====>close ngnix
|
/usr/local/nginx/sbin/nginx -s stop |
=====>重新热启动nginx
|
重新热启动nginx, |
=====>配置防火墙,nginx默认的端口是80
|
firewall-cmd --zone=public --add-port=80/tcp –permanent firewall-cmd --reload |
|
worker_processes 1;
events { worker_connections 1024; }
http {
include mime.types; default_type application/octet-stream; sendfile on; upstream mytest { server 10.2.4.149:8080; } server { listen 8080; server_name 192.168.163.4; index devices.html; root /home/wonders/work/app_download; location ~ /test/(.*) { proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_pass http://mytest; }
}
log_format access '$remote_addr - $remote_user [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent" $http_x_forwarded_for' server_ip $server_addr proxy_host $proxy_host upstream_server_ip $upstream_addr'; access_log logs/access.log access;
}
} |

=====> gzip
|
gzip on; #开启gzip gzip_min_length 1k; #低于1kb的资源不压缩 gzip_comp_level 3; #压缩级别【1-9】,越大压缩率越高,同时消耗cpu资源也越多,建议设置在4左右。 gzip_types text/plain application/javascript application/x-javascript text/javascript text/xml text/css; #需要压缩哪些响应类型的资源,多个空格隔开。不建议压缩图片,下面会讲为什么。 gzip_disable "MSIE [1-6]\."; #配置禁用gzip条件,支持正则。此处表示ie6及以下不启用gzip(因为ie低版本不支持) gzip_vary on; #是否添加"Vary: Accept-Encoding"响应头 |
az nginx install and other的更多相关文章
- CentOS 6.6 nginx install
/************************************************************************* * CentOS 6.6 nginx instal ...
- nginx install in centos
1.在nginx下载rpm包,如nginx-release-centos-6-0.el6.ngx.noarch.rpm ,并安装(可用yum直接安装): 注:rpm包只是提供一个nginx源. 2.使 ...
- 第七篇、Nginx Install On Mac
方式一: 在mac上安装nginx,依次安装对应的依赖 pcre ./configure --prefix=/usr/local/pcre-8.37 --libdir=/usr/local/lib/p ...
- nginx install lua module
#install luajit #http://luajit.org/download.html .tar.gz cd LuaJIT- make install PREFIX=/home/allen. ...
- Nginx Install 记录
一.安装编译工具及库文件 yum -y install gcc yum -y install gcc-c++ yum -y install zlib; yum -y install pcre-deve ...
- centos nginx install openssl
1.查看是否已经安装 ssl 组件 [root@localhost wwwlogs]# cd /usr/local/nginx/sbin/ [root@localhost sbin]# ./nginx ...
- nginx install
./configure --prefix=/home/allen.mh/local/nginx --with-http_ssl_module --with-http_sub_module --with ...
- nginx HttpLuaModule
http://wiki.nginx.org/HttpLuaModule#Directives Name ngx_lua - Embed the power of Lua into Nginx This ...
- LVS+Keepalived+Squid+Nginx+MySQL主从高性能集群架构部署方案
方案一,在tomcat的workers.properties里面配置相关条件 worker.tomcat.lbfactor= worker.tomcat.cachesize= worker.tomca ...
随机推荐
- 【三十四】thinkphp之curd操作
1.数据创建(create) 接受提交过来的数据,比如表单提交的 POST(默认)数据.接受到数据后,还可以对数据进行有效的验证.完成.生成等工作 // 这里 create()方法就是数据创建,数据的 ...
- SpringBoot和Mybatis的整合
这里介绍两种整合SpringBoot和Mybatis的模式,分别是“全注解版” 和 “注解xml合并版”. 前期准备开发环境 开发工具:IDEAJDK:1.8技术:SpringBoot.Maven.M ...
- [qt]qstring和string中文支持转换问题
QString str2qstr(const string str) { return QString::fromLocal8Bit(str.data()); } string qstr2str(co ...
- Java——文件及目录File操作
API file.listFiles(); //列出目录下所有文件及子目录fileList[i].isFile() //判断是否为文件 fileList[i].isDirectory() //判断是否 ...
- php中文件操作常用函数有哪些
php中文件操作常用函数有哪些 一.总结 一句话总结:读写文件函数 判断文件或者目录是否存在函数 创建目录函数 file_exists() mkdir() file_get_content() fil ...
- MyEclipse6.5的反编译插件的安装
常用的几种反编译工具 1. JD-GUI[推荐] JD-GUI是属于Java Decompiler项目(JD项目)下个的图形化运行方式的反编译器.JD-Eclipse属于Java Decompiler ...
- 架构探险笔记5-使框架具备AOP特性(下)
开发AOP框架 借鉴SpringAOP的风格,写一个基于切面注解的AOP框架.在进行下面的步骤之前,确保已经掌了动态代理技术. 定义切面注解 /** * 切面注解 */ @Target(Element ...
- 轮播,试用与微信公众号,apicloud苹果安卓
<head> <script type="text/javascript" src="script/jquery.min.js">< ...
- php-fpm的错误日志
- 4月24 php基础及函数的应用
PHP是一种被广泛认可应用,运行在服务端的脚本语言,PHP需要安转PHP应用程序服务器去解释执行,是用来协助Web服务器工作的编程语言,因此所写的任何代码只有在www文件下的才能实施预览.PHP是一种 ...

