-
热门文章
-
目录
-
一.关闭防火墙和SElinux
systemctl stop firewalld
setenforce 0
二.源码安装NGINX
下载源码包并解压:
wget http://nginx.org/download/nginx-1.16.0.tar.gz
tar -zxvf nginx-1.16.0.tar.gz
三.编译安装
cd /usr/local/src
cd nginx-1.16.0
./configure --prefix=/data/server/nginx
make && make install
进到NGINX目录中启动NGINX
cd /data/server/nginx/sbin
./nginx
在网页输入IP:
配置目录索引
vim xxx
在其中放入安装链接http://nginx.org/en/download.html
3.配置文件
vim /data/server/nginx/conf/nginx.conf
在server模块下添加
autoindex on;
autoindex_exact_size off;
autoindex_localtime on;
root /var/www/html;
在location下添加
autoindex on;
autoindex_exact_size off;
autoindex_localtime on;
4.进到启动nginx的目录
cd /data/server/nginx/sbin
5.重读nginx
./nginx -s reload
6.在浏览器输入ip
0
收藏
Ctrl+Enter 发布
发布
取消