分类 电脑 下的文章

wordpess 移到 magento1.x 的子目录

需求:如果想将wordpress站点的目录移到magento1.x的子目录,通过magento的URL来访问,应该怎么做呢?

尝试:需要修改相应的静态化规则。如nginx的,可参考这个:https://docs.ukfast.co.uk/ecommercestacks/magento/magento1/wpinsubdir.html

location ~ ^/wp/ {
        index index.php index.html index.htm;
        try_files $uri $uri/ @wphandler;
        expires 30d;

        location ~* \.(ico|jpg|jpeg|png|gif|svg|js|css|swf|eot|ttf|otf|woff|woff2)$ {
                add_header Cache-Control "public";
                add_header X-Frame-Options "SAMEORIGIN";
                expires +1y;
                try_files $uri $uri/ /get.php?$args;
        }

        location ~* /(wp-admin/|wp-login\.php) {
                  try_files $uri $uri/ @wphandler;
                  index index.html index.htm index.php;
                  fastcgi_pass replacemebackend;

                  add_header Cache-Control "no-store";
                  fastcgi_buffers 1024 4k;
                  #fastcgi_param HTTPS $my_https; # Uncomment the below for SSL offloading
                  #fastcgi_param SERVER_PORT $my_port; # Uncomment the below for SSL offloading
                  fastcgi_read_timeout 600s;
                  fastcgi_connect_timeout 600s;
                  fastcgi_index index.php;
                  fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                  include fastcgi_params;
        }

        location ~* \.php$ {
                try_files $uri $uri/ =404;
                fastcgi_pass replacemebackend;
               #fastcgi_param HTTPS $my_https; # Uncomment the below for SSL offloading
               #fastcgi_param SERVER_PORT $my_port; # Uncomment the below for SSL offloading
                include fastcgi_params;
                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                include fastcgi_params;
        }
  }

  location @wphandler {
        rewrite / /wp/index.php;
  }

在 Oracle Cloud 甲骨文云里安装 Debian bookworm

步骤:

  1. 虚拟机选择的是Ubuntu 20系统
  2. 在Ubuntu系统里安装 refind
  3. 下载debian的网络安装包,保存到/boot/efi/debian-installer/amd64/linux 或 initrd.gz
  4. 如需要自动或启用远程安装,请修改 initrd.gz 文件内容
  5. 修改 /boot/efi/EFI/refind/refind.cfg 的配置内容,启用 textonly 且 增加debian的安装项,如:
    menuentry Debian-Installer {
    loader /debian-installer/amd64/linux
    initrd /debian-installer/amd64/initrd.gz
    options "auto=true priority=critical mirror/http/hostname=deb.debian.org"
    }
  6. 保存后,重启机子,在甲骨文机子的控制台,可以看到rEFInd的菜单,开始安装
  7. 如果需要在甲骨文机子的控制台看到安装过程,请增加如 DEBIAN_FRONTEND=text console=tty1 console=ttyS0 的参数,因为是需要在串口设备中看到输出内容

参考:

在centos7里安装opendkim

  1. 先检查和设置主机名,如 改为 mail.anqun.org
  2. yum install -y opendkim # 安装 opendkim
  3. opendkim-default-keygen # 生成默认邮件域名密匙对。/etc/opendkim/keys/default.private 是私匙,default.txt 里边有域名解析所需的公匙
  4. vi /etc/opendkim.conf # 配置文件。可修改监听的地址,如 Socket inet6:8891 ; 域名 KeyTable 等项
  5. vi /etc/opendkim/KeyTable # 照例子,写上自己的域名
  6. vi /etc/opendkim/SigningTable # 照例子,写上域名附上签名的邮箱地址或域
  7. vi /etc/opendkim/TrustedHosts # 照例子,写上信任的主机名或IP地址
  8. vi /etc/postfix/main.cf # 加上opendkim的配置,如

    smtpd_milters = inet:localhost:8891
    non_smtpd_milters = $smtpd_milters
    milter_default_action = accept
  9. 之后重启opendkim和postfix,请新设置生效
  10. 如postfix提示connect to Milter service inet:localhost:8891: Connection refused 错误的,需要检查一下postfix是否使用了与opendkim相符的网络接口,如postfix的inet_interfaces是否有localhost

参考:

WHM/cPanel 安装 libsodium

问题:WHM/cPanel的面板环境,安装magento2需要php的sodium扩展。

尝试:

  1. 登录到WHM中,打开“终端”
  2. yum -y install epel-release # 安装epel安装源
  3. yum -y install libsodium libsodium-devel # 安装 libsodium
  4. 转到 Module Installers 页,在相应的php版本中,在 PECL 里输入 libsodium ,然后点击 Install Now 安装

参考:https://www.vpsblocks.com.au/support/Knowledgebase/Article/View/411/11/installing-libsodium-on-cpanel-servers

WinpkFilter - 注册表 - 设置 SetMTUDecrement

现象:Windows Packet Filter 安装后,想设置 MTUDecrement 的值,但演示的几个程序里没有直接的设置说明。
尝试:用 Process Monitor 来跟踪 演示程序里的 ListAdapters 读取注册表行为,知:

HKLM\System\CurrentControlSet\Services\ndisrd\Parameters\MTUDecrement
Length:16
RegQueryValue

在相应的注册表位置新增相应的值就可以了。

"NdisImPlatformBindingOptions"=dword:00000002
"DefaultFilterSettings"=dword:00000001
"MTUDecrement"=dword:00000000

参考: