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

michi.0x5d's questions

Martin Hope
michi.0x5d
Asked: 2020-08-11 05:49:50 +0800 CST

如何在 Step 中创建三级 CA?

  • 0

步骤允许使用现有的根证书使用step ca init --root=a.crt --key=a.key. 在这种情况下,步骤会生成一个中间证书以供以后使用。但是,我的根证书之前已经用于在步骤之外生成证书。

在“A”-CA 中没有串行冲突的情况下解决这个问题的想法是一个中间 CA“B”,然后可以作为 root 逐步使用。但是,这会在运行 step 时导致问题,因为 step 并非没有关于“A”-CA 的任何内容。我希望步骤创建另一个由“B”签名的中间体,如下所示:

A        my old root, used for other manually managed certificates
\-B      a new CA certificate, managed manually
  \-C    Step's intermediate CA

有没有办法做到这一点?

certificate-authority ssl-certificate openssl
  • 1 个回答
  • 51 Views
Martin Hope
michi.0x5d
Asked: 2019-09-17 03:57:52 +0800 CST

域集成 Samba 服务器的来宾共享

  • 0

已设置 Windows 域集成的 samba 服务器。共享文件运行良好,但只要security设置为. 就无法设置来宾共享ads。这是配置的缩短版本,其中包含对某个域组免费的共享和未经过身份验证的用户的非工作共享。我附上了 smb.conf 以供参考。

[global]
    workgroup = MYDOMAIN
    dns proxy = no
    netbios name = myshare
    clustering = yes

    security = ads
    realm = mydomain.com
    password server = 1.2.3.4
    winbind enum users = yes
    winbind enum groups = yes
    winbind cache time = 10
    winbind use default domain = yes
    client use spnego = yes
    client ntlmv2 auth = yes
    encrypt passwords = yes
    restrict anonymous = 2
    domain master = no
    local master = no
    preferred master = no
    os level = 0
    idmap uid = 100000-109999
    idmap gid = 100000-109999

    log file = /var/log/samba/log
    log level = 3
    max log size = 1000
    syslog = 0
    panic action = /usr/share/samba/panic-action %d

    server role = standalone server
    passdb backend = tdbsam

    unix password sync = yes
    pam password change = yes
    map to guest = bad user
    guest account = nobody


[public]
    browsable = yes
    create mask = 0666
    directory mask = 0777
    writeable = yes
    path = /share/public
    guest ok = yes

[temp]
    browsable = yes
    valid users = root, @"share users"
    create mask = 0666
    directory mask = 0777
    writeable = yes
    path = /share/temp
    guest ok = no

但是guest ok = yes似乎没有任何效果(temp 正在按预期工作,可由 root 和组的用户写入)。nobody应该映射到的用户具有共享文件夹的 rwx 权限。

那么,当安全性通常是这样时,还需要什么来授予访客访问特定共享的权限ads?

domain
  • 1 个回答
  • 812 Views
Martin Hope
michi.0x5d
Asked: 2017-02-24 06:13:49 +0800 CST

如何创建非缓存快速 nginx 反向代理?

  • 0

Nginx 应该很快——至少人们这么说。

我无法快速获得 nginx。对于基准测试,我使用siege多种配置来模拟高负载。所以我尝试对单个服务器进行负载平衡(我知道对单个服务器进行负载平衡是相当无用的,但对于测试负载平衡器本身这是有效的)。我已经设置了一个已经优化的 apache 反向代理作为参考。当我尝试从同一个后端服务器获取相同的 - 未缓存的 - 文件时,我通过 nginx 获得大约 80tps,使用 apache 获得大约 350tps。当然硬件/操作系统是一样的(当前双核cpu,2G ram,Ubuntu Server 16.04)。

我已经尝试更改工作人员、最大连接数、轮询方法、代理缓冲区大小、等待时间和客户端缓冲区。我可以看到系统负载很低,一个 nginx 使用大约 1% 的 CPU,连接将等待大约 5 到 6 秒。因为我想测量反向代理的性能,所以我不想在这个测试中缓存任何东西。

那么问题来了:如何优化 nginx 作为非缓存反向代理的性能?

攻城命令示例:siege -c 100 -b -r 100 -v <loadbalancer>/favicon.ico

更新:根据要求进行一些配置。为了保持 serverfault-conform 的问题,请回答关于参数有用的一般性问题。

user www-data;
worker_processes 2;
pid /run/nginx.pid;
#thread_pool default threads=1500 max_queue=65536;
worker_rlimit_nofile 40000;

events {
    worker_connections 768;
    #multi_accept on;
    #use epoll;
}

http {

    #aio threads=default;
    #proxy_buffers           32 4m;
    #proxy_busy_buffers_size     25m;
    #proxy_buffer_size 512k;

    sendfile on;
    tcp_nopush on;
    tcp_nodelay on;
    keepalive_timeout 65;
    types_hash_max_size 2048;
    # server_tokens off;

    # server_names_hash_bucket_size 64;
    # server_name_in_redirect off;

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

    ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
    ssl_prefer_server_ciphers on;

    access_log /var/log/nginx/access.log combined buffer=1k;
    error_log /var/log/nginx/error.log;

    gzip off;
    # gzip_disable "msie6";

    # gzip_vary on;
    # gzip_proxied any;
    # gzip_comp_level 6;
    # gzip_buffers 16 8k;
    # gzip_http_version 1.1;
    # gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;

    upstream kronos-backend {
        server kronos.example.com;
    }

    server {
        listen 80;
        listen [::]:80;

        ssl_certificate     /etc/ssl/certs/snakeoil.crt;
        ssl_certificate_key /etc/ssl/private/snakeoil.key;

        listen 443 ssl;
        listen [::]:443 ssl;

        keepalive_timeout 60;

        root /var/www/vhosts/default;

        index index.html;

        server_name <name>;

        server_tokens off; # Don't show that nginx is bringing out the website.

        location / {
            proxy_set_header Host            <name>;
            proxy_set_header X-Forwarded-For $remote_addr;
            proxy_pass http://kronos-backend;

            client_body_buffer_size 1M; # Lets keep all client-sent bodies in memory if less than 1 Megabyte. (Default for amd64: 16K)
            client_max_body_size 10M; # Maximum accepted body is 10M (Default is 1M).
        }
    }
}

这个配置不是很干净,我知道。但它或多或少地显示了我已经尝试过的东西。它源自 Ubuntu 中 nginx-package 的默认配置。

连接采用以下方式:

       +--- apache2 ---+
       |               |
siege -+               +--> some webserver (not of interest)
       |               |
       +--- nginx -----+

因此,通过 nginx 或 apache2 传输的数据无关紧要,只要不涉及缓存并且使用相同的 url(在本例中为静态文件)进行测试。缓存机制不是在任何网络服务器上有意激活的。

apache 中的配置使用 mpm_worker。

ThreadLimit          600
StartServers         4
ServerLimit          11
MinSpareThreads      50
MaxSpareThreads      100
ThreadsPerChild      200
MaxClients           1000
MaxRequestsPerChild  20000

上述围攻命令的示例输出:

$ siege -c 100 -b -r 10 <nginx>/wrapper_2_bg.png
** SIEGE 3.0.5
** Preparing 100 concurrent users for battle.
The server is now under siege..      done.

Transactions:                   1000 hits
Availability:                 100.00 %
Elapsed time:                  11.01 secs
Data transferred:               0.12 MB
Response time:                  0.84 secs
Transaction rate:              90.83 trans/sec
Throughput:                     0.01 MB/sec
Concurrency:                   76.24
Successful transactions:        1000
Failed transactions:               0
Longest transaction:            6.67
Shortest transaction:           0.03


$ siege -c 100 -b -r 10 <apache>/wrapper_2_bg.png
** SIEGE 3.0.5
** Preparing 100 concurrent users for battle.
The server is now under siege..      done.

Transactions:                   1000 hits
Availability:                 100.00 %
Elapsed time:                   3.16 secs
Data transferred:               0.12 MB
Response time:                  0.22 secs
Transaction rate:             316.46 trans/sec
Throughput:                     0.04 MB/sec
Concurrency:                   68.95
Successful transactions:        1000
Failed transactions:               0
Longest transaction:            3.06
Shortest transaction:           0.05
nginx reverse-proxy performance-tuning
  • 1 个回答
  • 1558 Views
Martin Hope
michi.0x5d
Asked: 2015-09-19 11:33:14 +0800 CST

md raid10:如何确保复制的数据存储在正确的位置?

  • 0

创建经典镜像 RAID 时,通常会在不同类型的磁盘上定位数据副本。在这种情况下,您将混合使用不同系列和制造商的磁盘。如果整个系列出现故障,这会降低丢失数据的风险。

假设我想用两个制造商制造的四个磁盘构建一个基于 md 的 raid 10。如何确保将数据复制到不同类型的磁盘上?

我知道可以指定布局near和far(描述offset)。这些布局指向正确的方向,但我不确定 md 如何“排序”磁盘。这可能会导致在相同类型的磁盘上复制。

mdadm
  • 2 个回答
  • 418 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