部署Nginx
2024-08-27 21:34:05
部署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; #首页文件
}
}
}
最新文章
- html标签思维导图
- Struts2批量验证(POC)
- 【dubbo】zookeeper搭建
- django1.9.6 使用 DjangoUeditor (python3.5)
- 看大众点评V9新版如何为O2O止血 带领行业下半场回归理性
- dubbo.xsd
- 014安装Linux系统到开发板
- 算法系列2《RSA》
- opencv 彩色图像亮度、对比度调节 直方图均衡化
- 【中国剩余定理】POJ 1006 &; HDU 1370 Biorhythms
- Ajax的方法和使用代码
- C#工具:WebAPI常见问题及解决方案
- js获取input上传文件名和后缀
- Autolayout Breakpoints
- 算法提高 c++_ch02_01 (强制类型转换)
- delphi EncdDecd.pas单元中Encoding方法出现#$D#$A的解决方法
- POJ 2546
- BZOJ5418 NOI2018屠龙勇士(excrt)
- shell小工具查看Hadoop中System.out输出的日志
- Oracle性能优化之oracle中常见的执行计划及其简单解释
热门文章
- webpack优化总结
- Codeforces VK Cup Finals #424 Div.1 C. Bamboo Partition(数论)
- Android Studio中进行单元测试
- centos上tensorflow一键安装脚本
- C语言函数的变参实用与分析
- [Android篇]Android Studio + Genymotion 一夜无眠 ,超级详细版本[请使用新版2.0]
- Nginx与Apache工作方式
- JavaScript中this的用法详解
- Weblogic 9.2 启动时报错 javax.xml.namespace.QName
- 2015/9/15 Python基础(12):模块和包