尝试将 sites-available 配置文件从 project-name 重命名为 project-name.net 但出现错误。
操作系统:Ubuntu 18
我都在干嘛...
1.创建一个新的配置文件:
sudo mv /etc/nginx/sites-available/project-name /etc/nginx/sites-available/project-name.net
2.删除旧的配置文件:
sudo rm /etc/nginx/sites-available/项目名称
3. 通过将配置文件链接到 sites-enabled 目录来启用它:
sudo ln -s /etc/nginx/sites-available/project-name.net /etc/nginx/sites-enabled
4.测试Nginx配置是否存在语法错误:
sudo nginx -t
之后出现错误:
nginx: [emerg] open() "/etc/nginx/sites-enabled/project-name" failed (2: No such file or directory) in /etc/nginx/nginx.conf:62
nginx: configuration file /etc/nginx/nginx.conf test failed
5.尝试重新启动Nginx:
sudo systemctl 重启 nginx
下一个错误:
Job for nginx.service failed because the control process exited with error code.
See "systemctl status nginx.service" and "journalctl -xe" for details.