<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>botao，作者博韬</title>
	<atom:link href="http://www.linuxopen.com/author/botao/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.linuxopen.com/author/botao/</link>
	<description>运维入门到入土</description>
	<lastBuildDate>Tue, 18 Mar 2025 10:25:13 +0000</lastBuildDate>
	<language>zh-Hans</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.7.2</generator>

<image>
	<url>http://www.linuxopen.com/wp-content/uploads/2022/09/cropped-cropped-写-32x32.jpg</url>
	<title>botao，作者博韬</title>
	<link>http://www.linuxopen.com/author/botao/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>开通SSL域名证书并配置自动续期</title>
		<link>http://www.linuxopen.com/20250318/%e5%bc%80%e9%80%9assl%e5%9f%9f%e5%90%8d%e8%af%81%e4%b9%a6%e5%b9%b6%e9%85%8d%e7%bd%ae%e8%87%aa%e5%8a%a8%e7%bb%ad%e6%9c%9f/</link>
					<comments>http://www.linuxopen.com/20250318/%e5%bc%80%e9%80%9assl%e5%9f%9f%e5%90%8d%e8%af%81%e4%b9%a6%e5%b9%b6%e9%85%8d%e7%bd%ae%e8%87%aa%e5%8a%a8%e7%bb%ad%e6%9c%9f/#respond</comments>
		
		<dc:creator><![CDATA[botao]]></dc:creator>
		<pubDate>Tue, 18 Mar 2025 10:25:13 +0000</pubDate>
				<category><![CDATA[SSL域名证书]]></category>
		<category><![CDATA[运维]]></category>
		<guid isPermaLink="false">http://www.linuxopen.com/?p=136</guid>

					<description><![CDATA[<p>安装certbot root@botao:~# apt update root@botao:~# apt in ... <a title="开通SSL域名证书并配置自动续期" class="read-more" href="http://www.linuxopen.com/20250318/%e5%bc%80%e9%80%9assl%e5%9f%9f%e5%90%8d%e8%af%81%e4%b9%a6%e5%b9%b6%e9%85%8d%e7%bd%ae%e8%87%aa%e5%8a%a8%e7%bb%ad%e6%9c%9f/" aria-label="阅读 开通SSL域名证书并配置自动续期">阅读更多</a></p>
<p><a href="http://www.linuxopen.com/20250318/%e5%bc%80%e9%80%9assl%e5%9f%9f%e5%90%8d%e8%af%81%e4%b9%a6%e5%b9%b6%e9%85%8d%e7%bd%ae%e8%87%aa%e5%8a%a8%e7%bb%ad%e6%9c%9f/">开通SSL域名证书并配置自动续期</a>最先出现在<a href="http://www.linuxopen.com">博韬</a>。</p>
]]></description>
										<content:encoded><![CDATA[<h3>安装certbot</h3>
<pre><code class="language-plain">root@botao:~# apt update 
root@botao:~# apt install certbot</code></pre>
<h3>申请单域名证书</h3>
<ul>
<li>注意：需要关闭80端口，否则会报错。如遇未关闭80端口的报错，只需关闭后再次执行申请证书的命令即可。</li>
</ul>
<pre><code class="language-plain">root@botao:~# certbot certonly --standalone -d www.linuxopen.com --http-01-address 0.0.0.0
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator standalone, Installer None
Enter email address (used for urgent renewal and security notices)
 (Enter &#039;c&#039; to cancel): botao@linuxopen.com

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Please read the Terms of Service at
https://letsencrypt.org/documents/LE-SA-v1.5-February-24-2025.pdf. You must
agree in order to register with the ACME server. Do you agree?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(Y)es/(N)o: y

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Would you be willing, once your first certificate is successfully issued, to
share your email address with the Electronic Frontier Foundation, a founding
partner of the Let&#039;s Encrypt project and the non-profit organization that
develops Certbot? We&#039;d like to send you email about our work encrypting the web,
EFF news, campaigns, and ways to support digital freedom.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(Y)es/(N)o: y

IMPORTANT NOTES:
 - Congratulations! Your certificate and chain have been saved at:
   /etc/letsencrypt/live/www.linuxopen.com/fullchain.pem
   Your key file has been saved at:
   /etc/letsencrypt/live/www.linuxopen.com/privkey.pem
   Your certificate will expire on 2025-06-09. To obtain a new or
   tweaked version of this certificate in the future, simply run
   certbot again. To non-interactively renew *all* of your
   certificates, run &quot;certbot renew&quot;
 - If you like Certbot, please consider supporting our work by:

   Donating to ISRG / Let&#039;s Encrypt:   https://letsencrypt.org/donate
   Donating to EFF:                    https://eff.org/donate-le
</code></pre>
<h3>配置证书自动续期</h3>
<ul>
<li>证书有效期3个月，可以用脚本+计划任务自动续期。</li>
</ul>
<h4>自动续期脚本</h4>
<ul>
<li>检查证书过期时间小于15天执行证书续期命令</li>
</ul>
<pre><code class="language-plain">root@botao:~# cat /scripts/letsencript/ssl_renew.sh 
#!/bin/bash

daynum=`/usr/bin/certbot certificates | grep days| awk &#039;{print $6}&#039;`
realtime=`date +%Y-%m-%d+%H:%M:%S`

for day in $daynum
do
    if (( $day &lt;= 15 ));
    then
        /usr/bin/systemctl stop nginx &amp;&amp; /usr/bin/certbot renew &gt; /scripts/letsencrypt/certbot-renew.log &amp;&amp; /usr/bin/systemctl start nginx &amp;&amp; echo &quot;$realtime certbot ok&quot; &gt;&gt; /scripts/letsencrypt/end-renew.log
break
    fi
done
</code></pre>
<h4>计划任务</h4>
<ul>
<li>每周三早上10点17分执行证书续期脚本</li>
</ul>
<pre><code class="language-plain">root@botao:~# crontab -l
#Name: letsencrypt SSL自动续期
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
HOME=/scripts/letsencrypt
SHELL=/bin/bash
17 10 * * 3 ./ssl_renew.sh</code></pre>
<h3>nginx配置文件</h3>
<ul>
<li>主要是写清楚证书文件位置和代理端口</li>
</ul>
<pre><code class="language-plain">root@botao:/etc/nginx/conf.d# vim ssl_botao.conf 
server {
    listen 443 ssl;
    server_name linuxopen.com www.linuxopen.com;
    access_log /var/log/nginx/http443.access.log;
    error_log /var/log/nginx/http443.error.log;

        ssl_certificate   /etc/letsencrypt/live/www.linuxopen.com/fullchain.pem;
        ssl_certificate_key  /etc/letsencrypt/live/www.linuxopen.com/privkey.pem;
        ssl_session_timeout 5m;
        ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
        ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
        ssl_prefer_server_ciphers on;

        add_header Cache-Control no-cache;
        add_header Cache-Control private;

    location / {
            proxy_pass http://127.0.0.1:80;
            proxy_set_header Host $host;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }

    error_page 404 /404.html;
        location = /40x.html {
    }

    error_page 500 502 503 504 /50x.html;
        location = /50x.html {
    }
}
</code></pre>
<p><a href="http://www.linuxopen.com/20250318/%e5%bc%80%e9%80%9assl%e5%9f%9f%e5%90%8d%e8%af%81%e4%b9%a6%e5%b9%b6%e9%85%8d%e7%bd%ae%e8%87%aa%e5%8a%a8%e7%bb%ad%e6%9c%9f/">开通SSL域名证书并配置自动续期</a>最先出现在<a href="http://www.linuxopen.com">博韬</a>。</p>
]]></content:encoded>
					
					<wfw:commentRss>http://www.linuxopen.com/20250318/%e5%bc%80%e9%80%9assl%e5%9f%9f%e5%90%8d%e8%af%81%e4%b9%a6%e5%b9%b6%e9%85%8d%e7%bd%ae%e8%87%aa%e5%8a%a8%e7%bb%ad%e6%9c%9f/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>VSCode + Github + PicGo 搭建 Markdown 图床</title>
		<link>http://www.linuxopen.com/20220916/vscode-github-picgo-%e6%90%ad%e5%bb%ba-markdown-%e5%9b%be%e5%ba%8a/</link>
					<comments>http://www.linuxopen.com/20220916/vscode-github-picgo-%e6%90%ad%e5%bb%ba-markdown-%e5%9b%be%e5%ba%8a/#respond</comments>
		
		<dc:creator><![CDATA[botao]]></dc:creator>
		<pubDate>Fri, 16 Sep 2022 03:25:01 +0000</pubDate>
				<category><![CDATA[GitHub]]></category>
		<category><![CDATA[VSCode]]></category>
		<guid isPermaLink="false">http://www.linuxopen.com/?p=101</guid>

					<description><![CDATA[<p>参考：https://blog.csdn.net/qq_44314954/article/details/12 ... <a title="VSCode + Github + PicGo 搭建 Markdown 图床" class="read-more" href="http://www.linuxopen.com/20220916/vscode-github-picgo-%e6%90%ad%e5%bb%ba-markdown-%e5%9b%be%e5%ba%8a/" aria-label="阅读 VSCode + Github + PicGo 搭建 Markdown 图床">阅读更多</a></p>
<p><a href="http://www.linuxopen.com/20220916/vscode-github-picgo-%e6%90%ad%e5%bb%ba-markdown-%e5%9b%be%e5%ba%8a/">VSCode + Github + PicGo 搭建 Markdown 图床</a>最先出现在<a href="http://www.linuxopen.com">博韬</a>。</p>
]]></description>
										<content:encoded><![CDATA[<p>参考：<a href="https://blog.csdn.net/qq_44314954/article/details/122951033">https://blog.csdn.net/qq_44314954/article/details/122951033</a></p>
<h2>做Markdown图床方法说明</h2>
<h3>第一次用 ‘Typora + gitee + PicGo’的方式，两个问题</h3>
<ol>
<li>Typora收费了，最后不收费的版本有很多bug。</li>
<li>Gitee保存的图片不能在CSDN上显示。原因是Gitee开启了防盗链：<a href="https://blog.csdn.net/qq_42951560/article/details/123808036">https://blog.csdn.net/qq_42951560/article/details/123808036</a><br />
<h3>第二次用‘MarkText + 七牛云存储 + PicGo’的方式，还是两个问题</h3>
</li>
<li>MarkText导出的文件到CSDN、简书等平台乱序，需要重新排版。</li>
<li>七牛云存储的图片不能在CSDN上显示<br />
<h3>最终决定使用‘VSCode + Github + PicGo’的方式，目前没有遇到任何问题，搭建方式直接参考：<a href="https://blog.csdn.net/qq_44314954/article/details/122951033">https://blog.csdn.net/qq_44314954/article/details/122951033</a></h3>
<ul>
<li>Windows下VSCode上传图片的快捷方式：</li>
</ul>
</li>
<li>【ctrl+alt+U】从剪贴板粘贴图片<br />
2.【ctrl+alt+E】打开资源管理器，选择图片</li>
</ol>
<p><a href="http://www.linuxopen.com/20220916/vscode-github-picgo-%e6%90%ad%e5%bb%ba-markdown-%e5%9b%be%e5%ba%8a/">VSCode + Github + PicGo 搭建 Markdown 图床</a>最先出现在<a href="http://www.linuxopen.com">博韬</a>。</p>
]]></content:encoded>
					
					<wfw:commentRss>http://www.linuxopen.com/20220916/vscode-github-picgo-%e6%90%ad%e5%bb%ba-markdown-%e5%9b%be%e5%ba%8a/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Wordfence插件：Docker安装的wordpress配置Wordfence</title>
		<link>http://www.linuxopen.com/20220916/wordfence%e6%8f%92%e4%bb%b6%ef%bc%9adocker%e5%ae%89%e8%a3%85%e7%9a%84wordpress%e9%85%8d%e7%bd%aewordfence/</link>
					<comments>http://www.linuxopen.com/20220916/wordfence%e6%8f%92%e4%bb%b6%ef%bc%9adocker%e5%ae%89%e8%a3%85%e7%9a%84wordpress%e9%85%8d%e7%bd%aewordfence/#respond</comments>
		
		<dc:creator><![CDATA[botao]]></dc:creator>
		<pubDate>Fri, 16 Sep 2022 03:08:04 +0000</pubDate>
				<category><![CDATA[docker]]></category>
		<category><![CDATA[wordpress]]></category>
		<guid isPermaLink="false">http://www.linuxopen.com/?p=99</guid>

					<description><![CDATA[<p>wordfence介绍 Wordfence 包括一个端点防火墙和恶意软件扫描程序，它们是从头开始构建的，用于保 ... <a title="Wordfence插件：Docker安装的wordpress配置Wordfence" class="read-more" href="http://www.linuxopen.com/20220916/wordfence%e6%8f%92%e4%bb%b6%ef%bc%9adocker%e5%ae%89%e8%a3%85%e7%9a%84wordpress%e9%85%8d%e7%bd%aewordfence/" aria-label="阅读 Wordfence插件：Docker安装的wordpress配置Wordfence">阅读更多</a></p>
<p><a href="http://www.linuxopen.com/20220916/wordfence%e6%8f%92%e4%bb%b6%ef%bc%9adocker%e5%ae%89%e8%a3%85%e7%9a%84wordpress%e9%85%8d%e7%bd%aewordfence/">Wordfence插件：Docker安装的wordpress配置Wordfence</a>最先出现在<a href="http://www.linuxopen.com">博韬</a>。</p>
]]></description>
										<content:encoded><![CDATA[<h2>wordfence介绍</h2>
<p>Wordfence 包括一个端点防火墙和恶意软件扫描程序，它们是从头开始构建的，用于保护 WordPress。我们的 Threat Defense Feed 为 Wordfence 提供了确保您的网站安全所需的最新防火墙规则、恶意软件签名和恶意 IP 地址。 Wordfence 由 2FA 和一系列附加功能完善，是可用的最全面的 WordPress 安全解决方案。</p>
<h2>开启wordfence后遇到问题</h2>
<h3>问题：Docker安装的WordPress没有php.ini文件</h3>
<p>开启wordfence后在wordpress后台看到wordfence的配置提醒。<br />
<img decoding="async" src="https://cdn.jsdelivr.net/gh/mabotao/image@main/vscode/202209081001插件配置提醒.jpg" alt="202209081001插件配置提醒" /><br />
选择默认安装配置会提示无法安装，所以选择手动配置<br />
<img decoding="async" src="https://cdn.jsdelivr.net/gh/mabotao/image@main/vscode/202209081002手工配置.jpg" alt="202209081002手工配置" /><br />
需要向php.ini文件插入数据<br />
<img decoding="async" src="https://cdn.jsdelivr.net/gh/mabotao/image@main/vscode/202209081003插入代码.jpg" alt="202209081003插入代码" /><br />
未在Docker安装的WordPress上发现“php.ini”文件<br />
<img decoding="async" src="https://cdn.jsdelivr.net/gh/mabotao/image@main/vscode/202209081004没发现php文件.jpg" alt="202209081004没发现php文件" /></p>
<h3>解决</h3>
<p>网上查阅资料得知“在docker官方PHP镜像的配置文件路径在：/usr/local/etc/php/conf.d 文件夹，严格意义上讲，并没有php.ini，而是把配置打散在该文件夹里的各个文件里。”<br />
参考：<a href="http://t.zoukankan.com/setevn-p-13541853.html">http://t.zoukankan.com/setevn-p-13541853.html</a></p>
<h4>添加新的php配置文件docker-php-ext-wordfence.ini</h4>
<pre><code># Docker内没装vi编辑器，在宿主机新编配置文件
root@botao:/script/docker/conf# vim docker-php-ext-wordfence.ini
auto_prepend_file = &#039;/var/www/html/wordfence-waf.php&#039;

# 将配置文件放入容器内的指定位置
root@botao:/script/docker/conf# docker cp docker-php-ext-wordfence.ini wordpress:/usr/local/etc/php/conf.d/

# 在容器内查看文件已存在
root@959f840068fb:/var/www/html# ls -alh /usr/local/etc/php/conf.d/docker-php-ext-wordfence.ini 
-rw-r--r-- 1 root root 54 Sep  8 01:49 /usr/local/etc/php/conf.d/docker-php-ext-wordfence.ini

# 重启wordpress容器
root@botao:/script/docker/conf# docker restart wordpress
wordpress
root@botao:/script/docker/conf# docker ps
CONTAINER ID   IMAGE       COMMAND                  CREATED      STATUS         PORTS                                     NAMES
959f840068fb   wordpress   &quot;docker-entrypoint.s…&quot;   6 days ago   Up 5 seconds   0.0.0.0:30080-&gt;80/tcp, :::30080-&gt;80/tcp   wordpress
</code></pre>
<p>至此就配置好了，在WordPress后台也没有wordfence的配置提示了。</p>
<p><a href="http://www.linuxopen.com/20220916/wordfence%e6%8f%92%e4%bb%b6%ef%bc%9adocker%e5%ae%89%e8%a3%85%e7%9a%84wordpress%e9%85%8d%e7%bd%aewordfence/">Wordfence插件：Docker安装的wordpress配置Wordfence</a>最先出现在<a href="http://www.linuxopen.com">博韬</a>。</p>
]]></content:encoded>
					
					<wfw:commentRss>http://www.linuxopen.com/20220916/wordfence%e6%8f%92%e4%bb%b6%ef%bc%9adocker%e5%ae%89%e8%a3%85%e7%9a%84wordpress%e9%85%8d%e7%bd%aewordfence/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Debian11利用docker安装wordpress</title>
		<link>http://www.linuxopen.com/20220906/debian11%e5%88%a9%e7%94%a8docker%e5%ae%89%e8%a3%85wordpress/</link>
					<comments>http://www.linuxopen.com/20220906/debian11%e5%88%a9%e7%94%a8docker%e5%ae%89%e8%a3%85wordpress/#respond</comments>
		
		<dc:creator><![CDATA[botao]]></dc:creator>
		<pubDate>Tue, 06 Sep 2022 12:51:19 +0000</pubDate>
				<category><![CDATA[debian]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[docker]]></category>
		<guid isPermaLink="false">http://botao.linuxopen.com/?p=53</guid>

					<description><![CDATA[<p>准备 服务器 选择了阿里云的服务器，配置是1C2G。之前用1C1G的服务器搭建过，会非常卡。 域名 建议采购一 ... <a title="Debian11利用docker安装wordpress" class="read-more" href="http://www.linuxopen.com/20220906/debian11%e5%88%a9%e7%94%a8docker%e5%ae%89%e8%a3%85wordpress/" aria-label="阅读 Debian11利用docker安装wordpress">阅读更多</a></p>
<p><a href="http://www.linuxopen.com/20220906/debian11%e5%88%a9%e7%94%a8docker%e5%ae%89%e8%a3%85wordpress/">Debian11利用docker安装wordpress</a>最先出现在<a href="http://www.linuxopen.com">博韬</a>。</p>
]]></description>
										<content:encoded><![CDATA[
<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p></p></blockquote>

<h2>准备</h2>
<h3>服务器</h3>
<ul>
<li>选择了阿里云的服务器，配置是1C2G。之前用1C1G的服务器搭建过，会非常卡。</li>
</ul>
<h3>域名</h3>
<ul>
<li>建议采购一个域名，便宜的域名有.cn或者.top大概三四十一年，可以从阿里云或腾讯云上采购域名。</li>
</ul>
<h2>安装docker</h2>
<ul>
<li>参考：<a href="https://blog.csdn.net/qq_30818545/article/details/124514016">https://blog.csdn.net/qq_30818545/article/details/124514016</a></li>
</ul>
<h3>卸载docker历史版本</h3>
<pre><code># 找不到文件说明之前没有装过docker

root@botao:~# apt-get remove docker docker-engine docker.io containerd runc
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package docker
E: Unable to locate package docker-engine
E: Unable to locate package docker.io
E: Couldn&#039;t find any package by glob &#039;docker.io&#039;
E: Couldn&#039;t find any package by regex &#039;docker.io&#039;
E: Unable to locate package containerd
E: Unable to locate package runc

root@botao:~# apt-get purge docker-ce docker-ce-cli containerd.io docker-conmpose-pluigin
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package docker-ce
E: Unable to locate package docker-ce-cli
E: Unable to locate package containerd.io
E: Couldn&#039;t find any package by glob &#039;containerd.io&#039;
E: Couldn&#039;t find any package by regex &#039;containerd.io&#039;
E: Unable to locate package docker-conmpose-pluigin

root@botao:~# rm -rf /var/lib/docker
root@botao:~# rm -rf /var/lib/containerd</code></pre>
<h3>安装支持库</h3>
<pre><code>root@botao:~# apt-get update
# 安装依赖包
root@botao:~# apt-get install ca-certificates curl gnupg lsb-release nginx -y
root@botao:~# curl -fsSL http://mirrors.aliyun.com/docker-ce/linux/debian/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
root@botao:~# chmod a+r /usr/share/keyrings/docker-archive-keyring.gpg
# 写入软件源信息
root@botao:~# echo &quot;deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] http://mirrors.aliyun.com/docker-ce/linux/debian $(lsb_release -cs) stable&quot; | sudo tee /etc/apt/sources.list.d/docker.list &gt; /dev/null
# 更新apt库
root@botao:~# apt-get update
# 查询储存库可用版本
root@botao:~# apt-cache madison docker-ce
 docker-ce | 5:20.10.17~3-0~debian-bullseye | http://mirrors.aliyun.com/docker-ce/linux/debian bullseye/stable amd64 Packages
 docker-ce | 5:20.10.16~3-0~debian-bullseye | http://mirrors.aliyun.com/docker-ce/linux/debian bullseye/stable amd64 Packages
 docker-ce | 5:20.10.15~3-0~debian-bullseye | http://mirrors.aliyun.com/docker-ce/linux/debian bullseye/stable amd64 Packages
 docker-ce | 5:20.10.14~3-0~debian-bullseye | http://mirrors.aliyun.com/docker-ce/linux/debian bullseye/stable amd64 Packages
 docker-ce | 5:20.10.13~3-0~debian-bullseye | http://mirrors.aliyun.com/docker-ce/linux/debian bullseye/stable amd64 Packages
 docker-ce | 5:20.10.12~3-0~debian-bullseye | http://mirrors.aliyun.com/docker-ce/linux/debian bullseye/stable amd64 Packages
 docker-ce | 5:20.10.11~3-0~debian-bullseye | http://mirrors.aliyun.com/docker-ce/linux/debian bullseye/stable amd64 Packages
 docker-ce | 5:20.10.10~3-0~debian-bullseye | http://mirrors.aliyun.com/docker-ce/linux/debian bullseye/stable amd64 Packages
 docker-ce | 5:20.10.9~3-0~debian-bullseye | http://mirrors.aliyun.com/docker-ce/linux/debian bullseye/stable amd64 Packages
 docker-ce | 5:20.10.8~3-0~debian-bullseye | http://mirrors.aliyun.com/docker-ce/linux/debian bullseye/stable amd64 Packages
 docker-ce | 5:20.10.7~3-0~debian-bullseye | http://mirrors.aliyun.com/docker-ce/linux/debian bullseye/stable amd64 Packages
 docker-ce | 5:20.10.6~3-0~debian-bullseye | http://mirrors.aliyun.com/docker-ce/linux/debian bullseye/stable amd64 Packages</code></pre>
<h3>安装docker</h3>
<pre><code>root@botao:~# apt-get install docker-ce docker-ce-cli containerd.io docker-compose docker-compose-plugin -y
# 配置开机自启动
root@botao:~# systemctl start docker &amp;&amp; systemctl enable docker</code></pre>
<h2>检查docker</h2>
<pre><code>root@botao:~# systemctl status docker
root@botao:~# docker --version
Docker version 20.10.17, build 100c701</code></pre>
<h2>Docker安装wordpress</h2>
<h3>Docker下载MySQL和WordPress镜像</h3>
<pre><code>root@botao:~# docker pull mysql
root@botao:~# docker pull wordpress</code></pre>
<h3>启动MySQL并配置数据库</h3>
<pre><code>root@botao:~# docker run --privileged=true --restart=always --name mysql -v /data/mysql:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=password -d mysql
# 配置MySQL，创建wordpress数据库
root@botao:~# docker exec -it mysql bash
bash-4.4# mysql -uroot -pbotao0705
mysql&gt; create database wordpress;
mysql&gt; flush privileges;</code></pre>
<h3>启动WordPress</h3>
<pre><code>root@botao:~# docker run --restart=always --name wordpress -p 30080:80 --link mysql:mysql -d wordpress</code></pre>
<h3>安装配置nginx</h3>
<pre><code># 注释nginx默认80端口服务
root@botao:~# vim /etc/nginx/sites-enabled/default
# 配置wordpress的nginx代理
root@botao:~# vim /etc/nginx/conf.d/wordpress.conf
server {
    listen 80;
# listen [::]:80;
    server_name _;
#    root /var/www/;
#    index index.php index.html index.htm;
    access_log /var/log/nginx/http80.access.log;
    error_log /var/log/nginx/http80.error.log;

    location / {
            proxy_pass http://127.0.0.1:30080;
            proxy_set_header Host $host;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }

    error_page 404 /404.html;
        location = /40x.html {
    }

    error_page 500 502 503 504 /50x.html;
        location = /50x.html {
    }
}

root@botao:~# systemctl start nginx &amp;&amp; systemctl enable nginx
</code></pre>
<h3>配置域名解析</h3>
<ul>
<li>将域名解析到服务器</li>
</ul>
<h2>配置WordPress</h2>
<ul>
<li>选择语言</li>
</ul>
<p><img decoding="async" src="http://qiniucdn.linuxopen.com/image/101选择语言.jpg" alt="101选择语言" /></p>
<ul>
<li>开始配置</li>
</ul>
<p><img decoding="async" src="http://qiniucdn.linuxopen.com/image/102开始配置.jpg" alt="102开始配置" /></p>
<ul>
<li>配置MySQL</li>
</ul>
<p><img decoding="async" src="http://qiniucdn.linuxopen.com/image/103配置MySQL.jpg" alt="103配置MySQL" /></p>
<ul>
<li>安装程序</li>
</ul>
<p><img decoding="async" src="http://qiniucdn.linuxopen.com/image/104安装程序.jpg" alt="104安装程序" /></p>
<ul>
<li>网站信息</li>
</ul>
<p><img decoding="async" src="http://qiniucdn.linuxopen.com/image/106网站信息.jpg" alt="106网站信息" /></p>
<ul>
<li>完成</li>
</ul>
<p><img decoding="async" src="http://qiniucdn.linuxopen.com/image/107完成.jpg" alt="107完成" /></p><p><a href="http://www.linuxopen.com/20220906/debian11%e5%88%a9%e7%94%a8docker%e5%ae%89%e8%a3%85wordpress/">Debian11利用docker安装wordpress</a>最先出现在<a href="http://www.linuxopen.com">博韬</a>。</p>
]]></content:encoded>
					
					<wfw:commentRss>http://www.linuxopen.com/20220906/debian11%e5%88%a9%e7%94%a8docker%e5%ae%89%e8%a3%85wordpress/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
