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

abr_stackoverflow's questions

Martin Hope
abr_stackoverflow
Asked: 2019-05-15 23:34:07 +0800 CST

sshd 启动两个进程,但 systemd 只停止一个

  • 2

linux mint 18.3 sshd (7.2p2) 上有两个进程启动。但是当我运行时,service ssh stop只有子进程停止并且父进程仍在运行。因此,当我重新启动 ssh 服务时,它无法绑定 22 端口并且无法接收连接。

我阅读了有关权限分离的信息,尽管其他 linux(例如 Ubuntu)只创建一个进程,但我认为这很好。但是为什么子进程停止时父进程不会停止?以及如何让 systemd 停止这两个进程?

ssh.服务

[Unit]
Description=OpenBSD Secure Shell server
After=network.target auditd.service
ConditionPathExists=!/etc/ssh/sshd_not_to_be_run

[Service]
EnvironmentFile=-/etc/default/ssh
ExecStartPre=/usr/sbin/sshd -t
ExecStart=/usr/sbin/sshd -D $SSHD_OPTS
ExecReload=/usr/sbin/sshd -t
ExecReload=/bin/kill -HUP $MAINPID
KillMode=process
Restart=on-failure
RestartPreventExitStatus=255
Type=notify

[Install]
WantedBy=multi-user.target
Alias=sshd.service

多用户.target

#  This file is part of systemd.
#
#  systemd is free software; you can redistribute it and/or modify it
#  under the terms of the GNU Lesser General Public License as published by
#  the Free Software Foundation; either version 2.1 of the License, or
#  (at your option) any later version.

[Unit]
Description=Multi-User System
Documentation=man:systemd.special(7)
Requires=basic.target
Conflicts=rescue.service rescue.target
After=basic.target rescue.service rescue.target
AllowIsolate=yes

服务 ssh 状态

service ssh status
● ssh.service - OpenBSD Secure Shell server
   Loaded: loaded (/lib/systemd/system/ssh.service; enabled; vendor preset: enabled)
   Active: active (running) since Чт 2019-05-16 16:53:10 MSK; 6 days ago
  Process: 4535 ExecStartPre=/usr/sbin/sshd -t (code=exited, status=0/SUCCESS)
 Main PID: 4538 (sshd)
    Tasks: 2
   Memory: 16.4M
      CPU: 3.143s
   CGroup: /system.slice/ssh.service
           ├─4538 /usr/sbin/sshd -D
           └─4539 /usr/sbin/sshd -D
linux
  • 1 个回答
  • 1550 Views
Martin Hope
abr_stackoverflow
Asked: 2018-05-15 01:01:32 +0800 CST

如何在重定向期间向 nginx query_string 添加参数

  • 3

我想向 $query 字符串添加一个参数。现在我有了这个配置

server {
    server_name example.com;
    listen 80;

    return 301 http://test.example.com$request_uri;
}

但我想添加test=1到查询中。有用例:

http://example.com =>
    http://test.example.com?test=1

http://example.com/example =>
    http://test.example.com/example?test=1

http://example.com/example/?var=1 =>
    http://test.example.com/example/?var=1&test=1

我试图将 $request_uri 拆分为 $uri 和 $query_param 并得到

return 301 http://test.example.com$uri$query_string;

但我不能只将 test=1 添加到这个字符串中。如果我?test=1在第三种情况下添加,我会得到http://test.example.com/example/?var=1?test=1. 如果我&test=1在第一种和第二种情况下添加,我会得到http://test.example.com&test=1and http://test.example.com/example&test=1。

现在我按以下规则检查我的 $query_string:

if ($query_string ~ ^$) {
    return 301 http://test.example.com$uri?test=test;
}

if ($query_string ~ ^.+$) {
    return 301 http://test.example.com$uri?$query_string&test=test;
}

但我认为这项任务有更整洁的决定。

nginx
  • 1 个回答
  • 7448 Views
Martin Hope
abr_stackoverflow
Asked: 2016-12-16 00:51:58 +0800 CST

Ubuntu 16.04 中的 PHP7。一个 FPM 池尝试 chroot 另一个 FPM 池

  • 0

我将我的网站从旧的 PHP (php 5.4) 和 OS (Ubuntu 12.04) 移动到带有 PHP 7 和 Ubuntu 16.04 的新服务器。我在创建 FPM 池时遇到了错误。这是我的常用池配置:

[zabbix.example.com]
include = /etc/php/7.0/fpm/default-config.conf

user = www-data
group = www-data
listen = /data/www/zabbix/tmp/php-fpm.sock

request_terminate_timeout = 60s ; 30 sec for work
request_slowlog_timeout = 5s ; add to slowlog after 5 sec

slowlog = /data/www/zabbix/logs/slow.log
chroot =  /data/www/zabbix
chdir =   /public_html

php_admin_flag[display_errors] = off
php_admin_flag[display_startup_errors] = off

php_admin_value[memory_limit] = 256M
php_admin_value[sendmail_path] = /usr/sbin/sendmail -t [email protected]

php_admin_value[post_max_size] = 16M
php_admin_value[max_execution_time] = 300
php_admin_value[max_input_time] = 300

这是 default-config.conf:

pm = dynamic
pm.max_children = 100
pm.start_servers = 12
pm.min_spare_servers = 5
pm.max_spare_servers = 50
pm.max_requests = 1000
pm.status_path = /status

listen.backlog = -1
listen.owner = www-data
listen.group = www-data
listen.mode = 0666

ping.path = /ping
ping.response = pong

request_terminate_timeout = 90
request_slowlog_timeout = 20
catch_workers_output = yes
php_flag[display_errors] = off
php_flag[display_startup_errors] = off
php_value[disable_functions] = show_source,system,shell_exec,passthru,exec,popen,proc_open

php_admin_value[upload_tmp_dir] = /tmp

security.limit_extensions = .php .php3 .php4 .php5 .htm

此配置适用于旧服务器。但是在新服务器上,我遇到了 chrooting 问题。一些站点使用另一个站点的 chroot 目录。例如,我有这些池:site1.example.com、site2.example.com、site3.example.com、zabbix.example.com。所以 site1.example.com 尝试查找 site2.example.com 目录。如果我加载 site3.example.com,它会显示 zabbix.example.com。

我该如何解决?

php php-fpm pool
  • 2 个回答
  • 708 Views
Martin Hope
abr_stackoverflow
Asked: 2016-08-20 02:39:06 +0800 CST

为什么 exim 从同一个文件中读取证书和密钥?

  • 1

我通过将这些字符串添加到01_exim4-config_listmacrosdefs. 我使用拆分配置

MAIN_TLS_ENABLE = yes
MAIN_TLS_CERTKEY = /etc/exim4/example.com.crt
MAIN_TLS_PRIVATEKEY = /etc/exim4/example.com.key

所以重新启动后,连接到端口 465,输入EHLO,STARTTLS我得到了这个:454 TLS currently unavailable

在日志中我有这个:

13:29:36 10872 SMTP<< STARTTLS
13:29:36 10872 initialising GnuTLS as a server
13:29:36 10872 GnuTLS global init required.
13:29:36 10872 initialising GnuTLS server session
13:29:36 10872 Expanding various TLS configuration options for session credentials.
13:29:36 10872 certificate file = /etc/exim4/example.com.crt
13:29:36 10872 key file = /etc/exim4/example.com.crt
13:29:36 10872 LOG: MAIN
13:29:36 10872   TLS error on connection from (192.168.1.111) [91.210.44.50] (cert/key setup: cert=/etc/exim4/example.com.crt key=/etc/exim4/example.com.crt): Error in parsing.

为什么 exim 对证书和密钥使用相同的文件?怎么修?

ubuntu ssl configuration exim
  • 2 个回答
  • 832 Views
Martin Hope
abr_stackoverflow
Asked: 2016-08-18 03:39:35 +0800 CST

如何在exim中记录条件?

  • 0

我想查看 exim 中的条件值,例如“已验证”。我可以使用authenticated = *,但我不知道真正包含“authenticated”的内容。

如果我添加带有参数的警告部分,logwrite = $authenticated我会得到错误unknown variable name "authenticated"。

我也想看看条件“垃圾邮件”中包含什么。有很多手册说只是添加spam = nobody:false,但我不明白谁是没人,什么是假的。

logging configuration exim
  • 1 个回答
  • 714 Views
Martin Hope
abr_stackoverflow
Asked: 2016-06-25 05:31:56 +0800 CST

如何为电子邮件组设置 exim/dovecot?

  • 1

我想从 Axigen 迁移到 exim/dovecot。Axigen 有一个名为“组”的部分。所以我可以创建新组,添加几个帐户。当我向该组发送电子邮件后,所有成员都会收到此消息。我什至不知道谷歌是什么。我只找到邮件列表。但是 Axigen 也有邮件列表,它与群组不同。

那么我应该寻找我的目的是什么?

exim groups dovecot mailbox
  • 1 个回答
  • 440 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