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

Damiano Dotto's questions

Martin Hope
Damiano Dotto
Asked: 2024-02-17 18:08:35 +0800 CST

在 Bitnami EC2 t3a.medium 实例上优化 WordPress 的 PHP-FPM 配置

  • 5

我正在使用 Bitnami 在 AWS EC2 t3a.medium (4Gb Ram) 实例上运行 WordPress 网站。服务器的 RAM 经常被完全填满,导致服务器崩溃,我需要从 ec2 控制台重新启动它。

这是正常运行时间监视器: 在此输入图像描述

在此输入图像描述

我研究了调整我的 php-fpm 设置来缓解这个问题。

这是当前的配置:

opt/bitnami/php/etc$ cat memory.conf
pm.max_children = 47
pm.start_servers = 20
pm.min_spare_servers = 20
pm.max_spare_servers = 30
pm.max_requests = 2500

MariaDB配置文件:

[mysqladmin]
user=****************

[mysqld]
skip_name_resolve
explicit_defaults_for_timestamp
basedir=/opt/bitnami/mariadb
port=3306
tmpdir=/opt/bitnami/mariadb/tmp
socket=/opt/bitnami/mariadb/tmp/mysql.sock
pid_file=/opt/bitnami/mariadb/tmp/mysqld.pid
max_allowed_packet=16M
bind_address=127.0.0.1
log_error=/opt/bitnami/mariadb/logs/mysqld.log
slow_query_log=1
slow_query_log_file=/opt/bitnami/mariadb/logs/mysqld_slowquery.log
long_query_time=10.0
character_set_server=utf8
collation_server=utf8_general_ci
plugin_dir=/opt/bitnami/mariadb/lib/plugin

[client]
port=3306
socket=/opt/bitnami/mariadb/tmp/mysql.sock
default_character_set=utf8
plugin_dir=/opt/bitnami/mariadb/lib/plugin

[manager]
port=3306
socket=/opt/bitnami/mariadb/tmp/mysql.sock
pid_file=/opt/bitnami/mariadb/tmp/mysqld.pid
!include /opt/bitnami/mariadb/conf/bitnami/memory.conf

内存.conf:

long_query_time = 1
query_cache_limit=2M
query_cache_type=1
query_cache_size=128M
innodb_buffer_pool_size=256M

/opt/bitnami/mariadb/logs/mysqld_slowquery.log:https://pastebin.com/ZVecqAXp _

amazon-web-services
  • 1 个回答
  • 67 Views
Martin Hope
Damiano Dotto
Asked: 2021-06-24 07:26:08 +0800 CST

Squid 代理服务配置问题

  • 0

我已经安装了 squid 代理来过滤来自 docker 的出站流量。具体来说,我使用 docker 创建了一个 jupyterhub 环境,以隔离每个用户并为他们提供虚拟环境。

现在我想过滤出站流量,以便他们只能访问某些域和使用 jupyterhub 的 docker 在本地安装的服务。

使用 cURL 调用代理可以正常工作。它只允许输入的域并使我们访问本地的 jupyterhub 服务。但是,要从Web界面打开它,会发生此错误:

在此处输入图像描述

我已经启用了 ip 172.17.0.1 和端口 8081 的服务,并且 cUrl 测试正在运行。

我该如何解决?

一些配置:

config.json (~/.config.json):

{
 "proxies":
{
   "default":
   {
     "httpProxy": "http://127.0.0.1:3128",
     "httpsProxy": "http://127.0.0.1:3128",
     "noProxy": "127.0.0.0/8"
   }
 }
}

squid.conf (/etc/squid/squid.conf):

acl localnet src 10.0.0.0/8     # RFC1918 possible internal network
acl localnet src 172.16.0.0/12  # RFC1918 possible internal network
acl localnet src 192.168.0.0/16 # RFC1918 possible internal network
acl localnet src fc00::/7       # RFC 4193 local private network range
acl localnet src fe80::/10      # RFC 4291 link-local (directly plugged) machines
acl localnet src 172.17.0.1/32

acl SSL_ports port 443
acl Safe_ports port 80          # http
acl Safe_ports port 443         # https
acl CONNECT method CONNECT

#### 23/06/2021 #############
acl jupyterhub_port port 8081
acl jupyterhub_addr dst 172.17.0.1
http_access allow jupyterhub_port jupyterhub_addr

# Deny requests to certain unsafe ports
http_access deny !Safe_ports

# Deny CONNECT to other than secure SSL ports
http_access deny CONNECT !SSL_ports

# Only allow cachemgr access from localhost
http_access allow localhost manager
http_access deny manager

###### 18/06/2021

acl whitelist dstdomain .python.org .pypi.org .pythonhosted.org .pypa.io .yahoo.com
http_access allow whitelist

# And finally deny all other access to this proxy
http_access deny all

# Squid normally listens to port 3128
http_port 3128

# Leave coredumps in the first cache dir
coredump_dir /var/spool/squid

# Add any of your own refresh_pattern entries above these.
refresh_pattern ^ftp:           1440    20%     10080
refresh_pattern ^gopher:        1440    0%      1440
refresh_pattern -i (/cgi-bin/|\?) 0     0%      0
refresh_pattern .               0       20%     4320

通过代理卷曲:

curl http://172.17.0.1:8081/hub/api --proxy 127.0.0.1:3128
{"version": "1.4.1"}
proxy squid docker
  • 1 个回答
  • 137 Views
Martin Hope
Damiano Dotto
Asked: 2021-06-18 20:23:03 +0800 CST

Centos Docker iptables 阻止除域之外的所有流量

  • 2

我正在尝试阻止来自 iptables 的所有传出流量,用于 docker 的接口 docker0。但我想打开几个域的访问权限:

我怎样才能做到这一点?

我试过了:

iptables -I OUTPUT -o docker0 -j DROP 
iptables -I DOCKER -i docker0 -p udp --dport 53 -j ACCEPT 
iptables -I DOCKER -i docker0 -p tcp -d mydomain.com --dport 80 -j ACCEPT 
iptables -I DOCKER -i docker0 -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
centos iptables docker
  • 1 个回答
  • 205 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