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

ub3rst4r's questions

Martin Hope
ub3rst4r
Asked: 2014-10-19 20:48:28 +0800 CST

如何以类似于 Apache 的方式拒绝访问 OpenLiteSpeed 中的文件夹?

  • 1

我试图拒绝访问使用OpenLiteSpeed v1.4.2托管的网站的文件夹,但我遇到了麻烦。我认为.htaccessOpenLiteSpeed 不支持它,因此我无法将其中的文件放入.htaccess文件Deny From All夹中。

假设我要隐藏的文件夹的绝对路径是/usr/local/lsws/Example/html/hideme. 我尝试将以下内容放入 OpenLiteSpeed 面板中虚拟主机的重写规则中,但没有运气:

<Directory ~/hideme>
  Deny from all
</Directory>

<Directory ~/hideme/(.*)$>
  Deny from all
</Directory>

<Directory /usr/local/lsws/Example/html/hideme>
  Deny from all
</Directory>

有谁知道我可能做错了什么以及如何拒绝访问此文件夹?

mod-rewrite
  • 1 个回答
  • 1464 Views
Martin Hope
ub3rst4r
Asked: 2014-05-16 10:35:12 +0800 CST

BIND Slave 收到来自其他 Slave 的通知?

  • 2

我也有一个主名称服务器设置和一些从属服务器。今天,当我遇到一条奇怪的错误消息时,我正在将其中一个从属服务器更改为新服务器。
在更新主服务器上的 DNS 记录并重新启动 BIND 后,我注意到它ns3.mydomain.com正在尝试发送ns4.mydomain.com通知。ns4.mydomain.com我已经检查了配置文件,但配置文件中没有它的 IP 地址ns3.mydomain.com。
它不应该ns1.mydomain.com将通知发送到ns4而不是ns3吗?我还应该注意到,两者的 DNS 记录ns3似乎ns4都已更新。

这是 ns3 上的错误消息(IP 地址:)107.161.xxx.xxx:

May 15 22:08:22 vps named[23851]: client 185.38.xxx.xxx#59396: received notify for zone 'mydomain1.com'
May 15 22:08:22 vps named[23851]: zone mydomain1.com/IN: refused notify from non-master: 185.38.xxx.xxx#59396
May 15 22:08:22 vps named[23851]: client 185.38.xxx.xxx#59396: received notify for zone 'mydomain2.com'
May 15 22:08:22 vps named[23851]: zone mydomain2.com/IN: refused notify from non-master: 185.38.xxx.xxx#59396
May 15 22:08:22 vps named[23851]: client 185.38.xxx.xxx#59396: received notify for zone 'mydomain3.com'
May 15 22:08:22 vps named[23851]: zone mydomain3.com/IN: refused notify from non-master: 185.38.xxx.xxx#59396
May 15 22:08:23 vps named[23851]: client 185.38.xxx.xxx#59396: received notify for zone 'mydomain4.com'
May 15 22:08:23 vps named[23851]: zone mydomain4.com/IN: refused notify from non-master: 185.38.xxx.xxx#59396

这是 ns4 上的错误消息(IP 地址:)185.38.xxx.xxx:

May 15 22:08:22 uk named[572]: client 107.161.xxx.xxx#48742: received notify for zone 'mydomain1.com'
May 15 22:08:22 uk named[572]: zone mydomain1.com/IN: refused notify from non-master: 107.161.xxx.xxx#48742
May 15 22:08:22 uk named[572]: client 107.161.xxx.xxx#48742: received notify for zone 'mydomain2.com'
May 15 22:08:22 uk named[572]: zone mydomain2.com/IN: refused notify from non-master: 107.161.xxx.xxx#48742
May 15 22:08:22 uk named[572]: client 107.161.xxx.xxx#48742: received notify for zone 'mydomain3.com'
May 15 22:08:22 uk named[572]: zone mydomain3.com/IN: refused notify from non-master: 107.161.xxx.xxx#48742
May 15 22:08:22 uk named[572]: client 107.161.xxx.xxx#48742: received notify for zone 'mydomain4.com'
May 15 22:08:22 uk named[572]: zone mydomain4.com/IN: refused notify from non-master: 107.161.xxx.xxx#48742
domain-name-system
  • 3 个回答
  • 7356 Views
Martin Hope
ub3rst4r
Asked: 2014-05-15 09:42:44 +0800 CST

在与 IP 地址不同的子网上设置网关

  • 3

我的提供商有一个(愚蠢的)设置,其中网关的 IP 地址位于与分配的 IP 地址完全不同的 IP 范围内。无论出于何种原因,他们都坚持这样做。我正在尝试使用静态路由配置 Windows Server 2012 R2,但没有运气。我能够使用 /etc/rc.conf 中的以下配置在 FreeBSD 上配置网络:

ifconfig_vtnet0="inet 142.4.196.xxx netmask 0xffffffff"
static_routes="net1 net2"
route_net1="-net 192.99.16.254/32 -iface vtnet0"
route_net2="default 192.99.16.254"

无论如何要转换它,以便它可以在 Windows Server 2012 R2 上运行?我试过做route ADD 0.0.0.0 MASK 0.0.0.0 192.99.16.254,但没有运气。

这是我的IP地址信息:

IP Address: 142.4.196.xxx
(Required) subnet mask: 255.255.255.255
Gateway: 192.99.16.254
networking
  • 3 个回答
  • 9108 Views
Martin Hope
ub3rst4r
Asked: 2014-04-22 17:17:32 +0800 CST

GeoDNS 设置中的 CNAME 问题

  • 0

我正在尝试设置类似于 CDN(内容交付网络)设置的东西。我想要做的是使用根据用户的地理位置返回 A 记录的 DNS 记录。我能够使用 RAGE4 DNS 进行设置。我不能真正将域(我们称之为 domaina.com)移动到 RAGE4,我只能更改子域。所以,我所做的是注册一个新域名(我们称之为 domainb.com),并在 RAGE4 DNS 上使用基于地理的 A 记录进行设置,并将子域(在 domaina.com 上)更改为指向的 CNAME RAGE4 DNS。这会导致通过访问子域(在 domainb.com 上)返回的 A 记录仅返回相同的 IP 地址,因为它使用 domaina.com 的名称服务器的位置(而不是执行查询的原始用户)。

也许这是一个更好的解释:

  • 用户从 ns1.domaina.com 请求 xyz.domaina.com 的 DNS 记录
  • xyz.domaina.com 是指向 xyz.domainb.com 的 CNAME 记录
  • xyz.domainb.com 根据用户的地理位置返回一条A记录(本例为ns1.domaina.com的地理位置)

有没有办法让它使用原始用户位置而不是名称服务器位置?

domain-name-system
  • 1 个回答
  • 666 Views
Martin Hope
ub3rst4r
Asked: 2014-02-01 09:23:20 +0800 CST

NginX 导致 PHP 文件被执行两次

  • 1

我处于困境和艰难的境地之间,试图弄清楚为什么会这样。出于某种原因,当我打开我的网站时,正在执行 index.php 文件。file_put_contents('runs.txt', 'executed'.PHP_EOL, FILE_APPEND);通过添加到 index.php 的顶部并使用网站和命令行执行它,我已经能够将其缩小到 NginX/PHP-FPM 。如果我从命令行执行它,它只输出一个executed,而如果我从网站(通过 NginX)执行它,它输出两个executed. 该脚本也不会重定向到自身,因为它只是返回 200 响应代码。除了必须通过执行两次脚本来使用更多内存之外,它还会通过第二次生成 CSRF 来破坏 CSRF 保护,因此 CSRF 是无用的。

下面是我的 nginx 配置文件:

nginx.conf

user  nginx;
worker_processes  2;

error_log  /var/log/nginx/error.log warn;
pid        /var/run/nginx.pid;


events {
    worker_connections  1024;
}


http {
    include       /etc/nginx/mime.types;
    default_type  application/octet-stream;

    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    access_log  /var/log/nginx/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    keepalive_timeout  65;

    # Upstream to abstract backend connection(s) for PHP.
    upstream php {
        #this should match value of "listen" directive in php-fpm pool
        server unix:/var/lib/php-fpm.sock;
    }

    #gzip  on;

    include /etc/nginx/conf.d/*.conf;
}

配置文件

# Pass all .php files onto a php-fpm/php-fcgi server.
location ~ \.php$ {
        #NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini

        include fastcgi_params;

        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_read_timeout 600s;
#       fastcgi_intercept_errors on;
        fastcgi_pass php;
}

网站.conf

server {
    listen       80;
    server_name  xyz.com www.xyz.com;
    root         /usr/share/nginx/xyz.com;
    #access_log  /usr/share/nginx/logs/xyz.com-access_log;
    error_log    /usr/share/nginx/logs/xyz.com-error_log;

    index index.php;

    location / {
       index index.php;

       try_files $uri $uri/ /index.php?q=$uri&$args;
    }

    include php.conf;
}

fastcgi_params

fastcgi_param  QUERY_STRING       $query_string;
fastcgi_param  REQUEST_METHOD     $request_method;
fastcgi_param  CONTENT_TYPE       $content_type;
fastcgi_param  CONTENT_LENGTH     $content_length;

fastcgi_param  SCRIPT_NAME        $fastcgi_script_name;
fastcgi_param  REQUEST_URI        $request_uri;
fastcgi_param  DOCUMENT_URI       $document_uri;
fastcgi_param  DOCUMENT_ROOT      $document_root;
fastcgi_param  SERVER_PROTOCOL    $server_protocol;
fastcgi_param  HTTPS              $https if_not_empty;

fastcgi_param  GATEWAY_INTERFACE  CGI/1.1;
fastcgi_param  SERVER_SOFTWARE    nginx/$nginx_version;

fastcgi_param  REMOTE_ADDR        $remote_addr;
fastcgi_param  REMOTE_PORT        $remote_port;
fastcgi_param  SERVER_ADDR        $server_addr;
fastcgi_param  SERVER_PORT        $server_port;
fastcgi_param  SERVER_NAME        $server_name;

# PHP only, required if PHP was built with --enable-force-cgi-redirect
fastcgi_param  REDIRECT_STATUS    200;

如果我更改try_files $uri $uri/ /index.php?q=$uri&$args;为try_files $uri $uri/;并调出,http://www.xyz.com/index.php那么它只会执行一次,但我需要/index.php?q=$uri&$args在那里。我正在使用 nginx 1.4.4 和 PHP 5.4.23 运行 CentOS 6.5。有任何想法吗?

php
  • 1 个回答
  • 2367 Views
Martin Hope
ub3rst4r
Asked: 2012-09-25 23:02:47 +0800 CST

连接到 FMS 服务器问题

  • 0

我试图让我的计算机连接到 Adob​​e Connect 服务器,但我没有成功。Adobe 告诉我的错误是“错误:FMS 服务器未正确返回!” 并做了一些缩小范围以找出问题所在......

  • 我知道这不是路由器问题,因为当我绕过它时它仍然无法工作,而且 Adob​​e Connect 在我网络中的所有其他计算机上工作正常
  • 我已经禁用了 Windows 防火墙(无论哪种方式)并且没有做任何事情
  • 这与尝试连接到服务器上的端口 1935 有关,因为我可以正常连接到端口 80 但不能连接到端口 1935
  • 我安装了 VirtualBox 和 Virtual PC 网络驱动程序,但我禁用了它们但没有成功
  • 我使用了 TCP 优化器并尝试恢复设置但没有成功
  • 在 netstat 中与端口 1935 的连接最远是 SYN_SENT,因此由于某种原因服务器没有发回 ACK
  • 它在 Firefox、Chrome 或 Internet Explorer 中不起作用(是的,我确保启用了 SSL 和 TLS)

我想知道这是否可能是某种防火墙问题,但事实是,我完全禁用了 Windows 防火墙,并且没有其他防火墙(据我所知)在运行。我认为这可能是因为我安装了 Norton 360,但这不是问题所在。有任何想法吗?

更新:

这是来自CAN连接的计算机的 traceroute 和 nmap 扫描:

Tracing route to connect.bowvalleycollege.ca [199.185.132.114] 
over a maximum of 30 hops:

  1     1 ms     1 ms    <1 ms  192.168.1.1
  2    36 ms    36 ms    37 ms  d198-53-240-1.abhsia.telus.net [198.53.240.1]
  3    44 ms    39 ms    38 ms  173.182.202.193
  4    36 ms    36 ms    36 ms  CLGRAB31GR01.bb.telus.com [154.11.10.170]
  5    37 ms    35 ms    37 ms  154.11.2.218
  6    49 ms    48 ms    48 ms  core4-calgaryqa_gi6-0-0.net.bell.ca [64.230.77.252]
  7    50 ms    50 ms    58 ms  core4-calgary68_ge5-1-0.net.bell.ca [64.230.77.222]
  8    48 ms    50 ms    48 ms  core4-vancouver_pos11-1-0.net.bell.ca [64.230.77.207]
  9    48 ms    49 ms    48 ms  core1-vancouver_pos0-2-0.net.bell.ca [64.230.183.33]
 10    49 ms    86 ms    48 ms  bx2-vancouver_POS1-0.net.bell.ca [64.230.248.58]

 11    99 ms    49 ms    48 ms  204.101.4.90
 12    53 ms    51 ms    52 ms  static-67-226-180-101.ptr.terago.net [67.226.180.101]
 13    52 ms    53 ms    53 ms  static-67-226-180-142.ptr.terago.net [67.226.180.142]
 14     *        *        *     Request timed out.
 15    53 ms    51 ms    51 ms  reddog.bowvalleycollege.ca [199.185.132.4]
 16    53 ms    53 ms    53 ms  vpn.bowvalleycollege.ca [199.185.132.9]
 17     *        *        *     Request timed out.
 18     *        *        *     Request timed out.
 19     *        *        *     Request timed out.
 20     *        *        *     Request timed out.
 21     *        *        *     Request timed out.
 22     *        *        *     Request timed out.
 23     *        *        *     Request timed out.
 24     *        *        *     Request timed out.
 25     *        *        *     Request timed out.
 26     *        *        *     Request timed out.
 27     *        *        *     Request timed out.
 28     *        *        *     Request timed out.
 29     *        *        *     Request timed out.
 30     *        *        *     Request timed out.

Trace complete.

Starting Nmap 6.01 ( http://nmap.org ) at 2012-09-29 12:14 Mountain Daylight Time
Nmap scan report for connect.bowvalleycollege.ca (199.185.132.114)
Host is up (0.057s latency).
Not shown: 995 filtered ports
PORT     STATE  SERVICE
80/tcp   open   http
113/tcp  closed ident
443/tcp  closed https
1433/tcp open   ms-sql-s
1935/tcp open   rtmp

Nmap done: 1 IP address (1 host up) scanned in 13.23 seconds

这是来自无法连接的计算机的traceroute和 nmap 扫描:

Tracing route to connect.bowvalleycollege.ca [199.185.132.114]
over a maximum of 30 hops:

  1    <1 ms    <1 ms    <1 ms  192.168.1.1
  2    38 ms    35 ms    36 ms  d198-53-240-1.abhsia.telus.net [198.53.240.1]
  3    42 ms    37 ms    37 ms  173.182.202.193
  4    37 ms    37 ms    37 ms  CLGRAB31GR01.bb.telus.com [154.11.10.170]
  5    37 ms    37 ms    37 ms  154.11.2.218
  6    48 ms    48 ms    48 ms  core4-calgaryqa_gi6-0-0.net.bell.ca [64.230.77.252]
  7    48 ms    47 ms    48 ms  core4-calgary68_ge5-1-0.net.bell.ca [64.230.77.222]
  8    49 ms    48 ms    48 ms  core4-vancouver_pos11-1-0.net.bell.ca [64.230.77.207]
  9    48 ms    48 ms    48 ms  core1-vancouver_pos0-2-0.net.bell.ca [64.230.183.33]
 10    47 ms    48 ms    47 ms  bx2-vancouver_POS1-0.net.bell.ca [64.230.248.58]

 11    47 ms    48 ms    46 ms  204.101.4.90
 12    51 ms    52 ms    52 ms  static-67-226-180-101.ptr.terago.net [67.226.180.101]
 13    51 ms    52 ms    52 ms  static-67-226-180-142.ptr.terago.net [67.226.180.142]
 14     *        *        *     Request timed out.
 15    50 ms    49 ms    50 ms  reddog.bowvalleycollege.ca [199.185.132.4]
 16    52 ms    52 ms    52 ms  vpn.bowvalleycollege.ca [199.185.132.9]
 17     *        *        *     Request timed out.
 18     *        *        *     Request timed out.
 19     *        *        *     Request timed out.
 20     *        *        *     Request timed out.
 21     *        *        *     Request timed out.
 22     *        *        *     Request timed out.
 23     *        *        *     Request timed out.
 24     *        *        *     Request timed out.
 25     *        *        *     Request timed out.
 26     *        *        *     Request timed out.
 27     *        *        *     Request timed out.
 28     *        *        *     Request timed out.
 29     *        *        *     Request timed out.
 30     *        *        *     Request timed out.

Trace complete.

Starting Nmap 6.01 ( http://nmap.org ) at 2012-09-29 12:27 Mountain Daylight Time
Nmap scan report for connect.bowvalleycollege.ca (199.185.132.114)
Host is up (0.054s latency).
Not shown: 995 filtered ports
PORT     STATE  SERVICE
80/tcp   open   http
113/tcp  closed ident
443/tcp  closed https
1433/tcp open   ms-sql-s
1935/tcp open   rtmp

Nmap done: 1 IP address (1 host up) scanned in 18.50 seconds

我想通过比较这些扫描,您会发现它们是相同的。我无法控制,connect.bowvalleycollege.ca所以无论问题是什么,我都应该能够解决。

windows
  • 1 个回答
  • 2856 Views
Martin Hope
ub3rst4r
Asked: 2012-05-27 22:20:49 +0800 CST

将 CloudFlare 与镜像站点一起使用

  • 1

我正在开发一个镜像网站(人们可以在其中下载文件,有点像 FTP)。我想知道如何使用 CloudFlare 来帮助减少带宽使用。我有一个带有 mod_rewrite 的镜像网站,所以当用户访问http://www.example.com/xyz/file.zip时,它会被重定向到http://www.example.com/download.php?path= xyz&file=file.zip增加下载次数并输出“file.zip”。这是重写规则:

RewriteRule ^(.*)/((.*)(.zip))$ /download.php?path=$1&file=$2

我想知道如果我在这个网站上使用 CloudFlare,它是否会导致 .htaccess 文件无用和 PHP 代码无用?

cache mirroring mod-rewrite cloudflare
  • 1 个回答
  • 1089 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