window是服务设置自启动没用_nginx设置目录浏览并支持中文

537c5b81300484a7f23951fc860bee73.png

停止并禁用防火墙

systemctl stop firewalld.service    #停止firewalldsystemctl disable firewalld.service   #禁用firewalld

关闭SElinux功能

setenforce 0     # 临时关闭SElinuxgetenforce     # 查看SElinux状态#修改配置文件使其永远生效sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config

编辑配置文件:vim /etc/nginx/conf.d/default.conf

 location /download {        alias  /home/software/;    #指定目录所在路径,注意alias和后面的/        autoindex on;    #开启目录浏览        autoindex_format html;   #以html风格将目录展示在浏览器中        autoindex_exact_size off; #切换为 off 后,以可读的方式显示文件大小,单位为 KB、MB 或者 GB        autoindex_localtime on; #以服务器的文件时间作为显示的时间        charset "utf-8,gbk"; #展示中文文件名        }

相关命令

#启动nginx服务systemctl start nginx.service #设置开机自启动systemctl enable nginx.service​#停止开机自启动systemctl disable nginx.service​#查看服务当前状态systemctl status nginx.service​#重新启动服务systemctl restart nginx.service ​#查看所有已启动的服务systemctl list-units --type=service
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值