AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题

问题[linode](server)

Martin Hope
Sam Kong
Asked: 2021-09-27 18:30:22 +0800 CST

我的本地服务器和 Linode 服务器之间的 MySQL CPU 使用率差异

  • 0

我有两台类似的服务器,一台在我的本地计算机上,另一台在 Linode 上。操作系统都是 Ubuntu 20.04 LTS。

当我将大型数据库导入 MySQL 时,我的本地计算机使用不到 10% 的 CPU,而 Linode 服务器使用 100% 的 CPU。所以 Linode 服务器完成导入的速度比我的本地计算机快得多。

什么配置有区别?

ubuntu mysql linode
  • 1 个回答
  • 50 Views
Martin Hope
Mathew Paret
Asked: 2021-08-14 13:54:25 +0800 CST

远程端口转发适用于 TCP/1194,但不适用于 TCP/443,即使未使用服务器上的端口 443

  • 0

我有一个奇怪的问题。

我提出了一个新的 Linode 作为隧道端点。

我能够成功地远程转发端口 1194,所以现在连接到 linode-server@1194 到我机器的端口 1194 并且我能够通过连接到我的 linode-server 上的端口 1194 来连接到我的 VPN。

以下命令是我使用的(有效的):

ssh -N -R 1194:localhost:1194 [email protected]

现在我也想移植 443。我试过这个:

ssh -N -R 443:192.168.1.122:443 [email protected]

我的本地服务器故意监听 192.168.1.122(不是本地主机)。

但是,上述命令无法打开服务器上的 443 端口。我收到以下错误:

警告:监听端口 443 的远程端口转发失败

所以我检查了我的 linode-server 端口 443 上是否有任何东西在运行。没有什么是:

user@linode-server:~$ sudo netstat -tulpn
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 0.0.0.0:1194            0.0.0.0:*               LISTEN      7438/sshd: user       
tcp        0      0 127.0.0.53:53           0.0.0.0:*               LISTEN      411/systemd-resolve 
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      2377/sshd: /usr/sbi 
tcp        0      0 0.0.0.0:25              0.0.0.0:*               LISTEN      1513/master         
tcp6       0      0 :::1194                 :::*                    LISTEN      7438/sshd: user       
tcp6       0      0 :::22                   :::*                    LISTEN      2377/sshd: /usr/sbi 
tcp6       0      0 :::25                   :::*                    LISTEN      1513/master         
udp        0      0 127.0.0.53:53           0.0.0.0:*                           411/systemd-resolve 
user@linode-server:~$ 

服务器上没有软防火墙。而且Linode云防火墙已经关掉了,我还是不行。

我完全不知道为什么转发 443 不起作用。

PS - 创建隧道时用户身份验证工作正常。

我不确定这是否有帮助,但我的 sshd_config 看起来像这样:

user@linode-server:~$ cat /etc/ssh/sshd_config | grep -v "^#" | grep -v "^$"
Include /etc/ssh/sshd_config.d/*.conf
PermitRootLogin no
PasswordAuthentication no
PermitEmptyPasswords no
ChallengeResponseAuthentication no
UsePAM yes
GatewayPorts yes
X11Forwarding yes
PrintMotd no
AcceptEnv LANG LC_*
Subsystem   sftp    /usr/lib/openssh/sftp-server
user@linode-server:~$

澄清一下,里面什么都没有/etc/ssh/sshd_config.d/

linode-server 上的详细日志记录表单 sshd:

...
Aug 14 09:00:32 connect sshd[9499]: Postponed publickey for pi from *HIDDEN: My home public IP* port 49180 ssh2 [preauth]
Aug 14 09:00:32 connect sshd[9499]: Accepted key RSA *HIDDEN* found at /home/pi/.ssh/authorized_keys:1
Aug 14 09:00:32 connect sshd[9499]: Accepted publickey for pi from *HIDDEN: My home public IP* port 49180 ssh2: RSA *HIDDEN* 
Aug 14 09:00:32 connect sshd[9499]: pam_unix(sshd:session): session opened for user pi by (uid=0)
Aug 14 09:00:32 connect systemd-logind[578]: New session 157 of user pi.
Aug 14 09:00:32 connect sshd[9499]: User child is on pid 9579
Aug 14 09:00:32 connect sshd[9579]: bind [0.0.0.0]:443: Permission denied
Aug 14 09:00:32 connect sshd[9579]: error: bind [::]:443: Permission denied
Aug 14 09:00:32 connect sshd[9579]: error: channel_setup_fwd_listener_tcpip: cannot listen to port: 443
...

为什么权限被拒绝?我上面使用的远程转发命令使用相同的用户(对于成功和失败的隧道)。

刚刚在这里发现可能是因为443是特权端口。现在我不想使用 root 用户在 443 上启用远程转发。我已锁定 linode-server 并且无法以 root 身份登录(并且我不想允许 root 登录)。根据上面的链接,我可以setcap在 linode-server 上使用 , 但我该怎么做,因为隧道打开命令实际上是从我的本地运行的。我的替代方案是什么?我知道也许在 linode-server 上使用更高的端口会起作用,但我不想这样做。我真的很希望它是端口 443,所以我不需要记住端口。

permissions ssh-tunnel linode
  • 2 个回答
  • 534 Views
Martin Hope
idi begaj
Asked: 2021-01-28 04:23:29 +0800 CST

一段时间后我的应用程序变得无法访问

  • 0

我有一个使用 Nginx在strks.rs的 Linode 上运行的 Vue.js 应用程序

我用 nginx 运行它,我找不到任何错误,

  • nginx 语法是好的 服务器正在运行,我尝试刷新 DNS 并重新启动 nginx
  • 域是活动的,但它不会导致我的网站
  • 我可以访问网站的唯一方法是https://192.46.234.237/并转到高级选项并同意继续

我猜这是 ssl 错误,但我无法诊断它,我使用本教程安装了我的,它运行了一段时间。我也尝试过手动更新它,但它还没有到期。

domain-name-system ssl domain nginx linode
  • 1 个回答
  • 51 Views
Martin Hope
Germano Carella
Asked: 2021-01-24 10:04:47 +0800 CST

nginx:如何在没有虚拟主机的情况下为同一域名上的多个站点提供服务?

  • 0

我是 nginx 的新手。我阅读了一些文档来安装它并使用 drupal 8 对其进行配置。

我的服务器安装在 linode 上。我通过IP地址访问,而不是虚拟主机。

我的 drupal 位于 var/www/html/d8/web。

因此,要访问我的 drupal 站点,我键入ip-address/d8/web.

如果root /var/www/html/d8/web在服务器默认文件中,它运行良好。这样我就无法访问服务器中的其他网站,每次我必须更改默认文件中的根目录。

我试过了

location (d8/web/ {
 try_files $uri /index.php?$query_string
} 

但是,如果 root 是其他目录,Nginxindex.php会在该目录中提供服务。

问题是我无法设置服务器名称,因为我使用的是 IP 地址而不是虚拟主机。我从我的 Windows 电脑访问 Linode。

一些想法或建议?

drupal php-fpm linode
  • 1 个回答
  • 152 Views
Martin Hope
Fèlix Boniquet Pelfort
Asked: 2020-12-31 13:50:20 +0800 CST

从克隆的 linode 反向 DNS

  • 0

我克隆了一个链接到 mydomain.com 的 linode1,反向 DNS 是 li19034-215.members.linode.com;

克隆的linode的反向DNS也是li19034-215.members.linode.com;我想删除反向 DNS 并将其分配给相同的 iP : 172.105.236.228 或删除它,但是当我尝试它时出现错误:Domain is not valid.

ubuntu domain-name-system reverse-dns dns-hosting linode
  • 1 个回答
  • 78 Views
Martin Hope
Fèlix Boniquet Pelfort
Asked: 2020-12-25 20:13:29 +0800 CST

将域从 AWS Route S3 迁移到 Linode

  • 1

我想将 1 个域从 AWS Route S3 迁移到 Linode;我已将 NS 记录更改为指向

ns1.linode.com
ns2.linode.com
ns3.linode.com
ns4.linode.com
ns5.linode.com

但在 DNS 检查表上,它显示为 NOT RESOLVED,当我挖掘时,结果如下:

; <<>> DiG 9.11.4-P2-RedHat-9.11.4-26.P2.el7_9.3 <<>> arteymiel.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 14170
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;arteymiel.com.         IN  A

;; AUTHORITY SECTION:
arteymiel.com.      820 IN  SOA ns-1690.awsdns-19.co.uk. awsdns-hostmaster.amazon.com. 1 7200 900 1209600 86400

;; Query time: 0 msec
;; SERVER: 139.162.139.5#53(139.162.139.5)
;; WHEN: vie dic 25 07:19:23 UTC 2020
;; MSG SIZE  rcvd: 126

在此处输入图像描述

domain-name-system dns-hosting amazon-web-services dig linode
  • 1 个回答
  • 249 Views
Martin Hope
CybeX
Asked: 2020-09-28 20:09:16 +0800 CST

nginx 连接被远程拒绝,但 localhost 连接

  • 0

我的 Ubuntu Server 20.04 LTS 有一个奇怪的问题

背景简介:

我安装了 nginx 并且在设置letsencrypt时遇到了很多麻烦。尝试使用静态提供的文件进行此操作,它不断表示连接被拒绝。我恢复到原来的 nginx 默认配置,从 localhost 我看到 HTML 中的页面内容“欢迎使用 NGINX”,但是从多个外部来源,我不断收到连接被拒绝。

配置 默认NGINX配置(直接复制+粘贴)

server {
        listen 80 default_server;
        listen [::]:80 default_server;

        root /var/www/html;
        index index.html index.htm index.nginx-debian.html;

        server_name _;
                try_files $uri $uri/ =404;
                # proxy_pass http://localhost:8080;
                # proxy_http_version 1.1;
                # proxy_set_header Upgrade $http_upgrade;
                # proxy_set_header Connection 'upgrade';
                # proxy_set_header Host $host;
                # proxy_cache_bypass $http_upgrade;
        }
}

使用 curl,我尝试从远程站点连接到端口 80:

curl http://my-domain.com

回应

curl: (7) Failed to connect to my-domain.com port 80: Connection refused

其他信息:

添加到启用站点的活动 NGINX 配置

blms@my-domain:/etc/nginx/sites-enabled$ ls -la
total 8
drwxr-xr-x 2 root root 4096 Sep 28 03:57 .
drwxr-xr-x 8 root root 4096 Sep 28 03:29 ..
lrwxrwxrwx 1 root root   34 Sep 28 03:57 default -> /etc/nginx/sites-available/default

Nginx 服务状态:活动(未报告错误)

blms@my-domain:~$ sudo systemctl status nginx
● nginx.service - A high performance web server and a reverse proxy server
     Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
     Active: active (running) since Mon 2020-09-28 03:57:26 UTC; 6min ago
       Docs: man:nginx(8)
    Process: 2901 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
    Process: 2912 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
   Main PID: 2913 (nginx)
      Tasks: 2 (limit: 1074)
     Memory: 2.6M
     CGroup: /system.slice/nginx.service
             ├─2913 nginx: master process /usr/sbin/nginx -g daemon on; master_process on;
             └─2914 nginx: worker process

Sep 28 03:57:25 my-domain.com systemd[1]: Starting A high performance web server and a reverse proxy server...
Sep 28 03:57:26 my-domain.com systemd[1]: Started A high performance web server and a reverse proxy server.

已确认 HTTP Server 在端口 80 上侦听:

blms@my-domain:~$ sudo ss -tlp | grep http
LISTEN   0        511              0.0.0.0:http                  0.0.0.0:*       users:(("nginx",pid=2914,fd=6),("nginx",pid=2913,fd=6))
LISTEN   0        511                 [::]:http                     [::]:*       users:(("nginx",pid=2914,fd=7),("nginx",pid=2913,fd=7))

iptables 允许所有连接

blms@my-domain:~$ sudo iptables -L -v
Chain INPUT (policy ACCEPT 2936 packets, 238K bytes)
 pkts bytes target     prot opt in     out     source               destination

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination

Chain OUTPUT (policy ACCEPT 2567 packets, 393K bytes)
 pkts bytes target     prot opt in     out     source               destination

坦率地说,我很困惑。我也重启了也没用。

有什么建议么?

更新

使用 IP 地址卷曲

curl x.y.z.a:80
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:--  0:00:03 --:--:--     0
curl: (7) Failed to connect to x.y.z.a port 80: Connection refused

在服务器本身上卷曲 localhost

curl localhost
<!DOCTYPE html>
<html>
<head>
<title>Welcome to nginx!</title>
<style>
    body {
        width: 35em;
        margin: 0 auto;
        font-family: Tahoma, Verdana, Arial, sans-serif;
    }
</style>
</head>
<body>
<h1>Welcome to nginx!</h1>
<p>If you see this page, the nginx web server is successfully installed and
working. Further configuration is required.</p>

<p>For online documentation and support please refer to
<a href="http://nginx.org/">nginx.org</a>.<br/>
Commercial support is available at
<a href="http://nginx.com/">nginx.com</a>.</p>

<p><em>Thank you for using nginx.</em></p>
</body>
</html>
ubuntu nginx ubuntu-20.04 lets-encrypt linode
  • 1 个回答
  • 3963 Views
Martin Hope
Codester
Asked: 2020-08-29 04:46:12 +0800 CST

如何备份 Linode 配置

  • 0

我已经在 Ubuntu 18.04 Linode 上设置了 LEMP。我已经为我的 laravel 应用程序配置了所有必需的设置。

  1. 有人可以建议如何备份这些设置,以便我可以将相同的设置用于另一个 linode 设置。
  2. 我还需要建议是否有任何其他方法可以设置安全的 LEMP 安装,而无需在我的 SSH 中手动从头开始

注意:我知道另一个 linode 可以从现有的 linode 中分离出来。我只需要使用我满意的配置重建另一个 linode。

谢谢

backup ubuntu sysadmin linode
  • 1 个回答
  • 30 Views
Martin Hope
RooSoft
Asked: 2020-02-20 13:30:49 +0800 CST

使用普通 OpenVPN 将本地子网双向连接到 VPS 服务器

  • 1

假设我们有一个本地子网192.168.1.0/24,需要通过10.8.0.0/24使用 OpenVPN 创建的子网双向连接到任何 VPS(Amazon EC2、Linode、Vultr 等)上的机器。

其中一部分已经完成。使用 TUN 连接 VPS 机器非常简单。我们还使用配置文件中的以下命令成功地为其授予了对本地子网的访问权限:

route 192.168.1.0 255.255.255.0

它现在可以连接到该本地子网中的任何计算机。问题在于反过来连接。本地机器找不到任何通往 VPS 服务器的路由。

应该将什么配置添加到 VPS 机器或本地 OpenVPN 服务器以允许从到192.168.1.3路由?根据我们的实际配置,无法到达目的地。192.168.1.1010.8.0.10traceroute

这是驻留在服务器上的配置文件的概述

local 192.168.1.3
port 1194
proto udp
dev tun
ca ca.crt
cert server.crt
key server.key
dh dh.pem
auth SHA512
tls-crypt tc.key
topology subnet
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
max-clients 1
route 192.168.1.0 255.255.255.0 192.168.1.1
push "dhcp-option DNS 1.1.1.1"
push "dhcp-option DNS 1.0.0.1"
keepalive 10 120
cipher AES-256-CBC
user nobody
group nobody
persist-key
persist-tun
status openvpn-status.log
verb 3
crl-verify crl.pem
explicit-exit-notify
[... certificates here ...]

这是客户端的配置:

client
dev tun
proto udp
remote [... our VPN's public address ...] 1194
resolv-retry infinite
nobind
persist-key
persist-tun
remote-cert-tls server
auth SHA512
cipher AES-256-CBC
ignore-unknown-option block-outside-dns
block-outside-dns
verb 3
route 192.168.1.0 255.255.255.0
[... certificates here ...]
openvpn amazon-ec2 vps vultr linode
  • 2 个回答
  • 48 Views
Martin Hope
The Fool
Asked: 2020-02-14 09:54:04 +0800 CST

Linode / Nanode - 运行 yum update 时内存不足

  • 0

我从最小的模型 linode 租了一个 nanode。我尝试安装导致一些问题的 powershell 内核。

现在我得到了内存分配错误:

[codingsafari@centosbox ~]$ sudo yum update
CentOS-8 - AppStream                                                                140 kB/s | 4.3 kB     00:00
CentOS-8 - Base                                                                     155 kB/s | 3.8 kB     00:00
CentOS-8 - Extras                                                                    43 kB/s | 1.5 kB     00:00
Extra Packages for Enterprise Linux 8 - x86_64                                       33 kB/s |  14 kB     00:00
packages-microsoft-com-prod                                                          28 kB/s | 2.9 kB     00:00
Out of memory allocating 771751936 bytes!
Killed

回想起来,我认为这一直是问题所在,现在只是我第一次看到这个有用的警告。

有谁知道在使用没有流量且仅运行 nginx 的 nanode 时是否会出现这种情况?

[codingsafari@centosbox ~]$ free -m
              total        used        free      shared  buff/cache   available
Mem:            821          77         648           1          95         633
Swap:           511          75         436
centos yum powershell dnf linode
  • 1 个回答
  • 648 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve