部署Nginx

#下载nginx

wget http://nginx.org/download/nginx-1.12.2.tar.gz
#安装依赖
yum install pcre-devel openssl-devel -y #编译安装三部曲 : ./configure make make install

#解压
tar xf nginx-1.12..tar.gz
#进入
cd nginx-1.12.2
#查看路径
pwd #应该是在这个路径下/application/nginx-1.12.2
#安装
./configure --prefix=/application/nginx-1.12. --with-http_stub_status_module --with-http_ssl_module
#查看上次命令结果是否正确
# echo $?
make #根据一些配置进行编译
make install 故障1:
error: the HTTP rewrite module requires the PCRE library.
yum install pcre-devel -y
[root@oldboyedu-s8 nginx-1.12.]# ll /application/nginx-1.12./
total
drwxr-xr-x. root root Apr : conf #configure nginx配置文件
drwxr-xr-x. root root Apr : html #站点目录 网站根目录
drwxr-xr-x. root root Apr : logs #日志
drwxr-xr-x. root root Apr : sbin #nginx管理命令 #检查语法
/application/nginx-1.12./sbin/nginx -t #启动nginx
/application/nginx-1.12./sbin/nginx -s reload #nginx配置说明
nginx.conf #nginx配置文件
nginx.conf.default # #对比两个文件区别
diff conf/nginx.conf conf/nginx.conf.default
#将
egrep -v "#|^$" /application/nginx-1.12./conf/nginx.conf.default >/application/nginx-1.12./conf/nginx.conf worker_processes ;
events {
worker_connections ;
}
http {
include mime.types; #媒体类型
default_type application/octet-stream;
sendfile on; #开启高效的传输模式
keepalive_timeout ; #超时时间
server { #一个server相当于是一个网站 虚拟主机
listen ; #监听的端口
server_name www.etiantian.org; #网站名字 域名
location / {
root html; #根 站点的根目录
index index.html index.htm; #首页文件
}
}
}

最新文章

  1. html标签思维导图
  2. Struts2批量验证(POC)
  3. 【dubbo】zookeeper搭建
  4. django1.9.6 使用 DjangoUeditor (python3.5)
  5. 看大众点评V9新版如何为O2O止血 带领行业下半场回归理性
  6. dubbo.xsd
  7. 014安装Linux系统到开发板
  8. 算法系列2《RSA》
  9. opencv 彩色图像亮度、对比度调节 直方图均衡化
  10. 【中国剩余定理】POJ 1006 & HDU 1370 Biorhythms
  11. Ajax的方法和使用代码
  12. C#工具:WebAPI常见问题及解决方案
  13. js获取input上传文件名和后缀
  14. Autolayout Breakpoints
  15. 算法提高 c++_ch02_01 (强制类型转换)
  16. delphi EncdDecd.pas单元中Encoding方法出现#$D#$A的解决方法
  17. POJ 2546
  18. BZOJ5418 NOI2018屠龙勇士(excrt)
  19. shell小工具查看Hadoop中System.out输出的日志
  20. Oracle性能优化之oracle中常见的执行计划及其简单解释

热门文章

  1. webpack优化总结
  2. Codeforces VK Cup Finals #424 Div.1 C. Bamboo Partition(数论)
  3. Android Studio中进行单元测试
  4. centos上tensorflow一键安装脚本
  5. C语言函数的变参实用与分析
  6. [Android篇]Android Studio + Genymotion 一夜无眠 ,超级详细版本[请使用新版2.0]
  7. Nginx与Apache工作方式
  8. JavaScript中this的用法详解
  9. Weblogic 9.2 启动时报错 javax.xml.namespace.QName
  10. 2015/9/15 Python基础(12):模块和包