邓老师 发布的文章

https://blog.csdn.net/tanlintanlin/article/details/136800112

docker run -d --name db \
    -e MYSQL_ROOT_PASSWORD=123456 \
    -e MYSQL_USER=wordpress \
    -e MYSQL_PASSWORD=123456 \
    -e MYSQL_DATABASE=wordpress  \
    -v ~/wordpress/db:/var/lib/mysql \
    10.1.45.250:5000/mariadb:latest


docker run -d --name wordpress  \
-p 8082:80 \
--link db \
-e WORDPRESS_DB_HOST=db  \
-e WORDPRESS_DB_USER=wordpress  \
-e WORDPRESS_DB_PASSWORD=123456  \
-e WORDPRESS_DB_NAME=wordpress    \
-v ~/wordpress/html:/var/www/html \
10.1.45.250:5000/wordpress:latest

MySQL 8.0开始将caching_sha2_password作为默认的身份验证插件.
MariaDB 10.3 支持unix_socket、mysql_native_password认证插件。

mariadb 10.3 root 用户默认认证方式为unix_socket,在本地不需要密码直接登录。
更改认证方式:
UPDATE user SET plugin='unix_socket' WHERE User='root';
UPDATE user SET plugin='mysql_native_password' WHERE User='root';
flush privileges;

Mikrotik开局配置
一、LAN口桥接
1:添加桥接
/interface bridge add name=lan
2:把端口加到桥接
/interface bridge port add interface=ether2 bridge=lan
/interface bridge port add interface=ether3 bridge=lan
/interface bridge port add interface=ether4 bridge=lan
3:创建VLAN
/interface vlan add name=vlan2001 interface=lan vlan-id=2001
/interface vlan add name=vlan2002 interface=lan vlan-id=2002
二、IP地址和路由配置
1:添加内网IP地址添加到接口(也可以是VLAN)
/ip address add address=172.16.99.254 24 interface=lan
/ip address add address=10.10.1.254 24 interface=vlan2001
/ ip address add address=10.10.2.254 24 interface=vlan2001
2:添加外网IP地址到接口
/ip address add address=192.168.51.101 24 interface=ether1
/ip address add address=192.168.51.102 24 interface=ether1
3:添加默认网关到路由表
/ip route add dst-address=0.0.0.0 0 gateway=192.168.51.254
4:设置DNS
/ip dns set servers=8.8.4.4,8.8.8.8
三、添加NAT
1:添加客户上网用NAT

/ip firewall nat add chain=srcnat action=masquerade
/ip firewall nat add chain=srcnat src-address=10.10.2.0 24 action=src-nat to-addresses=192.168.51.102
2:添加远程管理内部设备用NAT
/ip firewall nat add chain=dstnat dst-address=192.168.51.101 dst-port=9901 protocol=tcp action=dst-nat to-addresses=172.16.99.1 to-ports=80
四、添加DHCP
1:添加IP地址池
/ip pool add name=vlan2001 ranges=10.10.1.1-10.10.1.253
/ip pool add name=vlan2002 ranges=10.10.2.1-10.10.2.253
2:添加DHCP服务器
/ip dhcp-server add name=vlan2001 interface=vlan2001 address-pool=vlan2001
/ip dhcp-server add name=vlan2002 interface=vlan2002 address-pool=vlan2002
3:添加DHCP分配网络信息
/ip dhcp-server network add address=10.10.1.0 24 gateway=10.10.1.254 dns-server=10.10.1.254,8.8.4.4
/ip dhcp-server network add address=10.10.2.0 24 gateway=10.10.2.254 dns-server=10.10.2.254,8.8.4.4

windows server 2022 core
安装OpenSSH Server服务器
Get-WindowsCapability -Online | ? Name -like 'OpenSSH*'

Add-WindowsCapability -Online -Name OpenSSH.Server
Set-Service -Name sshd -StartupType ‘Automatic’
Start-Service sshd

WebAdministration IISAdministration
首先要导入IIS管理模块WebAdministration
Import-Module WebAdministration
执行下面命令进入IIS命令行
IIS:
可以执行dir查看AppPools、Sites、SslBindings信息

微软案例:
https://learn.microsoft.com/zh-cn/iis/manage/powershell/powershell-snap-in-creating-web-sites-web-applications-virtual-directories-and-application-pools

新建应用程序池 api.dd.com

New-Item iis:\AppPools\api.dd.com
Set-ItemProperty iis:\AppPools\api.dd.com managedRuntimeVersion v4.0 #更改应用程序池版本为4.0,默认为2.0(Windows Server 2008 R2)

新建站点 api.dd.com,主机头为 api.dd.com,路经为 d:\apidd

New-Item iis:\Sites\api.dd.com -bindings @{protocol="http";bindingInformation=":80:api.dd.com"} -physicalPath d:\apidd
new-item test

为站点 api.dd.com 添加主机头 imageapi.dd2.com

New-WebBinding -Name "api.dd.com" -IPAddress "*" -Port 80 -HostHeader imageapi.dd2.com

为站点 api.dd.com 更改应用程序池为 api.dd.com

Set-ItemProperty IIS:\Sites\api.dd.com -name applicationPool -value api.dd.com

在站点api.dd.com下新建应用程序cust_account_api ,目录为D:\cust_account_api_new

new-item iis:\sites\api.dd.com\cust_account_api -type Application -physicalpath D:\cust_account_api_new
Set-ItemProperty IIS:\Sites\api.dd.com\cust_account_api -name applicationPool -value api.dd.com

在站点ServerLog下新建虚拟目录cust_account_api ,目录为D:\cust_account_api_new\log

new-item D:\cust_account_api_new\log -type directory -force
new-item iis:\sites\ServerLog\cust_account_api -type VirtualDirectory -physicalpath D:\cust_account_api_new\log

新建IISLog站点

New-Website -Name IISLog -Port 11001 -PhysicalPath "D:\IISLog"
New-WebVirtualDirectory -Site IISLog -Name APPLog -PhysicalPath D:\APPLog
New-WebVirtualDirectory -Site IISLog -Name SystemLog -PhysicalPath C:\Windows\System32\Winevt\Logs

更改IIS站点的物理路径:

Set-ItemProperty "iis:\sites\Default Web Site" -Name physicalpath -Value "c:\inetpub"

使用appcmd.exe:

New-Alias -name appcmd -value $env:windir\system32\inetsrv\appcmd.exe

这样就可以在当前PS环境下直接使用appcmd了

get-website

备份/还原单个站点:

1.appcmd add backup
2.remove-website|?{$_.name -ne "sitename"}

$webclient = New-Object Net.WebClient
$webclient.DownloadString("http://localhost");