现在服务器部署nginx
yum install -y epel-release
yum install nginx -y
安装完成之后
访问ip
由此可见nginx服务是可用的
修改nginx的配置文件如下
root@localhost conf.d]# pwd
/etc/nginx/conf.d
[root@localhost conf.d]# cat default.conf
server {
listen 80;
server_name localhost;
root /home/www;
#access_log /var/log/nginx/host.access.log main;
location / {
autoindex on; # 索引
autoindex_exact_size on; # 显示文件大小
autoindex_localtime on; # 显示文件时间
}
#error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}
[root@localhost conf.d]#
修改root指向的位置添加这三项
autoindex on; # 索引
autoindex_exact_size on; # 显示文件大