今天下午学习了部署云服务器,因为参加一个大创项目,需要开创一个APP,前端项目是VUE和VITE项目搭建的,在阿里巴巴云服务器上部署前端时,一直报错,一开始是感觉有端口没开放或者代码有问题。后来感觉是vue中封装的一些utils类无法使用导致网页显示不出来,捣鼓了一下午才发现原来80端口一直都未被使用,想尽办法重启nginx重启80端口,同时重启9090端口完整的部署在了云服务器。
最后加上重启nginx的命令
[root@iZ2zeddzgv1aavxxfnlj41Z ~]# sudo systemctl status nginx ● nginx.service - LSB: starts the nginx web server Loaded: loaded (/etc/rc.d/init.d/nginx; bad; vendor preset: disabled) Active: active (exited) since Thu 2024-09-26 17:56:28 CST; 3h 43min ago Docs: man:systemd-sysv-generator(8) Process: 1140 ExecStart=/etc/rc.d/init.d/nginx start (code=exited, status=0/SUCCESS) Sep 26 17:56:28 iZ2zeddzgv1aavxxfnlj41Z systemd[1]: Starting LSB: starts the nginx web server... Sep 26 17:56:28 iZ2zeddzgv1aavxxfnlj41Z nginx[1140]: Starting nginx... done Sep 26 17:56:28 iZ2zeddzgv1aavxxfnlj41Z systemd[1]: Started LSB: starts the nginx web server. [root@iZ2zeddzgv1aavxxfnlj41Z ~]# sudo nginx -t nginx: the configuration file /www/server/nginx/conf/nginx.conf syntax is ok nginx: configuration file /www/server/nginx/conf/nginx.conf test is successful [root@iZ2zeddzgv1aavxxfnlj41Z ~]# sudo tail -f /var/log/nginx/error.log tail: cannot open ‘/var/log/nginx/error.log’ for reading: No such file or directory tail: no files remaining [root@iZ2zeddzgv1aavxxfnlj41Z ~]# sudo tail -f /www/server/nginx/logs/error.log 2024/09/26 16:43:25 [notice] 12674#0: signal process started 2024/09/26 16:46:35 [notice] 12976#0: signal process started 2024/09/26 16:48:20 [notice] 2244#0: signal process started 2024/09/26 16:58:07 [notice] 2273#0: signal process started 2024/09/26 16:58:28 [notice] 2324#0: signal process started 2024/09/26 16:59:22 [notice] 2445#0: signal process started 2024/09/26 17:40:37 [notice] 5950#0: signal process started 2024/09/26 17:40:37 [alert] 5950#0: kill(2833, 1) failed (3: No such process) 2024/09/26 18:24:34 [notice] 4034#0: signal process started 2024/09/26 18:27:45 [notice] 4248#0: signal process started ^Z [1]+ Stopped sudo tail -f /www/server/nginx/logs/error.log [root@iZ2zeddzgv1aavxxfnlj41Z ~]# ps aux | grep nginx root 17463 0.0 0.2 241432 4668 pts/0 T 21:41 0:00 sudo tail -f /www/server/nginx/logs/error.log root 17465 0.0 0.0 108096 616 pts/0 T 21:41 0:00 tail -f /www/server/nginx/logs/error.log root 17505 0.0 0.0 112812 980 pts/0 S+ 21:42 0:00 grep --color=auto nginx [root@iZ2zeddzgv1aavxxfnlj41Z ~]# sudo systemctl restart nginx [root@iZ2zeddzgv1aavxxfnlj41Z ~]# sudo /usr/sbin/nginx sudo: /usr/sbin/nginx: command not found [root@iZ2zeddzgv1aavxxfnlj41Z ~]# cd /www [root@iZ2zeddzgv1aavxxfnlj41Z www]# cd work [root@iZ2zeddzgv1aavxxfnlj41Z work]# ls student [root@iZ2zeddzgv1aavxxfnlj41Z work]# cd .. [root@iZ2zeddzgv1aavxxfnlj41Z www]# cd server [root@iZ2zeddzgv1aavxxfnlj41Z server]# ls bt_tomcat_web data java mysql nginx other_project php pyporject_evn stop cron go_project lib.pl net_project nodejs panel proxy_project python_project [root@iZ2zeddzgv1aavxxfnlj41Z server]# cd nginx [root@iZ2zeddzgv1aavxxfnlj41Z nginx]# ls client_body_temp fastcgi_temp lib proxy_cache_dir sbin uwsgi_temp version.pl conf html logs proxy_temp_dir scgi_temp version_check.pl [root@iZ2zeddzgv1aavxxfnlj41Z nginx]# sudo nginx nginx: [emerg] bind() to 0.0.0.0:888 failed (98: Address already in use) nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use) nginx: [emerg] bind() to 0.0.0.0:888 failed (98: Address already in use) nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use) nginx: [emerg] bind() to 0.0.0.0:888 failed (98: Address already in use) nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use) nginx: [emerg] bind() to 0.0.0.0:888 failed (98: Address already in use) nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use) nginx: [emerg] bind() to 0.0.0.0:888 failed (98: Address already in use) nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use) nginx: [emerg] still could not bind() [root@iZ2zeddzgv1aavxxfnlj41Z nginx]# sudo lsof -i :80 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME AliYunDun 2260 root 11u IPv4 28244 0t0 TCP iZ2zeddzgv1aavxxfnlj41Z:55682->100.100.30.25:http (ESTABLISHED) nginx 17565 root 12u IPv4 76176 0t0 TCP *:http (LISTEN) nginx 17566 www 12u IPv4 76176 0t0 TCP *:http (LISTEN) nginx 17567 www 12u IPv4 76176 0t0 TCP *:http (LISTEN) [root@iZ2zeddzgv1aavxxfnlj41Z nginx]# sudo lsof -i :888 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME nginx 17565 root 11u IPv4 76175 0t0 TCP *:cddbp (LISTEN) nginx 17566 www 11u IPv4 76175 0t0 TCP *:cddbp (LISTEN) nginx 17567 www 11u IPv4 76175 0t0 TCP *:cddbp (LISTEN)
命令就是其中的
sudo systemctl restart nginx标签:26,9.26,0.0,www,iZ2zeddzgv1aavxxfnlj41Z,nginx,root From: https://www.cnblogs.com/zzqq1314/p/18434484