nginx运行文件出错env: /etc/init.d/nginx: No such file or directory

本文介绍了如何解决因文件换行符格式不一致导致的Nginx启动问题。通过使用Notepad++调整文件的换行符格式从Windows到Unix/Linux样式,确保Nginx配置文件的正确性。
env: /etc/init.d/nginx: No such file or directory

估计是我在windows下修改文件的时候换行符出现问题了。

在notepad++ 将此文件打开,注意,该文件的权限,我用root用户登录之后

将文本文档该unix

执行 service nginx status


关于nopad++文件该改格式

由于历史原因,导致Windows,Unix/Linux,Mac三者之间,对于文件中所用回车换行符,表示的方法,都不一样。

这就导致了很多人都会遇到回车换行符的困惑,和需要在不同格式间进行转换。

其中,关于回车换行符的详细解释,去看这里[13]

此处,介绍一下,如何通过Notepad++实现在这三者之间进行转换。

查看当前文件格式(换行符用的是什么字符)


 


从Windows转换为Unix/Linux格式


 
gapinyc@DESKTOP-9QS7RL5:/mnt/c/Users/pc$ ssh -v \ -R 0.0.0.0:8080:192.168.110.204:8080 \ -R 0.0.0.0:8079:192.168.110.204:8079 \ -R 0.0.0.0:8088:localhost:8088 \ ubuntu@43.153.66.149 OpenSSH_8.9p1 Ubuntu-3ubuntu0.13, OpenSSL 3.0.2 15 Mar 2022 debug1: Reading configuration data /etc/ssh/ssh_config debug1: /etc/ssh/ssh_config line 19: include /etc/ssh/ssh_config.d/*.conf matched no files debug1: /etc/ssh/ssh_config line 21: Applying options for * debug1: Connecting to 43.153.66.149 [43.153.66.149] port 22. debug1: Connection established. debug1: identity file /home/gapinyc/.ssh/id_rsa type 0 debug1: identity file /home/gapinyc/.ssh/id_rsa-cert type -1 debug1: identity file /home/gapinyc/.ssh/id_ecdsa type -1 debug1: identity file /home/gapinyc/.ssh/id_ecdsa-cert type -1 debug1: identity file /home/gapinyc/.ssh/id_ecdsa_sk type -1 debug1: identity file /home/gapinyc/.ssh/id_ecdsa_sk-cert type -1 debug1: identity file /home/gapinyc/.ssh/id_ed25519 type -1 debug1: identity file /home/gapinyc/.ssh/id_ed25519-cert type -1 debug1: identity file /home/gapinyc/.ssh/id_ed25519_sk type -1 debug1: identity file /home/gapinyc/.ssh/id_ed25519_sk-cert type -1 debug1: identity file /home/gapinyc/.ssh/id_xmss type -1 debug1: identity file /home/gapinyc/.ssh/id_xmss-cert type -1 debug1: identity file /home/gapinyc/.ssh/id_dsa type -1 debug1: identity file /home/gapinyc/.ssh/id_dsa-cert type -1 debug1: Local version string SSH-2.0-OpenSSH_8.9p1 Ubuntu-3ubuntu0.13 debug1: Remote protocol version 2.0, remote software version OpenSSH_9.6p1 Ubuntu-3ubuntu13.14 debug1: compat_banner: match: OpenSSH_9.6p1 Ubuntu-3ubuntu13.14 pat OpenSSH* compat 0x04000000 debug1: Authenticating to 43.153.66.149:22 as 'ubuntu' debug1: load_hostkeys: fopen /home/gapinyc/.ssh/known_hosts2: No such file or directory debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts: No such file or directory debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts2: No such file or directory debug1: SSH2_MSG_KEXINIT sent debug1: SSH2_MSG_KEXINIT received debug1: kex: algorithm: curve25519-sha256 debug1: kex: host key algorithm: ssh-ed25519 debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none debug1: expecting SSH2_MSG_KEX_ECDH_REPLY debug1: SSH2_MSG_KEX_ECDH_REPLY received debug1: Server host key: ssh-ed25519 SHA256:SCNCIXYAS8UyHXm9xBmwatnCfmtTo1JQSU6B6FLMhJE debug1: load_hostkeys: fopen /home/gapinyc/.ssh/known_hosts2: No such file or directory debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts: No such file or directory debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts2: No such file or directory debug1: Host '43.153.66.149' is known and matches the ED25519 host key. debug1: Found key in /home/gapinyc/.ssh/known_hosts:4 debug1: ssh_packet_send2_wrapped: resetting send seqnr 3 debug1: rekey out after 134217728 blocks debug1: SSH2_MSG_NEWKEYS sent debug1: expecting SSH2_MSG_NEWKEYS debug1: ssh_packet_read_poll2: resetting read seqnr 3 debug1: SSH2_MSG_NEWKEYS received debug1: rekey in after 134217728 blocks debug1: Will attempt key: /home/gapinyc/.ssh/id_rsa RSA SHA256:heWuMnpPtB+qFesgwkJlzZUQ6lkF3O66WcZEwAL2LF0 debug1: Will attempt key: /home/gapinyc/.ssh/id_ecdsa debug1: Will attempt key: /home/gapinyc/.ssh/id_ecdsa_sk debug1: Will attempt key: /home/gapinyc/.ssh/id_ed25519 debug1: Will attempt key: /home/gapinyc/.ssh/id_ed25519_sk debug1: Will attempt key: /home/gapinyc/.ssh/id_xmss debug1: Will attempt key: /home/gapinyc/.ssh/id_dsa debug1: SSH2_MSG_EXT_INFO received debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,sk-ssh-ed25519@openssh.com,sk-ecdsa-sha2-nistp256@openssh.com,rsa-sha2-512,rsa-sha2-256> debug1: kex_input_ext_info: publickey-hostbound@openssh.com=<0> debug1: kex_input_ext_info: ping@openssh.com (unrecognised) debug1: SSH2_MSG_SERVICE_ACCEPT received debug1: Authentications that can continue: publickey,password debug1: Next authentication method: publickey debug1: Offering public key: /home/gapinyc/.ssh/id_rsa RSA SHA256:heWuMnpPtB+qFesgwkJlzZUQ6lkF3O66WcZEwAL2LF0 debug1: Authentications that can continue: publickey,password debug1: Trying private key: /home/gapinyc/.ssh/id_ecdsa debug1: Trying private key: /home/gapinyc/.ssh/id_ecdsa_sk debug1: Trying private key: /home/gapinyc/.ssh/id_ed25519 debug1: Trying private key: /home/gapinyc/.ssh/id_ed25519_sk debug1: Trying private key: /home/gapinyc/.ssh/id_xmss debug1: Trying private key: /home/gapinyc/.ssh/id_dsa debug1: Next authentication method: password ubuntu@43.153.66.149's password: Authenticated to 43.153.66.149 ([43.153.66.149]:22) using "password". debug1: Remote connections from 0.0.0.0:8080 forwarded to local address 192.168.110.204:8080 debug1: Remote connections from 0.0.0.0:8079 forwarded to local address 192.168.110.204:8079 debug1: Remote connections from 0.0.0.0:8088 forwarded to local address localhost:8088 debug1: ssh_init_forwarding: expecting replies for 2 forwards debug1: channel 0: new [client-session] debug1: Requesting no-more-sessions@openssh.com debug1: Entering interactive session. debug1: pledge: filesystem debug1: client_input_global_request: rtype hostkeys-00@openssh.com want_reply 0 debug1: client_input_hostkeys: searching /home/gapinyc/.ssh/known_hosts for 43.153.66.149 / (none) debug1: client_input_hostkeys: searching /home/gapinyc/.ssh/known_hosts2 for 43.153.66.149 / (none) debug1: client_input_hostkeys: hostkeys file /home/gapinyc/.ssh/known_hosts2 does not exist debug1: remote forward failure for: listen 0.0.0.0:8080, connect 192.168.110.204:8080 Warning: remote port forwarding failed for listen port 8080 debug1: remote forward success for: listen 0.0.0.0:8079, connect 192.168.110.204:8079 debug1: forwarding_success: all expected forwarding replies received debug1: remote forward failure for: listen 0.0.0.0:8088, connect localhost:8088 Warning: remote port forwarding failed for listen port 8088 debug1: Sending environment. debug1: channel 0: setting env LANG = "C.UTF-8" Learned new hostkey: RSA SHA256:bMnW71Qezpmj4tukHMhu0x0VpvJieee1wdgc60q2EYQ Learned new hostkey: ECDSA SHA256:S6pP7Ec/rv08+KrvN0RqH8YIG3kkN5luqKxKJ69NkJE Adding new key for 43.153.66.149 to /home/gapinyc/.ssh/known_hosts: ssh-rsa SHA256:bMnW71Qezpmj4tukHMhu0x0VpvJieee1wdgc60q2EYQ Adding new key for 43.153.66.149 to /home/gapinyc/.ssh/known_hosts: ecdsa-sha2-nistp256 SHA256:S6pP7Ec/rv08+KrvN0RqH8YIG3kkN5luqKxKJ69NkJE debug1: update_known_hosts: known hosts file /home/gapinyc/.ssh/known_hosts2 does not exist Welcome to Ubuntu 24.04.3 LTS (GNU/Linux 6.8.0-71-generic x86_64) * Documentation: https://help.ubuntu.com * Management: https://landscape.canonical.com * Support: https://ubuntu.com/pro System information as of Thu Nov 27 04:10:46 PM CST 2025 System load: 0.0 Processes: 127 Usage of /: 10.0% of 58.94GB Users logged in: 1 Memory usage: 15% IPv4 address for eth0: 10.4.0.6 Swap usage: 0% Expanded Security Maintenance for Applications is not enabled. 0 updates can be applied immediately. Enable ESM Apps to receive additional future security updates. See https://ubuntu.com/esm or run: sudo pro status *** System restart required *** Last login: Wed Nov 26 13:37:53 2025 from 117.32.155.10 ubuntu@VM-0-6-ubuntu:~$
最新发布
11-28
gapinyc@DESKTOP-9QS7RL5:~/superset-prod$ docker exec -it superset_app ls /app/superset/static/dist/ ls: cannot access '/app/superset/static/dist/': No such file or directory gapinyc@DESKTOP-9QS7RL5:~/superset-prod$ RUN superset build RUN: command not found gapinyc@DESKTOP-9QS7RL5:~/superset-prod$ docker logs superset_app [2025-10-22 02:10:19 +0000] [1] [INFO] Starting gunicorn 23.0.0 [2025-10-22 02:10:19 +0000] [1] [INFO] Listening at: http://0.0.0.0:8088 (1) [2025-10-22 02:10:19 +0000] [1] [INFO] Using worker: gevent [2025-10-22 02:10:19 +0000] [7] [INFO] Booting worker with pid: 7 [2025-10-22 02:10:19 +0000] [8] [INFO] Booting worker with pid: 8 [2025-10-22 02:10:19 +0000] [9] [INFO] Booting worker with pid: 9 [2025-10-22 02:10:19 +0000] [10] [INFO] Booting worker with pid: 10 Loaded your LOCAL configuration at [/etc/superset/superset_config.py] Loaded your LOCAL configuration at [/etc/superset/superset_config.py] Loaded your LOCAL configuration at [/etc/superset/superset_config.py] 2025-10-22 02:10:23,406:INFO:superset.initialization:Setting database isolation level to READ COMMITTED /app/.venv/lib/python3.10/site-packages/flask_limiter/extension.py:333: UserWarning: Using the in-memory storage for tracking rate limits as no storage was explicitly specified. This is not recommended for production use. See: https://flask-limiter.readthedocs.io#configuring-a-storage-backend for documentation about configuring the storage backend. warnings.warn( 2025-10-22 02:10:23,408:INFO:superset.initialization:Setting database isolation level to READ COMMITTED /app/.venv/lib/python3.10/site-packages/flask_limiter/extension.py:333: UserWarning: Using the in-memory storage for tracking rate limits as no storage was explicitly specified. This is not recommended for production use. See: https://flask-limiter.readthedocs.io#configuring-a-storage-backend for documentation about configuring the storage backend. warnings.warn( 2025-10-22 02:10:23,431:INFO:superset.initialization:Setting database isolation level to READ COMMITTED /app/.venv/lib/python3.10/site-packages/flask_limiter/extension.py:333: UserWarning: Using the in-memory storage for tracking rate limits as no storage was explicitly specified. This is not recommended for production use. See: https://flask-limiter.readthedocs.io#configuring-a-storage-backend for documentation about configuring the storage backend. warnings.warn( Loaded your LOCAL configuration at [/etc/superset/superset_config.py] 2025-10-22 02:10:23,486:INFO:superset.initialization:Setting database isolation level to READ COMMITTED /app/.venv/lib/python3.10/site-packages/flask_limiter/extension.py:333: UserWarning: Using the in-memory storage for tracking rate limits as no storage was explicitly specified. This is not recommended for production use. See: https://flask-limiter.readthedocs.io#configuring-a-storage-backend for documentation about configuring the storage backend. warnings.warn( 2025-10-22 02:12:26,963:WARNING:root:Failed to add user to db session: Class 'werkzeug.local.LocalProxy' is not mapped 2025-10-22 02:14:18,531:WARNING:superset.views.error_handling:HTTPException Traceback (most recent call last): File "/app/.venv/lib/python3.10/site-packages/flask/app.py", line 1484, in full_dispatch_request rv = self.dispatch_request() File "/app/.venv/lib/python3.10/site-packages/flask/app.py", line 1458, in dispatch_request self.raise_routing_exception(req) File "/app/.venv/lib/python3.10/site-packages/flask/app.py", line 1440, in raise_routing_exception raise request.routing_exception # type: ignore File "/app/.venv/lib/python3.10/site-packages/flask/ctx.py", line 353, in match_request result = self.url_adapter.match(return_rule=True) # type: ignore File "/app/.venv/lib/python3.10/site-packages/werkzeug/routing/map.py", line 629, in match raise NotFound() from None werkzeug.exceptions.NotFound: 404 Not Found: The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again. 2025-10-22 02:16:20,253:WARNING:superset.views.error_handling:HTTPException Traceback (most recent call last): File "/app/.venv/lib/python3.10/site-packages/flask/app.py", line 1484, in full_dispatch_request rv = self.dispatch_request() File "/app/.venv/lib/python3.10/site-packages/flask/app.py", line 1458, in dispatch_request self.raise_routing_exception(req) File "/app/.venv/lib/python3.10/site-packages/flask/app.py", line 1440, in raise_routing_exception raise request.routing_exception # type: ignore File "/app/.venv/lib/python3.10/site-packages/flask/ctx.py", line 353, in match_request result = self.url_adapter.match(return_rule=True) # type: ignore File "/app/.venv/lib/python3.10/site-packages/werkzeug/routing/map.py", line 629, in match raise NotFound() from None werkzeug.exceptions.NotFound: 404 Not Found: The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again. gapinyc@DESKTOP-9QS7RL5:~/superset-prod$
10-23
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值