Replies: 1 comment 2 replies
-
nginx 的没有加入 $PATH 中,您可以尝试配置环境变量,或者修改配置文件 手动指定您安装的 nginx 路径到 SbinPath 中 |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
非常干净的一台服务器,nginx -V:
nginx version: nginx/1.28.0
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC)
built with OpenSSL 1.0.2k-fips 26 Jan 2017
TLS SNI support enabled
configure arguments: --prefix=/usr/local/nginx --with-http_ssl_module --with-http_v2_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_stub_status_module --with-http_gzip_static_module --with-pcre --with-stream
做了软链接:ln -snf /usr/local/nginx/conf /etc/nginx
并在/etc/nginx下创建目录:
:pwd
/etc/nginx
:ls -lrt
total 92
drwxr-xr-x 2 root root 4096 Jul 11 16:42 conf.d
-rw-r--r-- 1 root root 1077 Jul 11 16:23 fastcgi.conf
-rw-r--r-- 1 root root 1077 Jul 11 16:23 fastcgi.conf.default
-rw-r--r-- 1 root root 1007 Jul 11 16:23 fastcgi_params
-rw-r--r-- 1 root root 1007 Jul 11 16:23 fastcgi_params.default
-rw-r--r-- 1 root root 2837 Jul 11 16:23 koi-utf
-rw-r--r-- 1 root root 2223 Jul 11 16:23 koi-win
-rw-r--r-- 1 root root 5349 Jul 11 16:23 mime.types
-rw-r--r-- 1 root root 5349 Jul 11 16:23 mime.types.default
-rw-r--r-- 1 root root 2796 Jul 11 17:10 nginx.conf
-rw-r--r-- 1 root root 2656 Jul 11 16:23 nginx.conf.default
drwxr-xr-x 3 root root 4096 Jul 11 16:47 nginx-ui
-rw-r--r-- 1 root root 636 Jul 11 16:23 scgi_params
-rw-r--r-- 1 root root 636 Jul 11 16:23 scgi_params.default
drwxr-xr-x 2 root root 4096 Jul 11 16:42 sites-available
drwxr-xr-x 2 root root 4096 Jul 11 16:42 sites-enabled
drwxr-xr-x 2 root root 4096 Jul 11 16:42 streams-available
drwxr-xr-x 2 root root 4096 Jul 11 16:42 streams-enabled
-rw-r--r-- 1 root root 664 Jul 11 16:23 uwsgi_params
-rw-r--r-- 1 root root 664 Jul 11 16:23 uwsgi_params.default
-rw-r--r-- 1 root root 3611 Jul 11 16:23 win-utf
nginx-ui目录在:/etc/nginx/nginx-ui/nginx-ui-2.1.6/
nginx-ui包在:/etc/nginx/nginx-ui/nginx-ui-linux-64.tar.gz
直接启动会报错:
:sh install.sh -l /etc/nginx/nginx-ui/nginx-ui-linux-64.tar.gz
install.sh: line 220: syntax error near unexpected token
(' install.sh: line 220:
elif [[ -d /run/systemd/system ]] || grep -q systemd <(ls -l /sbin/init); then'修改了220为elif ls -l /sbin/init > temp.txt && grep -q systemd temp.txt; then
再次启动:
:sh install.sh -l /etc/nginx/nginx-ui/nginx-ui-linux-64.tar.gz
info: Install Nginx UI from a local file '/etc/nginx/nginx-ui/nginx-ui-linux-64.tar.gz'.
/etc/nginx/nginx-ui/nginx-ui-linux-64.tar.gz
info: Extract the Nginx UI package to /tmp/tmp.Slixlqwpay and prepare it for installation.
installed: /usr/local/bin/nginx-ui
Downloading Nginx UI service file: https://raw.githubusercontent.com/0xJacky/nginx-ui/main/resources/services/nginx-ui.service
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 366 100 366 0 0 43 0 0:00:08 0:00:08 --:--:-- 83
info: Systemd service files have been installed successfully!
note: The following are the actual parameters for the nginx-ui service startup.
note: Please make sure the configuration file path is correctly set.
/etc/systemd/system/nginx-ui.service
[Unit]
Description=Yet another WebUI for Nginx
Documentation=https://github.com/0xJacky/nginx-ui
After=network.target
[Service]
Type=simple
ExecStart=/usr/local/bin/nginx-ui --config /usr/local/etc/nginx-ui/app.ini
RuntimeDirectory=nginx-ui
WorkingDirectory=/var/run/nginx-ui
Restart=on-failure
TimeoutStopSec=5
KillMode=mixed
[Install]
WantedBy=multi-user.target
/etc/systemd/system/nginx-ui.service.d/*
cat: /etc/systemd/system/nginx-ui.service.d/*: No such file or directory
warning: The systemd version on the current operating system is too low.
warning: Please consider to upgrade the systemd or the operating system.
installed: /etc/systemd/system/nginx-ui.service
removed: /tmp/tmp.Slixlqwpay
info: Nginx UI is installed.
info: The default configuration file was installed to '/usr/local/etc/nginx-ui/app.ini' successfully!
note: The following are the current configuration for the nginx-ui.
note: Please change the information if needed.
/usr/local/etc/nginx-ui/app.ini
[app]
PageSize = 10
[server]
Host = 0.0.0.0
Port = 9000
RunMode = release
[cert]
HTTPChallengePort = 9180
[terminal]
StartCmd = login
info: Nginx UI service is not running, starting...

info: Start the Nginx UI service.
Created symlink from /etc/systemd/system/multi-user.target.wants/nginx-ui.service to /etc/systemd/system/nginx-ui.service.
访问9000端口就全是找不到目录,我是哪里操作不对吗?求指点
Beta Was this translation helpful? Give feedback.
All reactions