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

djsumdog's questions

Martin Hope
djsumdog
Asked: 2018-11-11 21:25:39 +0800 CST

使用带有多个目录树的 nginx try_files

  • 5

我想让 nginx 通过检查该路径/文件是否存在于几个单独的目录中来处理对特定目录的请求。例如,如果我的目录根目录具有以下内容:

images/siteA/foo.jpg
images/siteB/b/bar.jpg
images/siteC/example.jpg

我想http://example.com/images/foo.jpg返回文件foo.jpg,http://example.com/b/bar.jpg返回文件bar.jpg等等。

我尝试了以下方法,但它只是被锁定在重定向循环中(我不希望它重定向,但实际上将文件提供给该 URL):

  location /images/ {
    try_files /siteA/images/
              /siteB/images/
              /siteC/images/ =404;

  } 

我也尝试过使用捕获组location ~/images/(.*)/,例如添加$1到 URL 的末尾。我对文档有点困惑,不确定如何使用 nginx 完成此操作。

nginx
  • 2 个回答
  • 14250 Views
Martin Hope
djsumdog
Asked: 2018-07-14 20:47:26 +0800 CST

为什么 spampd 在 openbsd 上会因套接字连接失败而失败?

  • 3

我在让 spampd 在 OpenBSD 中工作时遇到了一些麻烦。首先,如果我尝试/etc/rc.conf.local像这样指定守护程序标志:

spampd_flags="--port=10025 --relayhost=127.0.0.1:10027 --tagall -aw"

该服务在启动时不会以这些标志启动。我必须重新启动服务,然后它才能拾取这些标志。我发现以下文章提到了 2015 年的相同问题:

http://technoquarter.blogspot.com/2015/02/openbsd-mail-server-part-4-spamassassin.html

作为一种解决方法,我创建了一个/etc/rc.d/spampd_custom如下所示的脚本:

#!/bin/ksh

daemon="/usr/local/sbin/spampd --port=10025 --relayhost=127.0.0.1:10027 --tagall -aw"

. /etc/rc.d/rc.subr

rc_cmd $1

..我添加spampd_custom到pkg_scripts我的/etc/rc.conf/local. 这确实会使用正确的标志启动服务,但在尝试建立 SMTP 连接时服务会失败。我在前台运行它并在输出中看到:

# /usr/local/sbin/spampd --port=10025 --relayhost=127.0.0.1:10027 --tagall -aw
Jul 14 04:32:24 lori spampd[40465]: Pid_file "/var/run/spampd.pid" already exists.  Overwriting!  
Jul 14 04:32:24 lori spampd[4112]: Process Backgrounded 
lori# Jul 14 04:32:24 lori spampd[4112]: 2018/07/14-04:32:24 SpamPD (type Net::Server::PreForkSimple) starting! pid(4112) 
Jul 14 04:32:24 lori spampd[4112]: Binding to TCP port 10025 on host 127.0.0.1 with IPv4 
Jul 14 04:32:24 lori spampd[4112]: Setting gid to "746 746" 
Jul 14 04:32:24 lori spampd[4112]: Setting uid to "746" 
Jul 14 04:32:39 lori spampd[93147]: WARNING!! Error in process_request eval block: /usr/local/sbin/spampd: socket connect failure: Connection refused 
WARNING!! Error in process_request eval block: /usr/local/sbin/spampd: socket connect failure: Connection refused

我已经尝试了几次搜索,并在 Debian 跟踪器上找到了一些错误报告,但似乎找不到解决方案。看起来这是父 spampd 用来与似乎没有正确设置的子级通信的套接字。

我的配置有什么问题?

spamassassin
  • 1 个回答
  • 342 Views
Martin Hope
djsumdog
Asked: 2017-08-10 19:48:49 +0800 CST

FreeBSD 上的 PF 防火墙,用于允许 SSH 和 OpenVPN 流量

  • 0

我正在尝试为 FreeBSD 11.1-RELEASE 上的数据包过滤器创建一个简单的 ansible 模板。我有vtnet0(公共),vtnet1(私人,10.10 地址)和tun0(openvpn,从客户端到我网络上的节点的完全工作/测试)。

我的 rc.conf 如下所示:

hostname="bastion"
sshd_enable="YES"
static_routes="linklocal"
ifconfig_vtnet0="DHCP"
ifconfig_vtnet0_ipv6="inet6 accept_rtadv"
ipv6_activate_all_interfaces="YES"
rtsold_enable="YES"
rtsold_flags="-aF"
ifconfig_vtnet1="inet 10.10.6.20 netmask 255.255.255.0"
gateway_enable="YES"
openvpn_enable="YES"
pf_enable="YES"

我的云提供商通过 DHCP 为我提供了 ipv4/ipv6 公共地址。

我查看了 FreeBSD 文档和其他 ansible 剧本,并提出了这个基本的 pf.conf:

block all
set skip on lo0
set skip on tun0
pass out all keep state
tcp_services = "{ ssh }"
udp_services = "{ openvpn }"
pass in proto tcp to any port $tcp_services keep state
pass in proto udp to any port $udp_services keep state

但是,使用此配置,我阻止了所有 ssh 和 openvpn 访问,并且必须通过 VM Web 控制台登录到我的盒子。

我的目标是让这个盒子只允许来自公共接口的 openvpn (udp) 和 ssh,允许通过 vpn (tun0) 的所有流量和来自内部的所有流量。

firewall
  • 1 个回答
  • 5364 Views
Martin Hope
djsumdog
Asked: 2012-10-29 19:29:27 +0800 CST

BIND 不再响应 AXFR 请求

  • 2

最近我们移动了主要的外部 DNS 服务器。它前面有我们的 ISP 提供的三个缓存 DNS 从站。他们告诉我们,他们在进行区域传输 (AXFR) 时开始收到访问被拒绝的请求。如果我将自己的 IP 添加到允许传输列表中,则在将 dig 与 AXFR 参数一起使用时,我也会遇到传输失败的情况。这是我的绑定配置的样子:

options {
    directory "/var/lib/named";
    dump-file "/var/log/named_dump.db";
    zone-statistics yes;
    statistics-file "/var/log/named.stats";
    listen-on-v6 { any; };
    notify-source 10.19.0.68 port 53;

    querylog yes;
    notify yes;
    allow-transfer { 
        127.0.0.1;  //localhost
        1.1.1.1;    //public dns slave 1
        2.2.2.2;    //public dns slave 2
        3.3.3.3;    //public dns slave 3
    };
    also-notify {
            1.1.1.1;  //public dns slave 1
            2.2.2.2;  //public dns slave 2
            3.3.3.3;  //public dns slave 3
    };
    include "/etc/named.d/forwarders.conf";
};
logging {
    channel simple_log {
        file "/var/log/bind.log" versions 10 size 3m;
        severity info;
        print-time yes;
        print-severity yes;
        print-category yes;
  };
    category default{ simple_log; };
    channel log_zone_transfers {
            file "/var/log/axfr.log" versions 10 size 3m;
            print-time yes;
            print-category yes;
            print-severity yes;
            };
    category xfer-out { log_zone_transfers; };
    channel log_notify {
            file "/var/log/notify.log" versions 10 size 3m;
            print-time yes;
            print-category yes;
            print-severity yes;
            };
    category notify { log_notify; };
    channel queries {
            file "/var/log/queries.log" versions 10 size 30m;
            print-time yes;
        severity info;
            print-category yes;
            print-severity yes;
            };
    category queries { queries; };
  };
zone "." in {
    type hint;
    file "root.hint";
};
zone "localhost" in {
    type master;
    file "localhost.zone";
};
zone "0.0.127.in-addr.arpa" in {
    type master;
    file "127.0.0.zone";
};

include "/etc/named.conf.include";

zone "example.net " {
    type master;
    file "/var/lib/named/master/example.net.hosts";
    };
zone "example.com " {
    type master;
    file "/var/lib/named/master/example.com.hosts";
};

## -- other master files --

xfer 日志中的错误如下所示:

29-Oct-2012 14:20:02.806 xfer-out: info: client 1.1.1.1#59069: bad zone transfer request: 'example.com./IN': non-authoritative zone (NOTAUTH)

我试过直接在区域文件上添加允许传输参数,但传输仍然失败。知道我做错了什么吗?

domain-name-system
  • 1 个回答
  • 4145 Views
Martin Hope
djsumdog
Asked: 2012-10-07 12:20:55 +0800 CST

在 Active Directory 中使用 PowerShell,如何将具有给定 IP 的所有 DNS A 记录更改为新 IP?

  • 4

我们一直在移动数据中心,我有很多不正确的旧记录,但在 DNS 中作为 CNAME 记录,但是具有直接 IP(例如 192.168.100.n)的 A 记录,它们都在移动到新子网 (10.19.100.n)。

我只需要编写一个 powershell 脚本来更改所有这些记录。我找到了这个网站:

http://www.indented.co.uk/index.php/2008/12/30/administering-microsoft-dns-in-powershell/

从中我制作了这个简单的脚本:

$dnsServer = "meldc2"

$scope = New-Object Management.ManagementScope("\\$dnsServer\root\MicrosoftDNS")
$path = New-Object Management.ManagementPath("MicrosoftDNS_Zone")
$options = New-Object Management.ObjectGetOptions($Null,[System.TimeSpan]::MaxValue, $True)
$ZoneClass= New-Object Management.ManagementClass($scope,$path,$options)
$Zones = Get-WMIObject -Computer $dnsServer -Namespace "root\MicrosoftDNS" -Class "MicrosoftDNS_Zone"
$Zones | Get-Member
foreach($Z in $Zones) {
  $Z | Select-Object Name,DsIntegrated,ZoneType,Reverse,Data
}

但这只会让我得到一个根区域列表。我不明白如何遍历每个区域中的所有条目。此外,我看到的所有示例都涉及添加新区域,但我找不到任何关于修改现有 A 记录的示例。

domain-name-system
  • 1 个回答
  • 2320 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