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

Marc's questions

Martin Hope
Marc
Asked: 2023-11-18 18:47:50 +0800 CST

Apache 默认 Conf 主机绑定

  • 6

我在 Ubuntu 上安装了标准的 apache2,其中添加了 mysite1.com,其中包含以下内容:

 <VirtualHost mysite1.com:80>

自从添加此功能后,当我致电时,http://<external-ip>我不再获得在以下位置配置的默认 Apache 站点/etc/apache2/sites-enabled/000-default.conf:

 <VirtualHost *:80>

为什么要http://<external-ip>绑定到 mysite.com?

我希望所有未配置的Host:标头都达到默认值,并且<external-ip>在我看来,未配置。

更新:@Daniel Ferradal 提供的解决方案是在所有块中仅使用通配符<VirtualHost *:80>并使用ServerName指令进行主机名映射。

apache2
  • 1 个回答
  • 52 Views
Martin Hope
Marc
Asked: 2019-11-12 04:16:39 +0800 CST

无法停止 nginx 服务

  • 0

我们在 systemd 中运行了 nginx(在端口 8080 上),CentOS 7.7但无法停止它 - 没有错误,它只是继续运行或重生。

我们已经尝试过sudo systemctl stop,sudo systemctl disable甚至尝试过,kill但它一直在运行。

Nov 11 13:04:18 myhost systemd[1]: Started The Gateway - Nginx.
[myuser@myhost gateway]$ sudo systemctl stop gateway
[myuser@myhost gateway]$ sudo systemctl status gateway
gateway.service - The Gateway - Nginx
   Loaded: loaded (/usr/lib/systemd/system/gateway.service; enabled; vendor preset: disabled)
   Active: inactive (dead) since Mon 2019-11-11 13:04:18 CET; 6min ago
  Process: 20988 ExecStart=/usr/sbin/nginx -c /prg/nginx/conf/gateway.conf (code=exited, status=0/SUCCESS)
  Process: 20985 ExecStartPre=/usr/sbin/nginx -t -c /prg/nginx/conf/gateway.conf (code=exited, status=0/SUCCESS)
  Process: 20983 ExecStartPre=/usr/bin/rm -f /daten/nginx.pid (code=exited, status=0/SUCCESS)
 Main PID: 20988 (code=exited, status=0/SUCCESS)
    Tasks: 2
   Memory: 1.6M
   CGroup: /system.slice/gateway.service
           ├─20990 nginx: master process /usr/sbin/nginx -c /prg/nginx/conf/gateway.conf
           └─20991 nginx: worker process

Nov 11 13:04:18 myhost systemd[1]: Starting The Gateway - Nginx...
Nov 11 13:04:18 myhost node-gateway[20985]: nginx: the configuration file /prg/nginx/conf/gateway.conf syntax is ok
Nov 11 13:04:18 myhost node-gateway[20985]: nginx: configuration file /prg/nginx/conf/gateway.conf test is successful
Nov 11 13:04:18 myhost systemd[1]: Started The Gateway - Nginx.

禁用并停止

[myuser@myhost gateway]$ sudo systemctl disable gateway
Removed symlink /etc/systemd/system/multi-user.target.wants/gateway.service.
[myuser@myhost gateway]$ sudo systemctl stop gateway

仍在运行

[myuser@myhost gateway]$ sudo systemctl status gateway
gateway.service - The Gateway - Nginx
   Loaded: loaded (/usr/lib/systemd/system/gateway.service; disabled; vendor preset: disabled)
   Active: inactive (dead) since Mon 2019-11-11 13:04:18 CET; 6min ago
 Main PID: 20988 (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/gateway.service
           ├─20990 nginx: master process /usr/sbin/nginx -c /prg/nginx/conf/gateway.conf
           └─20991 nginx: worker process

Nov 11 13:04:18 myhost systemd[1]: Starting The Gateway - Nginx...
Nov 11 13:04:18 myhost node-gateway[20985]: nginx: the configuration file /prg/nginx/conf/gateway.conf syntax is ok
Nov 11 13:04:18 myhost node-gateway[20985]: nginx: configuration file /prg/nginx/conf/gateway.conf test is successful
Nov 11 13:04:18 myhost systemd[1]: Started The Gateway - Nginx.
[myuser@myhost gateway]$ ps -auxf | grep nginx
myuser    21846  0.0  0.0 112684   696 pts/0    S+   13:11   0:00  |           \_ grep --color=auto nginx
root      20990  0.0  0.0  59080  1388 ?        Ss   13:04   0:00 nginx: master process /usr/sbin/nginx -c /prg/nginx/conf/gateway.conf
nginx     20991  0.0  0.0  61272  2708 ?        S    13:04   0:00  \_ nginx: worker process
[myuser@myhost gateway]$ sudo lsof -i -P -n | grep 8080
node       1313              root   20u  IPv4 429747      0t0  TCP 127.0.0.1:51580->127.0.0.1:8080 (ESTABLISHED)
node       1313              root   21u  IPv4 432203      0t0  TCP 127.0.0.1:51640->127.0.0.1:8080 (ESTABLISHED)
node       1316 serviceuser   19u  IPv4 332198      0t0  TCP 172.25.24.45:57328->172.25.24.20:8080 (ESTABLISHED)
node       1316 serviceuser   21u  IPv4 318233      0t0  TCP 172.25.24.45:57260->172.25.24.20:8080 (ESTABLISHED)
nginx     20990              root    6u  IPv4 430360      0t0  TCP *:8080 (LISTEN)
nginx     20991             nginx    3u  IPv4 430473      0t0  TCP 127.0.0.1:8080->127.0.0.1:51580 (ESTABLISHED)
nginx     20991             nginx    6u  IPv4 430360      0t0  TCP *:8080 (LISTEN)
nginx     20991             nginx   25u  IPv4 432204      0t0  TCP 127.0.0.1:8080->127.0.0.1:51640 (ESTABLISHED)
nginx
  • 1 个回答
  • 1692 Views
Martin Hope
Marc
Asked: 2019-10-10 10:45:08 +0800 CST

URL 中带有 Cookie 值的代理传递

  • 1

我想代理将请求传递到请求中cookie的值在/foo/XXX/bar哪里。XXXmycookie

这在 Nginx 中是微不足道的,但我在 Apache HTTPD 中找不到方法:

Nginx 解决方案

location ~ ^/foo/bar {
    proxy_pass http://localhost/foo/$cookie_cust/bar$is_args$args;
    proxy_set_header X-Forwarded-For $remote_addr;
}

如何ProxyPass在 Apache 2.4 中使用特定的 cookie 值?

apache-2.4
  • 1 个回答
  • 571 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