Jul 152021
以前一直都是有apache,这次就刚好有需求,学习一下Nginx,日后估计是需要把blog的apache换成nginx。我其实就是需要把一个目录让大家可以通过web ip地址直接访问和下载。
我需要共享的目录 /home
安装nginx,需要epel reoi
yum install nginx
配置nginx
cat /etc/nginx/conf.d/data.conf
server {
listen 80 default_server;
root /home/;
location / {
autoindex on;
autoindex_localtime on;
autoindex_exact_size off;
}
}
下面就是重启服务就可以,倒是很简单。
systemctl enable nginx
systemctl start nginx
直接通过ip地址访问,文件大小是用G,MB显示。效果不错。