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

问题[restrictions](server)

Martin Hope
klor
Asked: 2020-10-15 08:32:59 +0800 CST

仅允许来自主机服务器的反向代理访问

  • 0

我有两台服务器 A)前端服务器(IP 11.22.33.44),B)后端服务器(IP 22.33.44.55)。两者都使用 Debian Linux 和 Apache 服务器。

A) 前端服务器使用反向代理来显示 B) 后端服务器的内容。我想将后端服务器的 Apache 访问限制为 ip 11.22.33.44(应该只能从 A)前端服务器访问)。后端服务器侦听启用 SSL 的端口 1111 和 2222(为两个不同的反向代理站点提供服务)。

我在后端服务器上试过:

<Proxy "*">
    Require ip 11.22.33.44
</Proxy>

和

<Proxy "*">
    order deny,allow
    Deny from from all
    Allow from 11.22.33.44
</Proxy>

但我没有成功。我仍然可以通过 URL https://22.33.44.55:1111的网络浏览器访问。

将后端服务器的访问限制为前端服务器的 IP 地址的任何其他想法?

debian reverse-proxy apache-2.4 restrictions backend
  • 1 个回答
  • 226 Views
Martin Hope
Katy
Asked: 2020-10-03 11:30:26 +0800 CST

Apache mod_rewrite 如何通过 IP 限制工作

  • 1

我想在几周内只接受某些 IP。

只有接受的 IP 可以加载这个 ->www.example.com/login而不是其他的。

使用 Apache 2.2。mod_rewrite 中的代码如下:

RewriteMap hosts-allow txt:/conf/hosts-allow
RewriteCond "${hosts-allow:%{HTTP:X-REAL-IP}|NOT-FOUND}" "=NOT-FOUND"
RewriteRule ^/login/.* - [R]

我添加了我的 IP 进行测试。

带有我的 IP 的“hosts-allow”文件如下

xxx.xxx.xxx

另一个尝试如下:

RewriteCond %{REMOTE_ADDR} ^xxx\.xxx\.xxx\.xxx
RewriteCond %{HTTP_HOST} ^(m|www)\.example.com/login$ [NC]
RewriteRule ^/login(.*) [PT,L]

这些例子都不起作用。


有关更多信息,在尝试上述示例之前,我的 mod_rewrite 上的所有连接都重定向到登录页面。example.conf我尝试在其他被调用的方法中使用如下httpd.conf

<Location "/login" >
    Order Deny,Allow
    Deny from all
    Allow from xxx.xxx.xxx.xxx
</Location >

我认为 on 的指令example.conf被 mod_rewrite 覆盖

mod_rewrite 是否在所有其他 conf 文件的最后激活?

apache-2.2 mod-rewrite restrictions
  • 1 个回答
  • 691 Views
Martin Hope
Sebastien Damaye
Asked: 2020-02-26 11:19:42 +0800 CST

Bind9 中的 ACL 条件区域

  • 0

我正在尝试仅为孩子应用“restrictmoderate.youtube.com”,并让其他人使用 Bind9 访问标准的“youtube.com”。

# cat named.conf
include "/etc/bind/named.conf.options";
include "/etc/bind/named.conf.local";
include "/etc/bind/named.conf.default-zones";
==========================================================================
# cat named.conf.options 
acl goodclients {
    192.168.0.0/16;
    localhost;
    localnets;
};
acl kids   { 192.168.2.0/24; };
acl adults { 192.168.1.0/24; };

options {
    directory "/var/cache/bind";

    recursion yes;
    allow-query { goodclients; };

    // forward traffic to opendns
    forwarders { 208.67.222.222; 208.67.220.220; };

    forward only;

    dnssec-enable yes;
    dnssec-validation yes;

    // Conform to RFC1035
    auth-nxdomain no;

    // Force youtube.com to restrictmoderate.youtube.com
    response-policy { zone "rpz"; };

    listen-on-v6 { none; };
    querylog yes;
};
==========================================================================
# cat named.conf.local 
//include "/etc/bind/zones.rfc1918";
logging{
    channel simple_log {
        file "/var/log/bind/query.log" versions 3;
        severity info;
        print-time yes;
        print-severity yes;
        print-category yes;
    };
    category default{
        simple_log;
    };
};

zone "rpz" IN {
    type master;
    file "/etc/bind/rpdb.zone";
    allow-query { kids; !adults; };
};
==========================================================================
# cat rpdb.zone 
$ORIGIN rpz.
$TTL 1H
@       IN       SOA       localhost. root.localhost. (
                           7
                           1H
                           15m
                           30d
                           2h )
                           NS LOCALHOST.

www.youtube.com           IN CNAME restrictmoderate.youtube.com.
m.youtube.com             IN CNAME restrictmoderate.youtube.com.
youtubei.googleapis.com   IN CNAME restrictmoderate.youtube.com.
youtube.googleapis.com    IN CNAME restrictmoderate.youtube.com.
www.youtube-nocookie.com  IN CNAME restrictmoderate.youtube.com.
google.com                IN CNAME forcesafesearch.google.com.
www.google.com            IN CNAME forcesafesearch.google.com.

我不明白为什么“rpz”区域适用于所有人(192.168.1.0/24 和 192.168.2.0/24),而我希望它只适用于“儿童”ACL(192.168.2.0/24) :

allow-query { kids; !adults; };

我究竟做错了什么?谢谢你的帮助。

bind access-control-list dns-zone restrictions named-conf
  • 1 个回答
  • 3189 Views
Martin Hope
akay
Asked: 2016-11-30 07:45:52 +0800 CST

重写/限制apache中的特定域名

  • 4

我们拥有https://example1.com/login并example2.com/login托管在同一个 apache 服务器 (2.2.22) 上。我想/login限制example1.com.

  • example1.com/login--> 404(最好)或 403

  • example2.com/login--> 登录页面

我试过了

<Location /login>
Order Deny,Allow
Deny from example1.com
Allow from example2.com
</Location>

/login它同时禁用example1.com和example2.com。我可以限制example1.com吗?

apache-2.2 rewrite mod-rewrite restrictions rewritecond
  • 1 个回答
  • 2822 Views
Martin Hope
Trevi Awater
Asked: 2016-05-19 00:04:57 +0800 CST

文件服务器资源管理器只允许文件名中的标准字母和数字

  • 0

我有一个 FTP 服务器 (IIS),它只允许上传某些文件类型(例如只有图像)。我通过文件服务器资源管理器中的文件筛选功能实现了这一点。

到目前为止,这工作正常,但是现在我只需要在文件名中允许标准字母和数字。

例子:

test.jpg   [valid]
Test 1.png [valid]
tëßt.png   [invalid]

文件筛选功能在此处不起作用。

  1. 我不想允许的字符太多(所以包含文件不是选项)。
  2. 我无法将我允许的每个字符都添加到排除文件中,因为此后扩展名检查不再起作用(只要文件名有效或扩展名匹配,它就会有效)。

还有另一种方法可以实现这一目标吗?

ftp windows-server-2012-r2 restrictions iis-8.5
  • 1 个回答
  • 168 Views
Martin Hope
jayarjo
Asked: 2010-02-24 10:28:34 +0800 CST

在 Apache 上使用 PHP 强制下载文件时,文件大小是否有限制?...

  • 0

尝试使用 PHP 强制下载文件:

header("Content-type: $type" );
header("Content-Disposition: attachment; filename=$name");
header('Content-Length: ' . filesize($path));

它确实适用于低于 32 mb 的文件。对于较大的文件,它只返回归零文件。

显然存在某种限制,但它是由什么设定的呢?使用 Apache 2.2.11 和 PHP 5.3.0。

我在stackoverflow上问了这个问题,但他们说它更适合这里。我个人不确定,因为我不知道首先是什么原因造成的。也许是阿帕奇?

php apache-2.2 limitations restrictions
  • 1 个回答
  • 3964 Views
Martin Hope
viraptor
Asked: 2009-07-04 02:50:13 +0800 CST

将端口限制为单个应用程序

  • 4

我想将一系列 udp 端口​​限制为单个应用程序(或用户)。我想要实现的不仅仅是阻止bind()其他 uid 的 a,而且还从可以自动分配的池中删除范围。

例如,如果有人尝试显式绑定 12345,但没有运行指定的应用程序,他们应该获得 EPERM。如果有人试图绑定一个未指定的端口,他们不应该尝试随机绑定 12345。

有什么系统可以在这里提供帮助吗?我尝试浏览 apparmor / selinux 文档,但它们似乎只做阻塞部分。

linux port restrictions
  • 3 个回答
  • 4798 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