网站首页 > 技术教程 正文
一、准备工作
安装nginx前先安装 pcre pcre-devle openssl openssl-devel
二、安装nginx
./configure --user=nginx --group=nginx --prefix=/usr/local/nginx1.18 --with-http_stub_status_module --with-http_ssl_module
Make
Make install
三、检查启动
/usr/local/nginx/Sbin/Nginx -t 检查语法
/usr/local/nginx/Sbin/Nginx 启动nginx
sudo fuser -n tcp 80 –k 解除80端口占用
四、配置
根目录 root
站点目录 html
/usr/local/nginx/conf/fastcgi.conf 动态配置文件
/usr/local/nginx/conf/nginx.conf 静态配置文件
配置nginx.conf
每个server 一个站点
Server{
Listen 80;
Server_name localhost; 域名
Location / {
Root html ;
Index index.html index.html; 首页文件
}
Error_page 500 502 503 504 /50x.html;遇到500 等错误,跳的50x.html
Location = /50x.html {
Root html;
}
}
猜你喜欢
- 2024-10-12 webserver神器 nginx安装(webmin nginx)
- 2024-10-12 Nginx学习笔记(nginx从入门到实践)
- 2024-09-26 CentOS7搭建nginx环境(centos7搭建http)
- 2024-09-26 CentOS7.3安装配置Nginx教程(centos7安装详细图解配置ip)
- 2024-09-26 135页阿里云OSS运维基础实战手册,图文结合一看就懂,仅分享2天
- 2024-09-26 Centos 6.5部署nginx+php环境部署
- 2024-09-26 nginx负载均衡配置(nginx负载均衡配置,当前机器宕机)
- 2024-09-26 Openresrt最佳案例 | 第1篇:Nginx介绍
- 2024-09-26 nginx 源码安装并开启gzip静态压缩
- 2024-09-26 记录一次nginx升级,支持ipv4和ipv6访问https
你 发表评论:
欢迎- 08-06linux 和 windows文件格式互相转换
- 08-06谷歌 ChromeOS 已支持 7z、iso、tar 文件格式
- 08-06Linux下比较文件内容的6种方法
- 08-06文件格式及功能汇总
- 08-0610个Linux文件内容查看命令的实用示例
- 08-06Linux-如何区分不同文件类型
- 08-06Zabbix技术分享——监控windows进程资源使用情况
- 08-06Linux系统卡顿?学会ps命令这三招,轻松定位问题进程
- 最近发表
- 标签列表
-
- 下划线是什么 (87)
- 精美网站 (58)
- qq登录界面 (90)
- nginx 命令 (82)
- nginx .http (73)
- nginx lua (70)
- nginx 重定向 (68)
- Nginx超时 (65)
- nginx 监控 (57)
- odbc (59)
- rar密码破解工具 (62)
- annotation (71)
- 红黑树 (57)
- 智力题 (62)
- php空间申请 (61)
- 按键精灵 注册码 (69)
- 软件测试报告 (59)
- ntcreatefile (64)
- 闪动文字 (56)
- guid (66)
- abap (63)
- mpeg 2 (65)
- column (63)
- dreamweaver教程 (57)
- excel行列转换 (56)
本文暂时没有评论,来添加一个吧(●'◡'●)