一、nginx介绍
1.nginx服务功能:
a)web服务
b)负责均衡
c)web cache缓存
2.nginx服务优点:
a)配置简单,灵活
b)高并发(静态小文件)
c)占用资源少
d)功能种类多
e)支持epoll模型
f)配合动态服务和Apache有区别
g)可以对IP限速,限制连接数
二、nginx服务web部署
1.安装准备
[root@nginx ~]
[root@nginx ~]
[root@nginx ~]
[root@nginx ~]
2.编译安装nginx
[root@nginx ~]
[root@nginx nginx-1.6 .2 ]
[root@nginx nginx-1.6 .2 ]
--prefix=/usr/local/nginx-1.6 .2 --with -http_stub_status_module --with -http_ssl_module
[root@nginx nginx-1.6 .2 ]
[root@nginx nginx-1.6 .2 ]
[root@nginx nginx-1.6 .2 ]
3.启动nginx准备
3.1配置环境变量
[root@nginx nginx-1.6 .2 ]
[root@nginx ~]
PATH =/application/nginx /sbin/ : $PATH
[root@nginx ~]
3.2检查语法
[root@nginx nginx]
nginx: the configuration file /usr/local /nginx-1.6 .2 /conf/nginx.conf syntax is ok
nginx: configuration file /usr/local /nginx-1.6 .2 /conf/nginx.conf test is successful
3.2启动
[root@nginx nginx]
[root@nginx nginx]
tcp 0 0 0 .0 .0 .0 : 80 0 .0 .0 .0 :* LISTEN 4920 /nginx
4.关闭防火墙,SE
[root@nginx nginx]
iptables: Setting chains to policy ACCEPT : filter [ OK ]
iptables: Flushing firewall rules: [ OK ]
iptables: Unloading modules: [ OK ]
[root@nginx nginx]
5.网页访问
6.部署一个站点
6.1修改首页内容
[root@nginx nginx]
Welcome to https: //blog.csdn.net/liang _operations
6.2刷新网页