<?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>debian归档 - 我的技术分享</title>
	<atom:link href="http://www.linuxopen.com/tag/debian/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.linuxopen.com/tag/debian/</link>
	<description></description>
	<lastBuildDate>Wed, 07 Sep 2022 02:17:59 +0000</lastBuildDate>
	<language>zh-CN</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.1.1</generator>

<image>
	<url>http://www.linuxopen.com/wp-content/uploads/2022/09/cropped-cropped-写-32x32.jpg</url>
	<title>debian归档 - 我的技术分享</title>
	<link>http://www.linuxopen.com/tag/debian/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<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 rel="nofollow" href="http://www.linuxopen.com/20220906/debian11%e5%88%a9%e7%94%a8docker%e5%ae%89%e8%a3%85wordpress/">Debian11利用docker安装wordpress</a>最先出现在<a rel="nofollow" href="http://www.linuxopen.com">我的技术分享</a>。</p>
]]></description>
										<content:encoded><![CDATA[
<blockquote class="wp-block-quote"><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 rel="nofollow" href="http://www.linuxopen.com/20220906/debian11%e5%88%a9%e7%94%a8docker%e5%ae%89%e8%a3%85wordpress/">Debian11利用docker安装wordpress</a>最先出现在<a rel="nofollow" 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>
