简体   繁体   English

在Ubuntu VPS上启动Nginx服务时出错

[英]error on start nginx service on ubuntu vps

i am begginer user of vps, i have a reactJS app, and i wnat to deploy it on my ubuntu 18 vps with nginx. 我是vps的初学者用户,我有一个reactJS应用程序,我使用nginx将其部署在我的ubuntu 18 vps上。 I have followed the stpes of this tutorial Deploying create-react-app with Nginx and Ubuntu 我遵循了本教程的步骤, 使用Nginx和Ubuntu部署create-react-app

i had already check all the steps, but when i put the command 我已经检查了所有步骤,但是当我输入命令时

sudo service nginx start sudo服务nginx启动

the system show's me, the next error message: 系统显示我,下一条错误消息:

Job for nginx.service failed because the control process exited with error code. nginx.service的作业失败,因为控制进程退出并显示错误代码。 See "systemctl status nginx.service" and "journalctl -xe" for details. 有关详细信息,请参见“ systemctl status nginx.service”和“ journalctl -xe”。

and when i put "journalctl -xe" shows me this: 当我输入“ journalctl -xe”时,向我显示:

nginx, error nginx,错误

ngnix, error ngnix,错误

please help me friends 请帮我朋友

Look in your log file on messages before the error "Failed to startup nginx" 在错误“无法启动nginx失败”之前,在消息的日志文件中查找

You will see the reason of problem. 您将看到问题的原因。 bind() to 0.0.0.0:80 failed (98: Address already in use) 将bind()设置为0.0.0.0:80失败(98:地址已在使用中)

Looks like port 80 on your vps server is already in use by some application. 看起来您的vps服务器上的端口80已被某些应用程序占用。 Port 80 used for HTTP services. 用于HTTP服务的端口80。

So most likely you already have run Apache HTTP server, or some other. 因此,很可能您已经在运行Apache HTTP服务器或其他服务器。

use this command to see what application use it 使用此命令查看使用什么应用程序

sudo netstat -tulpn | grep ":80"

If you see apache 如果看到apache

tcp6       0      0 :::80                   :::*                    LISTEN      349/apache2  

then you can stop apache 那你就可以停止阿帕奇

# apache service name also can be httpd (use right command)
# sudo service httpd stop
sudo service apache stop

and run nginx 并运行nginx

sudo service nginx start

But you should be sure that you don't use apache for another website. 但是,您应该确保不要将apache用于其他网站。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在 Nginx VPS 上部署 Gatsby js static 站点 - Deploy Gatsby js static site on Nginx VPS 刷新 React 应用程序,在 Ubuntu 上得到 nginx 404 错误 - Refresh React app, get nginx 404 error on Ubuntu npm 在 ubuntu 20.04 开始无法正常工作并显示 eslint 错误 - npm start not working in ubuntu 20.04 and displaying eslint error NPM 在 windows10 和 ubuntu 中反应的启动错误 - NPM start error for react in windows10 & ubuntu 如何在我的 VPS nginx 中制作 axios url 点 - How to make axios url point in my VPS nginx 我正在尝试在 Ubuntu 16.04 中安装 nginx,但我收到有关区域设置的错误 - I am trying to install nginx in Ubuntu 16.04, but I get an error about locale settings 405 不允许 - nginx/1.18.0 (Ubuntu) - 405 Not Allowed - nginx/1.18.0 (Ubuntu) Lerna + Ubuntu 试图在 ubuntu 项目上开始使用monoperos - Lerna + Ubuntu trying to start on ubuntu project withmonoperos 需要帮助在 VPS 上使用 nginx-proxy 在 Docker 容器中代理 React 和 NodeJS 应用程序 - Need help proxying React and NodeJS apps with nginx-proxy on a VPS, in Docker containers 创建 React App PWA 错误:未注册控制页面和 start_url 的服务工作者 - Create React App PWA ERROR: Does not register a service worker that controls page and start_url
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM