posts - 360,comments - 0,views - 19万

安装依赖

1
yum -y install gcc gcc-c++ automake zlib zlib-devel openssl openssl–devel pcre pcre-devel

下载解压部署包

1
tar -xvf nginx-1.22.0.tar.gz -C /usr/local/

 

 

 编译安装

1
2
[root@bogon local]# cd nginx-1.22.0/<br>
[root@bogon nginx-1.22.0]# ./configure
1
[root@bogon nginx-1.22.0]# make && make install

 

 修改nginx.conf配置文件

1
2
3
4
5
6
location / {
    root   /usr/local/nginx/html/download;
    autoindex on;          #开启目录浏览
    autoindex_format html;  #以html风格展示目录<br>            autoindex_exact_size off;  #切换为off后以可读的方式显示文件大小
    autoindex_localtime on;  #以文件时间为显示时间<br>            charset "utf-8,gbk";  #展示中文
}

 创建download目录

1
[root@bogon conf]# mkdir -p /usr/local/nginx/html/download

 启动nginx

1
2
3
4
$ cd /usr/local/nginx/sbin
# 检查配置文件是否有报错
$ ./nginx -t
$ ./nginx -s reload

 

 

 

posted on   属于我的梦,明明还在  阅读(15)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 2025年我用 Compose 写了一个 Todo App
· 张高兴的大模型开发实战:(一)使用 Selenium 进行网页爬虫
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

点击右上角即可分享
微信分享提示