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
    • 最新
    • 标签
主页 / user-252462

rlib's questions

Martin Hope
rlib
Asked: 2016-09-01 06:40:28 +0800 CST

Haproxy:达到maxconn时如何主动重置客户端连接?

  • 0

从文档中:

maxconn <number>
Sets the maximum per-process number of concurrent connections to <number>. It
is equivalent to the command-line argument "-n". Proxies will stop accepting
connections when this limit is reached. The "ulimit-n" parameter is
automatically adjusted according to this value. See also "ulimit-n". Note:
the "select" poller cannot reliably use more than 1024 file descriptors on
some platforms. If your platform only supports select and reports "select
FAILED" on startup, you need to reduce maxconn until it works (slightly
below 500 in general).

据我了解,当客户端尝试连接到代理并且代理有maxconn连接时,它不会向客户端发送 SYN+ACK 包,因此客户端最终会超时。

如果到达,我想让 haproxy 向客户端发送 RST maxconn。可能吗?

haproxy
  • 1 个回答
  • 577 Views
Martin Hope
rlib
Asked: 2016-08-22 03:03:33 +0800 CST

Haproxy 的会话信息页面是什么意思?

  • 0

我正在使用 haproxy 1.6.8。

以下信息输出于

echo "show sess" | nc -U /var/lib/haproxy/stats 


0x1696d40: proto=tcpv4 src=67.55.94.187:51183 fe=adf be=adfback srv=capped ts=08 age=0s calls=4 rq[f=8400a0h,i=0,an=2000h,rx=,wx=,ax=] rp[f=400000h,i=0,an=60000h,rx=59s,wx=,ax=] s0=[7,8h,fd=186,ex=] s1=[7,108h,fd=209,ex=] exp=59s
0x17d4dd0: proto=tcpv4 src=173.239.36.124:19785 fe=adf be=adfback srv=capped2 ts=08 age=0s calls=4 rq[f=8400a0h,i=0,an=2000h,rx=,wx=,ax=] rp[f=400000h,i=0,an=60000h,rx=59s,wx=,ax=] s0=[7,8h,fd=100,ex=] s1=[7,108h,fd=246,ex=] exp=59s
0x16f7fc0: proto=tcpv4 src=67.55.94.183:54971 fe=adf be=adfback srv=capped ts=08 age=0s calls=4 rq[f=8400a0h,i=0,an=2000h,rx=,wx=,ax=] rp[f=400000h,i=0,an=60000h,rx=59s,wx=,ax=] s0=[7,8h,fd=168,ex=] s1=[7,108h,fd=288,ex=] exp=59s
0x1a8b170: proto=tcpv4 src=67.55.94.182:18194 fe=adf be=adfback srv=capped ts=08 age=0s calls=4 rq[f=8400a0h,i=0,an=2000h,rx=,wx=,ax=] rp[f=400000h,i=0,an=60000h,rx=59s,wx=,ax=] s0=[7,8h,fd=45,ex=] s1=[7,108h,fd=299,ex=] exp=59s

我该如何解释这些数据?有这方面的文档吗?

haproxy session stat
  • 1 个回答
  • 454 Views
Martin Hope
rlib
Asked: 2016-04-28 12:37:58 +0800 CST

我必须在 IBM X3650 M4 和 HP DL380pG8 之间进行选择。要考虑什么?

  • 0

我必须在 IBM X3650 M4 和 HP DL380pG8 服务器之间进行选择。两者都是 6 核 Xeon e5-2620,具有 64 Mb 的 RAM,价格相同。我应该考虑哪些因素来在它们之间做出选择?它们的性能似乎相同。拿什么?

dedicated-server
  • 1 个回答
  • 84 Views
Martin Hope
rlib
Asked: 2015-12-25 08:36:32 +0800 CST

如何将标头传递给 Nginx 中的远程错误处理程序

  • 2

我有 nginx 服务器在 1.1.1.1:8081 向 apache httpd 发送 404 错误。如何将所有原始标头传递给错误服务器?

我有以下配置:

server {
   error_page 404 = http://1.1.1.1:8081/404.php?remote=1;
}

检查 404.php 中的标头时,我得到客户端原始 ip,但没有来自客户端的 cookie;另外,我将请求 uri 设置为404.php?remote=1而不是导致 404 错误的 url:

<?php
  // 404.php file
  file_put_content("log.txt", $_SERVER['REQUEST_URI'], FILE_APPEND); // :(
  file_put_content("log.txt", $_SERVER['REMOTE_ADDR'], FILE_APPEND); // Ok
  file_put_content("log.txt", $_COOKIE['MyCookie'], FILE_APPEND); // :( empty
?>
nginx
  • 1 个回答
  • 982 Views
Martin Hope
rlib
Asked: 2015-08-08 10:05:44 +0800 CST

AWS 写入权限,httpd 2.4

  • 0

Amazon Web Services,服务器版本:Apache/2.4.6 (Red Hat Enterprise Linux)

apache日志报告:

[Fri Aug 07 13:53:40.793562 2015] [:error] [pid 10730] [client 149.88.114.40:40800] PHP Warning:  file_put_contents(./test.txt): failed to open stream: Permission denied in /var/www/html/vraim/index.php on line 18

这是尝试写入当前目录的 PHP 代码:

<?php
file_put_contents("./test.txt", "Test"); // <=== This cannot write!!!
$uid = posix_getuid();
echo "PosixGetUID: " . $uid . "<br/>";
$userinfo = posix_getpwuid($uid);
print_r($userinfo);
?>

目录权限:

# namei -movl /var/www/html/vraim/
f: /var/www/html/vraim/
dr-xr-xr-x root   root /
drwxr-xr-x root   root var
drwxr-xr-x root   root www
drwxr-xr-x apache root html
drwxrwxrwx apache root vraim

虚拟主机的 httpd.conf:

DocumentRoot /var/www/html/vraim
<Directory />
   Require all granted
</Directory>

我做错了什么?为什么 PHP 不能写入 Apache 拥有的文件夹?

PHP 脚本本身会输出以下有关其有效用户 ID 的信息:

PosixGetUID: 48
Array ( [name] => apache [passwd] => x [uid] => 48 [gid] => 48 [gecos] => Apache [dir] => /usr/share/httpd [shell] => /sbin/nologin )
php
  • 1 个回答
  • 466 Views
Martin Hope
rlib
Asked: 2015-08-02 01:24:26 +0800 CST

UDP 数据包到达 VPN 接口并没有传递给进程

  • 1

我有一台服务器 X (45.55.245.182) 通过 VPN 连接到服务器 Y。X 上的 VPN 接口是 tap0,ip 为 10.200.0.2;Y 上的 VPN 接口是 tap0,ip 为 10.200.0.1。我在服务器 Y 上运行 netcat 来监听 UDP 35000:

nc -lu 10.200.0.1 35000

在服务器 X 上,端口 35000 的数据包使用以下 iptables 规则进行 DNAT 处理:

iptables -t nat -A PREROUTING -p udp --dport 35000 -j DNAT --to-destination 10.200.0.1

在服务器 Y 上的 tap0 接口上运行 tcpdump 显示数据包按预期发送:

11:54:44.000610 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has 10.200.0.1 tell 10.200.0.2, length 28
11:54:44.000638 ARP, Ethernet (len 6), IPv4 (len 4), Reply 10.200.0.1 is-at fa:0f:00:1a:57:59 (oui Unknown), length 28
11:54:44.154702 IP (tos 0x8, ttl 47, id 52840, offset 0, flags [DF], proto UDP (17), length 34)
    hotnet-213-57-17-185.hotnet.net.il.24740 > 10.200.0.1.35000: [udp sum ok] UDP, length 6

请参阅显示设置的图表: 在此处输入图像描述

但是,我看不到服务器 Y 上的侦听 netcat 获取数据(当我在客户端上按 enter 时,Y 的屏幕上没有任何回声)。

有什么问题?

iptables
  • 2 个回答
  • 563 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