Centos 7 修改网站根目录

24/10/2019 857点热度 0人点赞 3条评论

建立 /var/www/ 文件夹

mkdir -p /var/www

将 /usr/share/nginx/html/ 下的 html/ 目录移动到 /var/www/

mv /usr/share/nginx/html/ /var/www/

在 /usr/share/nginx/ 处建立 /var/www/html/ 的软链接并命名为 html

ln -s /var/www/html /usr/share/nginx/html

重启nignx

systemctl restart nginx

网站根目录修改结束

默认的网站根目录位于 /usr/share/

使用有些不方便

修改至 /var/www/html/

pen Lens

这个人很懒,什么都没留下

文章评论

  • Alex

    I love it when people come together and share ideas.
    Great site, continue the good work!

    14/04/2020
  • Albert

    I really like looking through an article that can make people think.
    Also, many thanks for allowing for me to comment!

    11/08/2020
  • Sheryl

    Hi there, just became alert to your blog through Google, and found that it is really informative.
    I'm going to watch out for brussels. I will appreciate if you continue this
    in future. Many people will be benefited from your writing.
    Cheers!

    22/10/2020