标签: http

为什么在 ps -aux 中 httpd 以 root 身份运行而其余部分以 apache 身份运行?

当我执行 ps -aux 时,为什么我有一份 httpd 以 root 身份运行,其余的以 apache 身份运行?

ps -aux | grep httpd
Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2.8/FAQ
root      2820  0.0  1.1 126740 13372 ?        Ss   10:23   0:00 /usr/sbin/httpd
apache    2822  0.0  0.5 126804  6456 ?        S    10:23   0:00 /usr/sbin/httpd
apache    2823  0.0  0.5 126804  6456 ?        S    10:23   0:00 /usr/sbin/httpd
apache    2824  0.0  0.5 126804  6456 ?        S    10:23   0:00 /usr/sbin/httpd
apache    2825  0.0  0.5 126804  6460 ?        S    10:23   0:00 /usr/sbin/httpd
apache …
Run Code Online (Sandbox Code Playgroud)

http

2
推荐指数
1
解决办法
1702
查看次数

在 Ubuntu 中,有什么我可以运行的东西来检查传入的 HTTP 请求吗?

我正在运行 Node.js。但由于某种原因,请求没有被服务器捕获。(/sf/ask/647323771/

有没有办法检查是否有 HTTP 请求进来?理想情况下,我想运行一些可以“侦听” HTTP 请求的东西,然后在它们进来时打印它们,以及该 http 请求的 URl(如果可能)

linux unix ubuntu http tcp

2
推荐指数
1
解决办法
2081
查看次数

为什么 Wireshark 无法识别此 HTTP 响应?

我有一个简单的 CGI 脚本,可以输出简单的文本内容。它是用 Perl 编写的,使用CGI模块,它只指定了最基本的头文件:

print $q->header(
    -type               => 'text/plain',
    -Content_length     => $length,
);
print $stuff;
Run Code Online (Sandbox Code Playgroud)

功能没有明显问题——用户代理和服务器都没有抱怨,但我对 Wireshark 无法将 HTTP 响应识别为 HTTP 的事实感到困惑——它被标记为 TCP。

这里是请求和响应,如“Follow TCP Stream”对话框所示:

GET /cgi-bin/memfile/memfile.pl?mbytes=1 HTTP/1.1
Host: 10.0.0.1
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:11.0) Gecko/20100101 Firefox/11.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: cs,en-us;q=0.7,en;q=0.3
Accept-Encoding: gzip, deflate
Connection: keep-alive

HTTP/1.1 200 OK
Date: Thu, 05 Apr 2012 18:52:23 GMT
Server: Apache/2.2.15 (Win32) mod_ssl/2.2.15 OpenSSL/0.9.8m
Content-length: 1048616
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: text/plain; charset=ISO-8859-1

XXXXXXXX...
Run Code Online (Sandbox Code Playgroud)

这是数据包概述)

No. …
Run Code Online (Sandbox Code Playgroud)

http wireshark

2
推荐指数
1
解决办法
1万
查看次数

通过端口 443 连接到 HTTP URL

是否可以通过端口 443连接到 HTTP URL(例如,http://www.asdfg.com)?

还是只有 HTTPS URL(例如https://www.asdfg.com)可以通过端口 443 连接?

我有一个代理服务器配置为仅允许通过端口 443。当我尝试连接到 HTTP URL 时,我得到一个504 Gateway Timeout error.

如果我将 URL 中的“http”更改为“https”并尝试在没有代理的情况下进行连接,则会收到消息“未找到请求的资源”。

这种行为的原因是什么?

(这里有很多类似的问题,但我的问题很直接。)

http https port port-443

2
推荐指数
1
解决办法
4万
查看次数

通过 Haproxy 转发真实 IP => Nginx => Unicorn

如何将真实访客的 IP 地址转发给 Unicorn?目前的设置是:

Haproxy => Nginx => Unicorn
Run Code Online (Sandbox Code Playgroud)
  1. 如何将真实 IP 地址从 Haproxy 转发到 Nginx,再到 Unicorn?目前它总是只有 127.0.0.1
  2. 我读到 X 标头将被弃用。http://tools.ietf.org/html/rfc6648 - 这将如何影响我们?

Haproxy 配置:

# haproxy config
defaults
    log global
    mode    http
    option  httplog
    option  dontlognull
    option httpclose
    retries 3
    option redispatch
    maxconn 2000
    contimeout  5000
    clitimeout  50000
    srvtimeout  50000

# Rails Backend
backend deployer-production
    reqrep    ^([^\ ]*)\ /api/(.*)  \1\ /\2
    balance     roundrobin
    server      deployer-production localhost:9000 check
Run Code Online (Sandbox Code Playgroud)

Nginx 配置:

upstream unicorn-production {
  server unix:/tmp/unicorn.ordify-backend-production.sock fail_timeout=0;
}

server {
  listen …
Run Code Online (Sandbox Code Playgroud)

http nginx haproxy unicorn

2
推荐指数
1
解决办法
9717
查看次数

HTTP 客户端 -> [代理] -> HTTPS 服务器。可能的?

有可能有这样的东西吗?:

[客户端] ----HTTP--- > [魔术] ----HTTPS----> [服务器]

我有一个 Windows Phone 客户端,它应该连接到我无法控制的 HTTPS 服务器。问题是,测试服务器使用的是自签名证书,而 Windows Phone 不允许连接到证书未由受信任的根证书颁发机构签名的站点。

那么是否有可能让某个软件([Magic])充当客户端的 HTTP 端点,然后它会透明地将请求转发到 HTTPS 服务器?

我听说 ISA 服务器会这样做,但最好使用轻量级解决方案。

http proxy https

2
推荐指数
1
解决办法
351
查看次数

无法使用 Vagrant 从主机端口通过 HTTP 访问 monit 守护进程

我想使用 monit 来监控我的 Ubuntu VM(精确到 32)上的服务,但我无法从主机(本地)机器通过 HTTP 访问 monit 守护进程。

我在 /etc/monit/monitrc 中启用了以下设置:

set httpd port 2812 and
  use address localhost
  allow localhost
  allow vagrant:vagrant_pwd
Run Code Online (Sandbox Code Playgroud)

并将虚拟机中的端口 2812 转发到 Vagrantfile 中的主机,如下所示:

config.vm.forward_port 2812, 2812
Run Code Online (Sandbox Code Playgroud)

我已经通过 ssh 进入虚拟机并运行来确认 monit 正在虚拟机上运行:

sudo /etc/init.d/monit status
Run Code Online (Sandbox Code Playgroud)

并且可以通过运行在 VM 中使用 HTTP 访问 Monit 守护进程

curl -u vagrant:vagrant localhost:2812
Run Code Online (Sandbox Code Playgroud)

但是当我在主机浏览器(firefox)上输入 localhost:2812 时,我没有得到任何响应。

关于如何使这项工作的任何想法?

ubuntu http monit vagrant

2
推荐指数
1
解决办法
3543
查看次数

nginx 将 http 重定向到 https 不起作用

我正在尝试从 http 重新路由到 https。例如,您访问 example.com,您将被自动重定向到https://example.com

我尝试使用这个:

server {
      listen         80;
      return 301 https://$host$request_uri;
} 
Run Code Online (Sandbox Code Playgroud)

还有这个:

server {
      listen         80;
      server_name    example.com;
      return         301 https://$server_name$request_uri;
}
Run Code Online (Sandbox Code Playgroud)

如此处所示:在 Nginx 中,如何在维护子域的同时将所有 http 请求重写为 https?

但似乎两者都不适合我。我留在example.com。

有人有想法吗?

linux http nginx https redirect

2
推荐指数
1
解决办法
3万
查看次数

Nginx:我可以使用 IP + URI 的密钥设置 limit_req_zone 吗?

我正在尝试设置 Nginx limit_req 模块来限制任何 IP 对同一 URL 的请求速率。

我想定义一个limit_req_zone由客户端 IP 和请求 URI 组合而成的密钥。也就是说,代替这个:

limit_req_zone $binary_remote_addr zone=req_dev:10m rate=2r/s;

像这样的东西:

set $ip_url "$binary_remote_addr$request_uri"
limit_req_zone $ip_url zone=req_dev:10m rate=2r/s;
Run Code Online (Sandbox Code Playgroud)

但这不起作用,因为set无法在上下文中调用http

nginx: [emerg] "set" directive is not allowed here in /etc/nginx/nginx.conf:47
Run Code Online (Sandbox Code Playgroud)

有什么办法可以实现这一点吗?

需要明确的是:我不想限制特定 URL 的速率。我想避免一个 IP 每秒访问同一 URL 两次以上。

http nginx rate-limiting

2
推荐指数
1
解决办法
6090
查看次数

nginx 无法正确响应 HTTP/1.1

我遇到了一个问题,即某些首先尝试通过 HTTP/1.1 连接的客户端没有正确转发到 HTTPS

curl -v http://indentationerror.com/
*   Trying 217.45.175.173:80...
* Connected to indentationerror.com (217.45.175.173) port 80 (#0)
> GET / HTTP/1.1
> Host: indentationerror.com
> User-Agent: curl/7.73.0
> Accept: */*
> 
* Received HTTP/0.9 when not allowed

* Closing connection 0
curl: (1) Received HTTP/0.9 when not allowed
Run Code Online (Sandbox Code Playgroud)

但是,使用以下命令:

curl -v http://indentationerror.com/ --http2-prior-knowledge
Run Code Online (Sandbox Code Playgroud)

nginx 按预期通过 HTTP/2 返回 301 重定向

我的配置目前是:

server {
        server_name www.indentationerror.com;
        listen 443 ssl http2;
        listen [::]:443 ssl http2;
        ssl    on;
        root "/http/indentationerror.com/www";
        include /etc/nginx/genericHandlers/indentationerror.com;
} …
Run Code Online (Sandbox Code Playgroud)

http nginx https curl

2
推荐指数
1
解决办法
1176
查看次数

标签 统计

http ×10

https ×4

nginx ×4

linux ×2

ubuntu ×2

curl ×1

haproxy ×1

monit ×1

port ×1

port-443 ×1

proxy ×1

rate-limiting ×1

redirect ×1

tcp ×1

unicorn ×1

unix ×1

vagrant ×1

wireshark ×1