[root@localhost git]# sudo systemctl stop nginx [root@localhost git]# sudo systemctl start nginx [root@localhost git]# systemctl status nginx ● nginx.service - The nginx HTTP and reverse proxy server Loaded: loaded (/usr/lib/systemd/system/nginx.service; disabled; vendor preset: disabled) Active: active (running) since Mon 2026-01-26 01:25:18 PST; 12s ago Process: 6867 ExecStart=/usr/sbin/nginx (code=exited, status=0/SUCCESS) Process: 6863 ExecStartPre=/usr/sbin/nginx -t (code=exited, status=0/SUCCESS) Process: 6860 ExecStartPre=/usr/bin/rm -f /run/nginx.pid (code=exited, status=0/SUCCESS) Main PID: 6870 (nginx) Tasks: 2 Memory: 1.5M CGroup: /system.slice/nginx.service ├─6870 nginx: master process /usr/sbin/nginx └─6871 nginx: worker process
Jan 26 01:25:18 localhost.localdomain systemd[1]: Starting The nginx HTTP and reverse proxy server... Jan 26 01:25:18 localhost.localdomain nginx[6863]: nginx: the configuration file /etc/nginx/nginx.conf syntax is ok Jan 26 01:25:18 localhost.localdomain nginx[6863]: nginx: configuration file /etc/nginx/nginx.conf test is successful Jan 26 01:25:18 localhost.localdomain systemd[1]: Started The nginx HTTP and reverse proxy server.
2026/01/2601:26:11 [error] 6871#6871: *2 open() "/data/hexo/blog/img/artical/cloud20240729.jpg" failed (2: No such file or directory), client: 192.168.139.1, server: 192.168.139.128, request: "GET
编辑本地 _config.yml 文件。
1 2 3 4 5 6 7 8 9 10 11 12 13
# URL ## Set your site url here. For example, if you use GitHub Page, set url as 'https://username.github.io/project' url:https://deng-2022.github.io/ # root: /blog root: # url: https://test.atomgit.net/blog/ # url: https://deng-2022.gitee.io/blog # url: https://github.com/deng-2022/blog permalink::year/:month/:day/:title/ permalink_defaults: pretty_urls: trailing_index:true# Set to false to remove trailing 'index.html' from permalinks trailing_html:true# Set to false to remove trailing '.html' from permalinks
检查 nginx 配置。
1
nginx -t
1 2
nginx: the configuration file /etc/nginx/nginx.confsyntaxis ok nginx: configuration file /etc/nginx/nginx.conf test is successful
[root@localhost ~]# yum install nginx Loaded plugins: fastestmirror, langpacks Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock error was 14: curl#6 - "Could not resolve host: mirrorlist.centos.org; Name or service not known"
One of the configured repositories failed (Unknown), and yum doesn't have enough cached data to continue. At this point the only safe thing yum can do is fail. There are a few ways to work "fix" this:
1. Contact the upstream for the repository and get them to fix the problem.
2. Reconfigure the baseurl/etc. for the repository, to point to a working upstream. This is most often useful if you are using a newer distribution release than is supported by the repository (and the packages for the previous distribution release still work).
3. Run the command with the repository temporarily disabled yum --disablerepo=<repoid> ...
4. Disable the repository permanently, so yum won't use it by default. Yum will then just ignore the repository until you permanently enable it again or use --enablerepo for temporary usage:
yum-config-manager --disable <repoid> or subscription-manager repos --disable=<repoid>
5. Configure the failing repository to be skipped, if it is unavailable. Note that yum will try to contact the repo. when it runs most commands, so will have to try and fail each time (and thus. yum will be be much slower). If it is a very temporary problem though, this is often a nice compromise:
[root@localhost run]# systemctl start nginx Job for nginx.service failed because the control process exited with error code. See "systemctl status nginx.service" and "journalctl -xe"for details. [root@localhost run]# ^C [root@localhost run]# journalctl -xe Jan 23 02:13:53 localhost.localdomain nginx[68582]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use) Jan 23 02:13:53 localhost.localdomain nginx[68582]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use) Jan 23 02:13:54 localhost.localdomain nginx[68582]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use) Jan 23 02:13:54 localhost.localdomain nginx[68582]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use) Jan 23 02:13:54 localhost.localdomain nginx[68582]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use) Jan 23 02:13:54 localhost.localdomain nginx[68582]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use) Jan 23 02:13:55 localhost.localdomain nginx[68582]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use) Jan 23 02:13:55 localhost.localdomain nginx[68582]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use) Jan 23 02:13:55 localhost.localdomain nginx[68582]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use) Jan 23 02:13:55 localhost.localdomain nginx[68582]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use) Jan 23 02:13:56 localhost.localdomain systemd[1]: nginx.service: control process exited, code=exited status=1 Jan 23 02:13:56 localhost.localdomain nginx[68582]: nginx: [emerg] still could not bind() Jan 23 02:13:56 localhost.localdomain systemd[1]: Failed to start The nginx HTTP and reverse proxy server. -- Subject: Unit nginx.service has failed -- Defined-By: systemd -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel -- -- Unit nginx.service has failed. -- -- The result is failed. Jan 23 02:13:56 localhost.localdomain polkitd[27152]: Unregistered Authentication Agent for unix-process:68568:894606 (system bus name :1.256, object path /org/freedesktop/P Jan 23 02:13:56 localhost.localdomain systemd[1]: Unit nginx.service entered failed state. Jan 23 02:13:56 localhost.localdomain systemd[1]: nginx.service failed. Jan 23 02:14:13 localhost.localdomain polkitd[27152]: Registered Authentication Agent for unix-process:68597:896568 (system bus name :1.257 [/usr/bin/pkttyagent --notify-fd Jan 23 02:14:13 localhost.localdomain systemd[1]: Starting The nginx HTTP and reverse proxy server... -- Subject: Unit nginx.service has begun start-up -- Defined-By: systemd -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel -- -- Unit nginx.service has begun starting up. Jan 23 02:14:13 localhost.localdomain nginx[68608]: nginx: the configuration file /etc/nginx/nginx.conf syntax is ok Jan 23 02:14:13 localhost.localdomain nginx[68608]: nginx: configuration file /etc/nginx/nginx.conf test is successful Jan 23 02:14:13 localhost.localdomain nginx[68611]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use) Jan 23 02:14:13 localhost.localdomain nginx[68611]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use) Jan 23 02:14:13 localhost.localdomain nginx[68611]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use) Jan 23 02:14:13 localhost.localdomain nginx[68611]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use) Jan 23 02:14:14 localhost.localdomain nginx[68611]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use) Jan 23 02:14:14 localhost.localdomain nginx[68611]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use) Jan 23 02:14:14 localhost.localdomain nginx[68611]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use) Jan 23 02:14:14 localhost.localdomain nginx[68611]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use) Jan 23 02:14:15 localhost.localdomain nginx[68611]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use) Jan 23 02:14:15 localhost.localdomain nginx[68611]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use) Jan 23 02:14:15 localhost.localdomain systemd[1]: nginx.service: control process exited, code=exited status=1 Jan 23 02:14:15 localhost.localdomain nginx[68611]: nginx: [emerg] still could not bind() Jan 23 02:14:15 localhost.localdomain systemd[1]: Failed to start The nginx HTTP and reverse proxy server. -- Subject: Unit nginx.service has failed -- Defined-By: systemd -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel -- -- Unit nginx.service has failed. -- -- The result is failed. Jan 23 02:14:15 localhost.localdomain systemd[1]: Unit nginx.service entered failed state. Jan 23 02:14:15 localhost.localdomain systemd[1]: nginx.service failed. Jan 23 02:14:15 localhost.localdomain polkitd[27152]: Unregistered Authentication Agent for unix-process:68597:896568 (system bus name :1.257, object path /org/freedesktop/P
# URL ## Set your site url here. For example, if you use GitHub Page, set url as 'https://username.github.io/project' url:https://deng-2022.github.io/ root:/blog # url: https://test.atomgit.net/blog/ # url: https://deng-2022.gitee.io/blog # url: https://github.com/deng-2022/blog permalink::year/:month/:day/:title/ permalink_defaults: pretty_urls: trailing_index:true# Set to false to remove trailing 'index.html' from permalinks trailing_html:true# Set to false to remove trailing '.html' from permalinks
Please make sure you have the correct access rights and the repository exists. FATAL { err: Error: Spawn failed at ChildProcess.<anonymous> (D:\Blog\blog\node_modules\hexo-util\lib\spawn.js:51:21) at ChildProcess.emit (node:events:519:28) at cp.emit (D:\Blog\blog\node_modules\cross-spawn\lib\enoent.js:34:29) at ChildProcess._handle.onexit (node:internal/child_process:293:12) { code: 128 } } Something's wrong. Maybe you can find the solution here: %s https://hexo.io/docs/troubleshooting.html
D:\Blog\blog>ssh -T git@github.com ssh: connect to host github.com port 22: Connection refused
能 ping 通,但端口连接有问题。
1 2 3 4 5 6 7 8 9 10 11 12
D:\Blog\blog>ping github.com
Pinging github.com [127.0.0.1] with 32 bytes of data: Reply from 127.0.0.1: bytes=32 time<1ms TTL=128 Reply from 127.0.0.1: bytes=32 time<1ms TTL=128 Reply from 127.0.0.1: bytes=32 time<1ms TTL=128 Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
Ping statistics for 127.0.0.1: Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip timesin milli-seconds: Minimum = 0ms, Maximum = 0ms, Average = 0ms
1 2
D:\Blog\blog>telnet github.com 22 Connecting To github.com...Could not open connection to the host, on port 22: Connect failed
这是一个非常典型的 DNS 污染/劫持 问题,github.com被错误地解析到了本地回环地址 127.0.0.1,这导致所有对 GitHub 的访问都被重定向到您自己的电脑。
# Copyright (c) 1993-2009 Microsoft Corp. # # This is a sample HOSTS file used by Microsoft TCP/IP for Windows. # # This file contains the mappings of IP addresses to host names. Each # entry should be kept on an individual line. The IP address should # be placed in the first column followed by the corresponding host name. # The IP address and the host name should be separated by at least one # space. # # Additionally, comments (such as these) may be inserted on individual # lines or following the machine name denoted by a '#' symbol. # # For example: # # 102.54.94.97 rhino.acme.com # source server # 38.25.63.10 x.acme.com # x client host
# localhost name resolution is handled within DNS itself. # 127.0.0.1 localhost # ::1 localhost 109.94.209.70 fitgirlrepacks.in # Fake FitGirl site 109.94.209.70 www.fitgirlrepacks.in # Fake FitGirl site 109.94.209.70 fitgirlrepacks.co # Fake FitGirl site 109.94.209.70 fitgirl-repacks.cc # Fake FitGirl site 109.94.209.70 fitgirl-repacks.to # Fake FitGirl site 109.94.209.70 fitgirl-repack.com # Fake FitGirl site 109.94.209.70 fitgirl-repacks.website # Fake FitGirl site
127.0.0.1 checkhost.local 109.94.209.70 www.fitgirl-repacks.cc # Fake FitGirl site 109.94.209.70 www.fitgirl-repacks.to # Fake FitGirl site 109.94.209.70 www.fitgirl-repack.com # Fake FitGirl site 109.94.209.70 www.fitgirl-repacks.website # Fake FitGirl site 109.94.209.70 ww9.fitgirl-repacks.xyz # Fake FitGirl site 109.94.209.70 *.fitgirl-repacks.xyz # Fake FitGirl site 109.94.209.70 fitgirl-repacks.xyz # Fake FitGirl site 109.94.209.70 fitgirl-repack.net # Fake FitGirl site 109.94.209.70 www.fitgirl-repack.net # Fake FitGirl site 109.94.209.70 fitgirlpack.site # Fake FitGirl site 109.94.209.70 www.fitgirlpack.site # Fake FitGirl site 109.94.209.70 fitgirl-repack.org # Fake FitGirl site 109.94.209.70 www.fitgirl-repack.org # Fake FitGirl site 109.94.209.70 fitgirlrepacks.pro # Fake FitGirl site 109.94.209.70 www.fitgirlrepacks.pro # Fake FitGirl site 109.94.209.70 fitgirlrepack.games # Fake FitGirl site 109.94.209.70 www.fitgirlrepack.games # Fake FitGirl site
permalink: :year/:month/:day/:title/ permalink_defaults: pretty_urls: trailing_index: true # Set to false to remove trailing 'index.html' from permalinks trailing_html: true # Set to false to remove trailing '.html' from permalinks