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-214727

frlan's questions

Martin Hope
frlan
Asked: 2018-11-02 05:15:04 +0800 CST

如何添加 GET 参数导致 Varnish 服务未缓存页面

  • 1

我想向某个 URL 添加一个参数,该参数允许我为页面取消缓存提供服务。所以像https://example.org/foo/baa?uncached这样的东西应该是应用服务器的服务器,而https://example.org/foo/baa可能是直接从 varnish 的缓存中提供的。

为此,我尝试添加

if (req.url ~ "^/\?uncached") {
    set req.http.X-VC-Cacheable = "NO:On user request";
    return(pass);
}

到我的 vcl_recv。但不知何故,这不起作用(缓存行为未切换)。这是正确的方法吗?我做错了什么?

varnish
  • 2 个回答
  • 30 Views
Martin Hope
frlan
Asked: 2017-07-11 04:01:53 +0800 CST

通过跳转主机进行 pssh 和 ssh-agent 密钥转发

  • 2

我正在尝试使用 pssh 结合跳转主机和 ssh-agent 密钥转发连接到多个主机。

不幸的是,这经常失败,但是不同的主机失败了。所以这只是一个例子,下次看起来会有所不同:

 ~> pssh -h /tmp/hostfile -o /tmp/log  -e /tmp/error/ -v uname -a
[1] 13:51:18 [FAILURE]  host1 Exited with error code 255
[2] 13:51:19 [SUCCESS]  host2 
[3] 13:51:19 [SUCCESS]  host3 
[4] 13:51:19 [SUCCESS]  host4
[5] 13:51:19 [SUCCESS]  host5
[6] 13:51:19 [SUCCESS]  host6
[7] 13:51:19 [SUCCESS]  host7
….
[16] 13:51:19 [SUCCESS] host16

当有更深入的了解时,我得到

ssh_exchange_identification: Connection closed by remote host
ssh_exchange_identification: Connection closed by remote host

在失败的主机上。这看起来很像通过跳转主机的 ssh-agent 密钥转发在这种特定情况下不起作用。

在我的 ~.ssh/config 中,它看起来像这样:

ForwardAgent yes

Host *.tld.foo
    User frlan
    ProxyCommand ssh tld-jump-host nc %h %p

Host tld-jump-host
    HostName myhost.example.com
    User frlan
    ProxyCommand none

通常这是有效的。现在我想知道为什么从大约 15 台主机开始有时没有转发密钥,而我可以升级我的配置以防止这种情况发生。

ssh
  • 1 个回答
  • 2400 Views
Martin Hope
frlan
Asked: 2016-11-24 07:58:40 +0800 CST

通过 http auth 和大量请求提高 Nginx 的性能

  • 1

我在 Nginx 服务器后面通过 fpm 运行了一个 PHP 端。对于 $reasons,我们需要在该设置之前有一个 http 基本身份验证,所以我最终设置为:

#… server section ….

    auth_basic "Restricted";
    auth_basic_user_file /path/to/htpasswd;

#… some more locations …

location ~ \.php$ {


    fastcgi_pass 127.0.0.1:9001;
    fastcgi_split_path_info ^(.+\.php)(/.*)$;
    include /etc/nginx/fastcgi_params;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    fastcgi_param HTTPS off;
    fastcgi_param APPLICATION_ENV production;
}

哪个有效-但速度很慢。它仅以 100% 的 cpu 利用率处理一个又一个请求。如果我删除 http_auth 它的工作速度很快。

我的问题是:如何改进设置以确保即使使用 http_auth 性能也不错?

以供参考:

# nginx -V
nginx version: nginx/1.8.1
built with OpenSSL 1.0.2j  26 Sep 2016
TLS SNI support enabled
configure arguments: --prefix=/usr --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error_log --pid-path=/run/nginx.pid --lock-path=/run/lock/nginx.lock --with-cc-opt=-I/usr/include --with-ld-opt=-L/usr/lib --http-log-path=/var/log/nginx/access_log --http-client-body-temp-path=/var/lib/nginx/tmp/client --http-proxy-temp-path=/var/lib/nginx/tmp/proxy --http-fastcgi-temp-path=/var/lib/nginx/tmp/fastcgi --http-scgi-temp-path=/var/lib/nginx/tmp/scgi --http-uwsgi-temp-path=/var/lib/nginx/tmp/uwsgi --with-ipv6 --with-libatomic --with-pcre --with-http_realip_module --add-module=external_module/ngx_devel_kit-0.2.19 --add-module=external_module/lua-nginx-module-0.9.15 --add-module=external_module/modsecurity-2.9.1-nginx-207c85d/nginx/modsecurity --with-http_ssl_module --without-mail_imap_module --without-mail_pop3_module --without-mail_smtp_module --user=nginx --group=nginx
php nginx http-basic-authentication
  • 2 个回答
  • 1002 Views
Martin Hope
frlan
Asked: 2016-08-18 01:42:45 +0800 CST

如何配置 postfix 以接收邮件并将它们保留在队列中但不发送出去

  • 2

如何将 postfix 配置为仅接收邮件并将它们放入本地队列但实际上不转发邮件,以便它们保留在 /var/spool/postfix 中

linux postfix
  • 1 个回答
  • 1089 Views
Martin Hope
frlan
Asked: 2016-07-06 05:19:39 +0800 CST

如何在 NixOS 上使用 Osm2pgsql 安装 Postgis

  • 0

在 NixOS 上安装 PostGIS 时使用如下表达式

  services.postgresql.extraPlugins = [ (pkgs.postgis.override { postgresql = pkgs.postgresql94; }).v_2_1_4 ];

如何向其中添加其他扩展,例如 Osm2pgsql?

postgresql nix nixos postgis
  • 1 个回答
  • 334 Views
Martin Hope
frlan
Asked: 2015-01-22 05:35:01 +0800 CST

Hadoop:如何为数据节点配置故障转移时间

  • 0

如果数据节点失败,我需要在我的 HDFS 集群上重新复制块。实际上,这似乎在大约 10 分钟后就已经发生了。但是,我想减少这个时间,但想知道该怎么做。

我试图设置dfs.namenode.check.stale.datanode但没有任何大的成功。那么配置选项是什么,或者我必须在这里调整哪些选项才能将其减少到 1 分钟?

hdfs-site.xml 的完整部分如下所示

<property>
    <name>dfs.namenode.check.stale.datanode</name>
    <value>true</value>
    <description>Activate stale check</description>
</property>

<property>
    <name>dfs.namenode.stale.datanode.interval</name>
    <value>10</value>
    <description>Timeout</description>
</property>
failover
  • 1 个回答
  • 2010 Views
Martin Hope
frlan
Asked: 2014-04-27 04:26:05 +0800 CST

Smartctl 报告块读取失败 - 如何标记为“不使用”?

  • 3

在我的一个硬盘上,我的 smart 测试结果很差,如下所示:

# 1  Extended offline    Completed: read failure       90%     19889         128652505
# 2  Short offline       Completed: read failure       10%     19882         128652505

据我了解,这意味着“仅”存在一些坏块,如何将它们标记为不使用?该磁盘在软件 RAID 中运行。

smart
  • 1 个回答
  • 535 Views
Martin Hope
frlan
Asked: 2014-04-05 04:11:41 +0800 CST

“警告:主机名 localhost 无法解析为地址 ::1:没有与主机名关联的地址”在 openVZ/Debian 容器内

  • 1

我从 postfix 定期在 mail.log 中获取消息。特别但不仅如此,在邮件发送收到的邮递员。

警告:主机名 localhost 无法解析为地址 ::1:没有与主机名关联的地址

::1 和 127.0.0.1 被定义为 /etc/hosts 中的 localhost——由 openVZ 提供。

实际上在 /etc/hosts 中配置了这些(出于某种原因,我删除了特殊域和 IP):

fe00::0         ip6-localnet
ff00::0         ip6-mcastprefix
ff02::1         ip6-allnodes
ff02::2         ip6-allrouters

2a01::<some IPv6> host.example.org  host example.org

127.0.0.1 localhost.localdomain localhost
# Auto-generated hostname. Please do not remove this comment.
xxx.xxx.xxx.xxx host.example.org  host example.org
::1             localhost ip6-localhost ip6-loopback

这似乎有效:

$ host localhost
localhost has address 127.0.0.1
localhost has IPv6 address ::1

在这个盒子上,bley 也在运行。

postfix
  • 4 个回答
  • 8173 Views
Martin Hope
frlan
Asked: 2014-04-02 01:40:25 +0800 CST

在 Hyper-V 上配置 1 个具有多核的套接字

  • 0

我正在运行 Hyper-V 2012,需要配置我的虚拟 CPU 基于一个插槽。所以客人看到的是一个插座,例如 4 芯。我发现一些名为 cpu z 的工具应该这样做,但这样做是“正确”的方式吗?

hyper-v
  • 1 个回答
  • 1466 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