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 / 问题

问题[timeout](server)

Martin Hope
Timothy Fisher
Asked: 2022-02-28 16:51:24 +0800 CST

尝试 ssh 到服务器时操作超时

  • 1

scp当命令停止在 92%时,我正在两台远程机器之间传输文件。当我进去重试时,我意识到我无法再 ssh 进入服务器。但是,我确实可以通过我的服务器主机的 VNC 终端访问。

我尝试从主机的 Web 面板重新启动sshd、执行systemctl reboot和关闭/重新启动服务器,但我仍然无法通过 SSH 连接到服务器。我也检查过/var/log/auth.log,它没有记录任何关于连接超时的信息。

我完全禁用了服务器防火墙(iptables),输出systemctl status sshd显示它正在工作并在端口 22 上侦听。

输出iptables -L:

Chain INPUT (policy ACCEPT)
Chain FORWARD (policy ACCEPT)
Chain OUTPUT (policy ACCEPT)

我已经能够从我的机器上很好地连接到其他服务器。我的 SSH 命令的输出-vvv是:

OpenSSH_8.1p1, LibreSSL 2.7.3
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 47: Applying options for *
debug1: Connecting to <server-ip> port 22.
ssh: connect to host <server-ip> port 22: Operation timed out

此外,正如此处其他一些相关问题所述,我在端口 42 上手动启动 sshd/usr/sbin/sshd -p 42 -d并尝试连接,但连接仍然从我的本地计算机超时,并且没有输出记录到终端。

根据评论中的建议,我ssh user@localhost从我的 VNC 终端中运行,并且有效。所以看起来 ssh 正在为 localhost 工作,但没有其他用户可以从外部连接。似乎是防火墙问题,但我已经打开了所有 iptables 规则。

更新: SSH 随机开始工作了大约 30 分钟,没有任何变化。我能够复制我需要的文件。然后,不久之后,连接冻结并断开了我的连接,它又回到了无法工作的状态。

linux debian ssh timeout
  • 1 个回答
  • 1024 Views
Martin Hope
SuperSim135
Asked: 2020-12-22 11:27:45 +0800 CST

为什么我的域名每次 ping 都能正常工作,但在浏览器中却不行?

  • 0

我的域名“codeplane.dev”(其 IP 地址使用 Google 的 dydns API 定期更新)可以被 ping 并在 ping 时显示正确的 IP 地址,但是每当我尝试在 Firefox 中访问该域时,请求都会超时. 这种行为只有在我使用域名时才会发生,每当我将 ping 命令显示的 IP 地址输入到 Firefox 中时,网站都可以正常显示。我应该怎么做,以确保每当我在浏览器中输入我的域时,我的网页就会显示出来?

这是我的 apache 网站配置:codeplane.dev.conf

<VirtualHost *:80>
    ServerName codeplane.dev
    ServerAlias www.codeplane.dev
    DocumentRoot /var/www/codeplane.dev/public_html
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

<VirtualHost *:443>
    ServerName codeplane.dev
    ServerAlias www.codeplane.dev
    DocumentRoot /var/www/codeplane.dev/public_html
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
ip ping timeout apache-2.4 google-domains
  • 4 个回答
  • 2137 Views
Martin Hope
StarKev2525
Asked: 2020-11-19 06:57:55 +0800 CST

即使客户端发送 NO-OP 也结束 SSH 会话

  • 0

我们正在尝试找到一种很好的方法来断开与我们服务器的 SSH 会话,当用户在一天回家时将他们的 SSH 会话保持连接状态。SSHD 超时设置(ClientAliveInterval 300,ClientAliveCountMax 0)不会断开用户的连接,因为用户已将 SecureCRT 设置为每 60 秒“发送协议 NO-OP”。因此 ssh 服务器认为会话不是空闲的。

有什么方法可以让 SSH 服务器忽略 NO-OP 命令,或者在用户没有其他输入的情况下使用另一种方法来超时/结束会话?

谢谢

linux centos ssh timeout
  • 1 个回答
  • 528 Views
Martin Hope
Tumbelo
Asked: 2020-11-04 01:34:12 +0800 CST

使用 mod_proxy 时如何正确增加 Apache 的超时时间

  • 1

背景:

我有机器对机器的通信系统,客户端不时向Apache服务器发送数据。由于使用移动 2G 进行通信,因此通信速度很慢。Apache 使用 mod_wsgi(用于 Django)。

由于客户端在开始通信时不知道实际数据量,因此客户端和服务器之间使用分块传输编码。因为 mod_wsgi 不支持分块传输编码,所以我使用 mod_proxy,它接收块并将它们作为单个请求传递给 mod_wsgi,并在收到所有数据后添加内容长度信息。

问题:

我将服务器上的 Ubuntu 从 16.04 更新到 18.04,之后客户端和服务器之间的一些通信开始失败。从 Apache 的 access.log 中,我可以看到,该服务器使用“大”数据向客户端响应 408。大意味着在这种情况下数据量需要大约 60 秒的时间进行传输。客户端没有任何变化。

我了解到,对于 Apache 2.4(我在服务器的 Ubuntu 18.04 上拥有)TimeOut 是 60 秒,对于早期的 Apache 版本它是 300 秒。我想这是在“大”数据的情况下与新服务器操作系统通信失败的原因。

边注:

我注意到启用 mod_security 可以解决问题(没有“大”数据的 408),但就在我禁用 mod_security 并重新启动 Apache 时,408 返回图片。security.conf 中没有与超时相关的内容。

问题:

如何正确增加 TimeOut?

到目前为止尝试过:

由于 Apache 真的不是我的核心能力,我一直在尝试将 Timeout 增加到某些地方(也尝试过 KeepAliveTimeout,即使我认为这不是正确的方法):

apache.conf 片段:

#
# Timeout: The number of seconds before receives and sends time out.
#
Timeout 300

#
# KeepAlive: Whether or not to allow persistent connections (more than
# one request per connection). Set to "Off" to deactivate.
#
KeepAlive On

#
# MaxKeepAliveRequests: The maximum number of requests to allow
# during a persistent connection. Set to 0 to allow an unlimited amount.
# We recommend you leave this number high, for maximum performance.
#
MaxKeepAliveRequests 100

#
# KeepAliveTimeout: Number of seconds to wait for the next request from the
# same client on the same connection.
#
KeepAliveTimeout 300

example.com.conf 片段:

ProxyRequests Off
ProxyTimeout 300

<Proxy http://example.com:81>
        Order deny,allow
        Allow from all
</Proxy>

<VirtualHost *:80>
        SetEnv proxy-sendcl 1
        ProxyPass / http://example.com:81/ connectiontimeout=300 timeout=300
        ProxyTimeout 300
        ProxyPassReverse / http://example.com:81/
        ProxyPreserveHost On
        ProxyVia Full

        <Directory proxy:*>
                Order deny,allow
                Allow from all
        </Directory>
</VirtualHost>

Listen 81

<VirtualHost *:81>
    # The ServerName directive sets the request scheme, hostname and port that
    # the server uses to identify itself. This is used when creating
    # redirection URLs. In the context of virtual hosts, the ServerName
    # specifies what hostname must appear in the request's Host: header to
    # match this virtual host. For the default virtual host (this file) this
    # value is not decisive as it is used as a last resort host regardless.
    # However, you must set it for any further virtual host explicitly.
    ServerName example.com
proxy timeout apache-2.4 http-status-code-408
  • 1 个回答
  • 4730 Views
Martin Hope
Pablo Derbez
Asked: 2020-10-19 17:49:49 +0800 CST

与 Google Cloud 的 SSH 连接超时

  • 0

我对服务器/云计算很陌生,所以请多多包涵。

实例镜像:windows-server-1809-dc-core-for-containers-v20200908

我的问题是,当我尝试通过 SSH 连接到我的实例时,Putty 客户端一直超时。但我可以通过远程桌面连接访问实例就好了。

我已经按照此处的详细信息配置了公钥和私钥。我已经向防火墙添加了例外并尝试将其全部禁用。这是我相关的腻子配置: 在此处输入图像描述 在此处输入图像描述 在此处输入图像描述 在此处输入图像描述

我尝试通过 Putty 连接的全部原因是我想使用 X11 转发(使用 Xming)远程运行带有 GUI 的程序。我正在尝试运行 Stata 16。任何帮助将不胜感激。

ssh timeout google-cloud-platform putty
  • 1 个回答
  • 359 Views
Martin Hope
Yosko
Asked: 2020-08-20 04:58:09 +0800 CST

如何对 Apache 子域超时进行故障排除?

  • 0

我的服务器上有几个子域,当从任何 http 客户端(在 80 上的 HTTP 或 443 上的 HTTPS,取决于子域)联系时,所有子域都会给我超时。

例如:http ://test.yosko.net

当直接从同一服务器联系时,HTTP 请求有效并由 Apache 记录:

$ wget http://test.yosko.net/
...
2020-08-19 12:34:20 (603 KB/s) - ‘index.html’ saved [6/6]

但是当从任何其他客户端完成时,我会超时,并且在 Apache 的 error.log 或 access.log 中找不到任何内容。

起初我想到了我的 HTTPS 子域的 certbot 配置存在问题,但由于 HTTP 子域相同,我认为这是一个更广泛的问题。由于服务器上没有代理或反向代理,我看不到它来自哪里。

它突然发生,几天前我的角色没有任何改变,从那时起,在长时间的失败之间,事情在这里和那里工作了几个小时。

有关如何解决此问题的任何想法?

附加信息:我在 Ubuntu Server 20.04 上使用 Apache 2.4。

编辑 1:IPv6 问题

正如这里所建议的,我在ipv6-test.com上测试了我上面的链接,它确实给出了超时。我想我的 ISP 尝试在 IPv6 中联系我的网站(它失败了),而其他人仍在尝试在 IPv4 中(它可以工作)。

但现在我知道我自己也可以尝试。来自我的客户:

$ wget -4 http://test.yosko.net/
...
2020-08-20 09:25:53 (151 KB/s) - «index.html» enregistré [6/6]

$ wget -6 http://test.yosko.net/
...
HTTP request sent, awaiting response... Read error (Connection timed out) in headers.

编辑2:当前配置

我的当前/etc/apache2/ports.conf是默认的,从所有 IP 监听:

Listen 80

它确实适用于 IPv6(请参阅“ tcp6”提及):

$ sudo netstat -lnptu | grep "apache2\W*$"
tcp6       0      0 :::443                  :::*                    LISTEN      89445/apache2       
tcp6       0      0 :::80                   :::*                    LISTEN      89445/apache2

还有我的虚拟主机:

<VirtualHost *:80>

我也试过这个,但问题仍然存在:

<VirtualHost *:80 [::]:80>
timeout apache-2.4
  • 1 个回答
  • 432 Views
Martin Hope
Ilya Cherevkov
Asked: 2020-03-29 13:23:32 +0800 CST

Puma & NGINX 上游超时(110:连接超时)

  • 0

访问在 Nginx 代理后面使用 systemd 服务运行的 Puma 应用程序会导致 nginx error.log 中出现以下错误:

 *6 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 1.2.3.4, server: mydomain.com, request: "GET / HTTP/1.1", upstream: "http://unix:/home/deploy/opt/app/shared/sockets/puma.app.sock/", host: "mydomain.com"

Puma 服务日志没有错误。

不过,在本地(在 nginx 之前)手动运行 Puma 应用程序不会产生任何错误。同样,在 http 代理而不是 puma unix 套接字上运行相同的应用程序也可以正常工作,允许 Nginx 正确地服务器请求。所以看起来问题不在于我的后端红宝石。

堆

  • 彪马 4.3.3
  • 罗达 3.30.0
  • RBenv Ruby 2.7.0
  • Nginx 1.14.0

/etc/nginx/sites_available/mydomain.com

upstream app {
  server unix:/home/deploy/opt/app/shared/sockets/puma.app.sock;
}

server {
  listen 80;
  server_name mydomain.com;
  root /home/deploy/opt/app/public;

  location / {
    try_files $uri @puma;
  }

  location @puma {
    include proxy_params;

    proxy_pass http://app;
  }
}

/etc/systemd/system/puma-app.service

[Unit]
Description=Puma HTTP Server
After=network.target

[Service]
# Foreground process (do not use --daemon in ExecStart or config.rb)
Type=simple

# Preferably configure a non-privileged user
User=deploy
Group=sudo

# Specify the path to your puma application root
WorkingDirectory=/home/deploy/opt/app

# Helpful for debugging socket activation, etc.
Environment=DEBUG=1
EnvironmentFile=/home/deploy/opt/app/.env

# The command to start Puma
ExecStart=/home/deploy/.rbenv/shims/bundle exec puma -C /home/deploy/opt/app/config/puma.rb

TimeoutSec = 15
Restart=always

[Install]
WantedBy=multi-user.target

/home/deploy/opt/app/config/puma.rb

# Change to match your CPU core count
workers ENV.fetch("PUMA_WORKERS") { 1 }

# Min and Max threads per worker
threads ENV.fetch("PUMA_MIN_THREADS") { 1 }, ENV.fetch("PUMA_MAX_THREADS") { 10 }

app_dir = File.expand_path("../..", __FILE__)
shared_dir = "#{app_dir}/shared"

# Set up socket location
bind "unix://#{shared_dir}/sockets/puma.app.sock"

# Redirect STDOUT to log files
stdout_redirect "#{app_dir}/log/puma.stdout.log", "#{app_dir}/log/puma.stderr.log", true

# Set master PID and state locations
pidfile "#{shared_dir}/pids/puma.app.pid"
state_path "#{shared_dir}/pids/puma.app.state"
rackup app_dir

activate_control_app
ruby timeout nginx
  • 1 个回答
  • 1447 Views
Martin Hope
NetworkMeister
Asked: 2018-01-17 05:20:59 +0800 CST

如果在下一次尝试中间,linux 是否接受配置超时后的 DNS 回复?

  • 1

/etc/resolv.conf配置为:

options timeout:1 attempts:5 rotate
nameserver A
nameserver B

两个配置的名称服务器都有 3 秒的延迟。发生以下消息交换:

  • 00:00 - 查询 #1 发送到 A
  • 00:01 - 查询 #2 发送到 B
  • 00:02 - 查询 #3 发送到 A
  • 00:03 - 查询 #4 发送到 B
  • 00:03 - 从 A 收到回复 #1

Linux 解析器是否会接受对查询 #1 的回复,因为它仍在解析地址,或者是否丢弃初始 1 秒超时后的所有回复?

不幸的是,man resolf.conf并没有真正澄清这一点。

timeout
  • 2 个回答
  • 422 Views
Martin Hope
David Magalhães
Asked: 2017-01-13 09:28:34 +0800 CST

Debian 服务器每 5/6 分钟超时约 20 秒

  • 3

我有一台机器运行 Debian 很长一段时间(可能是 7 年)24/7。两周前,我决定移动服务器的位置,并升级到 Debian Jessie(正在运行 wheezy)。

一切都很顺利,除了每 5 或 6 分钟服务器在大约 20 秒内没有响应任何连接。

我创建了一个脚本来检查何时发生,这是时间:

2017-01-12 16:16:05 TIMEOUT!
2017-01-12 16:21:49 TIMEOUT!
2017-01-12 16:27:32 TIMEOUT!
2017-01-12 16:33:13 TIMEOUT!
2017-01-12 16:39:01 TIMEOUT!
...
2017-01-12 17:07:59 TIMEOUT!
2017-01-12 17:13:47 TIMEOUT!
2017-01-12 17:19:25 TIMEOUT!

我在服务器上运行了一个虚拟机,数据包可以很好地到达它,没有任何延迟。我已经在服务器上测试了不同的端口,例如 80、443、9000 等,并且都超时。在服务器上,例如运行 ssh,如果我在超时期间尝试一个命令,例如输入 3 次“ls”,在它恢复后它将收到 3 个“ls”并执行。

我检查了服务器上的日志,但找不到任何相关信息。

编辑:让 ping 运行不会显示超时。

EDIT2:好的,另一个奇怪的事情。访问服务器上的 ssh,并在超时开始发生时运行 ping 8.8.8.8(或可能输出文本的任何命令),如果我按 CTRL+C 取消它,我仍然可以毫无问题地查看 ping 的文本输出,我看到了 ping 的 min/avg/max 状态,但如果我键入命令(例如“ls”),它会等到服务器再次可用以显示文件列表。

EDIT3:所以,它可能与磁盘有关。sda 是三星 SSD 840 Pro 120GB。

iostats 显示以下内容:

正常行为:

Device:         rrqm/s   wrqm/s     r/s     w/s    rkB/s    wkB/s avgrq-sz avgqu-sz   await r_await w_await  svctm  %util
sda               0.00     0.00    0.00    2.00     0.00    20.00    20.00     0.00    0.00    0.00    0.00   0.00   0.00
sdb               0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00    0.00    0.00   0.00   0.00
sdc               0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00    0.00    0.00   0.00   0.00
dm-0              0.00     0.00    0.00    2.00     0.00    20.00    20.00     0.00    0.00    0.00    0.00   0.00   0.00
dm-1              0.00     0.00    0.00    2.00     0.00    20.00    20.00     0.00    0.00    0.00    0.00   0.00   0.00
dm-2              0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00    0.00    0.00   0.00   0.00

超时行为:

Device:         rrqm/s   wrqm/s     r/s     w/s    rkB/s    wkB/s avgrq-sz avgqu-sz   await r_await w_await  svctm  %util
sda               0.00     0.00    0.00  136.00     0.00 69124.00  1016.53   127.69 1053.93    0.00 1053.93   7.35 100.00
sdb               0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00    0.00    0.00   0.00   0.00
sdc               0.00    16.00    0.00   18.50     0.00   540.00    58.38     0.10    5.51    0.00    5.51   1.19   2.20
dm-0              0.00     0.00    0.00    1.00     0.00     4.00     8.00   521.34 363490.00    0.00 363490.00 1000.00 100.00
dm-1              0.00     0.00    0.00    1.00     0.00     4.00     8.00   521.35 363492.00    0.00 363492.00 1000.00 100.00
dm-2              0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00    0.00    0.00   0.00   0.00
debian timeout
  • 1 个回答
  • 225 Views
Martin Hope
Gerald Schneider
Asked: 2017-01-12 02:05:58 +0800 CST

在 apache 上使用 ldap auth 调试超时

  • 5

几个月来,我一直在尝试调试 Apache 的超时问题。

该模式如下所示:

在新会话的每个第一个请求(或在最后一个请求之后的一段时间后)浏览器会立即要求提供凭据,然后使用基本身份验证发送请求。然后服务器在发送结果之前正好等待 1 分钟。

在此处输入图像描述

随后的请求会立即得到答复,这只发生在一段时间后的请求(尚无法准确定位,在 5 到 15 分钟之间)。

等待时间可精确重现 60 秒这一事实对我来说就像是超时。如果我取消请求并点击重新加载,我会立即获得请求的 URL。

由于密码提示也会立即出现,我可以排除客户端和服务器之间的 SSL 握手问题,或者那条腿上的 DNS 问题。如果我请求 PHP 脚本或空白文本文件并不重要,这也排除了服务器上的脚本问题。我猜验证过程的结果会被缓存一段时间,因此后续请求不需要它。

请注意,身份验证总是成功的,所以我也可以排除“域控制器没有回答”的问题。

Apache 2.4 在 Windows Server 2012 R2 上运行。它是为 LDAP 身份验证配置的:

<Location />
    AuthType Basic
    AuthName "AD Login"
    AuthBasicProvider ldap
    LDAPReferrals Off
    #AuthLDAPUrl ldap://dc01.domain.de:3268/dc=ad,dc=domain,dc=de?sAMAccountName?sub?(objectClass=*)
    #AuthLDAPUrl ldap://ad.domain.de:389/dc=ad,dc=domain,dc=de?sAMAccountName?sub?(objectClass=*) STARTTLS
    AuthLDAPUrl ldap://ad.domain.de:389/dc=ad,dc=domain,dc=de?sAMAccountName?sub?(objectClass=*) TLS
    AuthLDAPBindDN "[email protected]"
    AuthLDAPBindPassword "secret"
    Require valid-user
    Require all denied
</Location>

如您所见,我尝试了与域控制器的不同连接类型,我使用哪种加密方法似乎并不重要,或者我是否传递加密。

ad.domain.de 解析到多个域控制器,但如果我连接到特定的 DC,行为是相同的。

错误日志中没有条目LogLevel info,我还在犹豫是否将其增加到debug,因为我从经验中知道我无法筛选生成的调试信息。

有什么我错过的东西可以用来调试问题,还是我必须通过调试级别日志记录?

active-directory timeout apache-2.4 mod-auth-ldap
  • 1 个回答
  • 7245 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