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

Leos Literak's questions

Martin Hope
Leos Literak
Asked: 2020-05-07 01:34:05 +0800 CST

CN==URL 的自签名证书 ERR_CERT_COMMON_NAME_INVALID

  • 5

我已经生成了带有别名服务器和 IP 地址的主题备用名称的自签名证书。我已将证书导入 Windows 受信任的证书颁发机构。Chrome 接受来自 SAN 的 URL 证书,但拒绝主题中所述的 URL。

OpenSSL:

openssl req -x509 -newkey rsa:4096 -sha256 -days 999 -nodes \
-keyout nginx.key -out nginx.crt  -subj '/CN=www.X.eu' \
-extensions san  \
-config <(echo '[req]'; echo 'distinguished_name=req'; echo '[san]'; echo 'subjectAltName=DNS:X.eu,DNS:re1.X.eu,DNS:10.105.1.11')

证书:

Subject: CN = www.X.eu
Subject Alternative Name:
 DNS Name=sandbox.X.eu 
 DNS Name=re1.X.eu 
 DNS Name=10.105.1.11

此 URL 失败并显示“此站点缺少有效的受信任证书 (net::ERR_CERT_COMMON_NAME_INVALID)”。

https://www.X.eu/favicon.ico

Chrome 接受此网址:

https://re1.X.eu/favicon.ico

问题出在哪里?

google-chrome certificate
  • 1 个回答
  • 542 Views
Martin Hope
Leos Literak
Asked: 2020-05-06 23:31:58 +0800 CST

Nginx 创建由 root 而不是指定用户拥有的日志文件

  • 7

我正在运行 CentOS 7.7,我想在具有自定义 www 和日志位置的自定义用户下运行 Nginx。我已经点击了 SELinux,所以我启用了我的自定义目录:

semanage permissive -a httpd_t # temporarily make SELinux permissive
semanage fcontext -a -t httpd_sys_content_t  '/opt/x/data/nginx(/.*)?'
restorecon -R -v /opt/x/data/nginx
semanage fcontext -a -t  httpd_log_t '/opt/x/log/nginx(/.*)?'
restorecon -R -v /opt/x/log/nginx

这是我的 nginx.conf:

user Xnginx Xgrp;
worker_processes auto;
error_log /opt/x/log/nginx/error.log;
pid /run/nginx.pid;

和目录权限:

ls -lZ /opt/X/log/
drwxrwxr-x. Xnginx Xgrp unconfined_u:object_r:httpd_log_t:s0 nginx

我开始 Nginx

systemctl start nginx

它给了

[root@RE1 nginx]# systemctl status nginx
nginx.service - The nginx HTTP and reverse proxy server
  Loaded: loaded (/usr/lib/systemd/system/nginx.service; disabled; vendor preset: disabled)
  Active: active (running) since Wed 2020-05-06 09:15:06 CEST; 12min ago
  Process: 109185 ExecStart=/usr/sbin/nginx (code=exited, status=0/SUCCESS)
  Process: 109182 ExecStartPre=/usr/sbin/nginx -t (code=exited, status=0/SUCCESS)
  Process: 109180 ExecStartPre=/usr/bin/rm -f /run/nginx.pid (code=exited, status=0/SUCCESS)
  Main PID: 109187 (nginx)
   CGroup: /system.slice/nginx.service
       ├─109187 nginx: master process /usr/sbin/nginx
       ├─109188 nginx: worker process
       ├─109189 nginx: worker process
       ├─109190 nginx: worker process
       └─109191 nginx: worker process

May 06 09:15:06 RE1 systemd[1]: Starting The nginx HTTP and reverse proxy server...
May 06 09:15:06 RE1 nginx[109182]: nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
May 06 09:15:06 RE1 nginx[109182]: nginx: configuration file /etc/nginx/nginx.conf test is successful
May 06 09:15:06 RE1 systemd[1]: Started The nginx HTTP and reverse proxy server.

我可以看到子进程在用户下运行,而主进程以 root 身份运行

1     0 109187      1  20   0 131148  2268 sigsus Ss   ?          0:00 nginx: master process /usr/sbin/nginx
5   603 109188 109187  20   0 133632  3544 ep_pol S    ?          0:00  \_ nginx: worker process
5   603 109189 109187  20   0 133632  3544 ep_pol S    ?          0:00  \_ nginx: worker process
5   603 109190 109187  20   0 133632  3544 ep_pol S    ?          0:00  \_ nginx: worker process
5   603 109191 109187  20   0 133632  3544 ep_pol S    ?          0:00  \_ nginx: worker process

最后是问题:

ls -lZ /opt/X/log/nginx/
-rw-r--r--. root root system_u:object_r:httpd_log_t:s0 access.log
-rw-r--r--. root root system_u:object_r:httpd_log_t:s0 error.log

这些文件应该归 Xnginx 所有,而不是 root。为什么?

nginx centos-7
  • 1 个回答
  • 2092 Views
Martin Hope
Leos Literak
Asked: 2019-06-16 03:13:01 +0800 CST

wifi 扩展器在信号差的情况下是否工作?

  • 6

我读过一些关于wifi 扩展器的文章。我不明白在信号已经很差(-70 dBm)的地方是否有意义。wifi扩展器的接收器是否比笔记本更灵敏?

wireless-networking wireless-extender
  • 1 个回答
  • 103 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何减少“vmmem”进程的消耗?

    • 11 个回答
  • Marko Smith

    从 Microsoft Stream 下载视频

    • 4 个回答
  • Marko Smith

    Google Chrome DevTools 无法解析 SourceMap:chrome-extension

    • 6 个回答
  • Marko Smith

    Windows 照片查看器因为内存不足而无法运行?

    • 5 个回答
  • Marko Smith

    支持结束后如何激活 WindowsXP?

    • 6 个回答
  • Marko Smith

    远程桌面间歇性冻结

    • 7 个回答
  • Marko Smith

    子网掩码 /32 是什么意思?

    • 6 个回答
  • Marko Smith

    鼠标指针在 Windows 中按下的箭头键上移动?

    • 1 个回答
  • Marko Smith

    VirtualBox 无法以 VERR_NEM_VM_CREATE_FAILED 启动

    • 8 个回答
  • Marko Smith

    应用程序不会出现在 MacBook 的摄像头和麦克风隐私设置中

    • 5 个回答
  • Martin Hope
    Vickel Firefox 不再允许粘贴到 WhatsApp 网页中? 2023-08-18 05:04:35 +0800 CST
  • Martin Hope
    Saaru Lindestøkke 为什么使用 Python 的 tar 库时 tar.xz 文件比 macOS tar 小 15 倍? 2021-03-14 09:37:48 +0800 CST
  • Martin Hope
    CiaranWelsh 如何减少“vmmem”进程的消耗? 2020-06-10 02:06:58 +0800 CST
  • Martin Hope
    Jim Windows 10 搜索未加载,显示空白窗口 2020-02-06 03:28:26 +0800 CST
  • Martin Hope
    andre_ss6 远程桌面间歇性冻结 2019-09-11 12:56:40 +0800 CST
  • Martin Hope
    Riley Carney 为什么在 URL 后面加一个点会删除登录信息? 2019-08-06 10:59:24 +0800 CST
  • Martin Hope
    zdimension 鼠标指针在 Windows 中按下的箭头键上移动? 2019-08-04 06:39:57 +0800 CST
  • Martin Hope
    jonsca 我所有的 Firefox 附加组件突然被禁用了,我该如何重新启用它们? 2019-05-04 17:58:52 +0800 CST
  • Martin Hope
    MCK 是否可以使用文本创建二维码? 2019-04-02 06:32:14 +0800 CST
  • Martin Hope
    SoniEx2 更改 git init 默认分支名称 2019-04-01 06:16:56 +0800 CST

热门标签

windows-10 linux windows microsoft-excel networking ubuntu worksheet-function bash command-line hard-drive

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve