Site updated: 2022-10-20 09:47:16

This commit is contained in:
qinglong
2022-10-20 09:47:18 +08:00
parent 6e3e5e33e2
commit 5eda15ed46
76 changed files with 237 additions and 91 deletions

View File

@ -8,7 +8,7 @@
<author>
<name>Hito li</name>
</author>
<updated>2022-10-19T00:51:00.000Z</updated>
<updated>2022-10-20T00:56:00.000Z</updated>
<category term="hito" />
<category term="無言" />
<category term="博客" />
@ -16,6 +16,62 @@
<category term="笔记" />
<category term="心得体会" />
<category term="踩坑" />
<entry>
<id>https://blog.jingxiyuan.cn/2022/10/20/%E6%9E%81%E7%A9%BA%E9%97%B4Docker%E7%89%88Wordpress%E5%AE%89%E8%A3%85%E4%B8%8E%E9%85%8D%E7%BD%AE/</id>
<title>极空间Docker版Wordpress安装与配置</title>
<link rel="alternate" href="https://blog.jingxiyuan.cn/2022/10/20/%E6%9E%81%E7%A9%BA%E9%97%B4Docker%E7%89%88Wordpress%E5%AE%89%E8%A3%85%E4%B8%8E%E9%85%8D%E7%BD%AE/"/>
<content type="html">&lt;h4 id=&#34;安装&#34;&gt;&lt;a class=&#34;anchor&#34; href=&#34;#安装&#34;&gt;#&lt;/a&gt; 安装&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;下载最新版 wordpress 镜像,如极空间无法下载,可到&lt;span class=&#34;exturl&#34; data-url=&#34;aHR0cHM6Ly9wdWxsaW1hZ2UucGFzc2VybWEuY29tLw==&#34;&gt; passerma 网站&lt;/span&gt;下载。&lt;/li&gt;
&lt;li&gt;需要先在 mysql 中创建给 wordpress 使用的库。&lt;/li&gt;
&lt;li&gt;文件路径映射(目前极空间不能映射到高速盘,否则无法启动)。&lt;br /&gt;
&lt;img data-src=&#34;https://file.jingxiyuan.cn/images/2022/10/20/2022-10-20-08-58-31.png&#34; alt=&#34;&#34; /&gt;&lt;/li&gt;
&lt;li&gt;端口映射。&lt;br /&gt;
&lt;img data-src=&#34;https://file.jingxiyuan.cn/images/2022/10/20/2022-10-20-08-58-56.png&#34; alt=&#34;&#34; /&gt;&lt;/li&gt;
&lt;li&gt;通过映射的端口访问安装界面(一定要通过最终访问的页面进行安装,否则修改配置比较麻烦。如最终是域名访问,就先把域名解析代理等先配置好,再通过域名访问安装)。&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&#34;配置&#34;&gt;&lt;a class=&#34;anchor&#34; href=&#34;#配置&#34;&gt;#&lt;/a&gt; 配置&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;如需使用 https 访问,需要在 wp-config.php 中加入以下代码,否则资源文件无法访问。&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code class=&#34;language-php&#34;&gt;if((!empty( $_SERVER[&#39;HTTP_X_FORWARDED_HOST&#39;])) || (!empty( $_SERVER[&#39;HTTP_X_FORWARDED_FOR&#39;])) ) &amp;#123;
$_SERVER[&#39;HTTP_HOST&#39;] = $_SERVER[&#39;HTTP_X_FORWARDED_HOST&#39;];
$_SERVER[&#39;HTTPS&#39;] = &#39;on&#39;;
&amp;#125;
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;后台安装插件时如果跳转到 ftp 配置,则需要在 wp-config.php 中加入以下代码,并到 wp-content 目录下创建 tmp 目录,最后还需要给 tmp 目录赋予读写权限。&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code class=&#34;language-php&#34;&gt;define(&#39;WP_TEMP_DIR&#39;, ABSPATH.&#39;wp-content/tmp&#39;);
define(&#39;FS_METHOD&#39;, &#39;direct&#39;);
define(&#39;FS_CHMOD_DIR&#39;, 0777);
define(&#39;FS_CHMOD_FILE&#39;, 0777);
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;目录和文件所有者、组会自动变为 root目前我是通过访问页面时通过命令修正。暂时未发现问题如果不行则只能通过定时任务来定时修正了。需要在 wp-config.php 中加入以下代码。&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code class=&#34;language-php&#34;&gt;chown(&#39;/var/www/html&#39;, &#39;www-data&#39;);
chgrp(&#39;/var/www/html&#39;, &#39;www-data&#39;);
chmod(&#39;/var/www/html/wp-content/plugins&#39;, 0777);
chmod(&#39;/var/www/html/wp-content/themes&#39;, 0777);
chmod(&#39;/var/www/html/wp-content/tmp&#39;, 0777);
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;隐藏后台访问需要在 wp-login.php 中加入以下代码key、value 和 https://www.xxx.com/ 需要修改为自己的。修改后只能通过 https://www.xxx.com/wp-login.php?key=value 访问,其它访问需要登录的页面都会跳转到配置的 https://www.xxx.com/ 地址。&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code class=&#34;language-php&#34;&gt;if($_GET[&#39;key&#39;] != &#39;value&#39;) &amp;#123;
header(&#39;Location: https://www.xxx.com/&#39;);
&amp;#125;
&lt;/code&gt;&lt;/pre&gt;
</content>
<category term="极空间" scheme="https://blog.jingxiyuan.cn/categories/%E6%9E%81%E7%A9%BA%E9%97%B4/" />
<category term="Docker" scheme="https://blog.jingxiyuan.cn/categories/%E6%9E%81%E7%A9%BA%E9%97%B4/Docker/" />
<category term="Wordpress" scheme="https://blog.jingxiyuan.cn/categories/%E6%9E%81%E7%A9%BA%E9%97%B4/Docker/Wordpress/" />
<category term="博客" scheme="https://blog.jingxiyuan.cn/tags/%E5%8D%9A%E5%AE%A2/" />
<category term="极空间" scheme="https://blog.jingxiyuan.cn/tags/%E6%9E%81%E7%A9%BA%E9%97%B4/" />
<category term="Wordpress" scheme="https://blog.jingxiyuan.cn/tags/Wordpress/" />
<updated>2022-10-20T00:56:00.000Z</updated>
</entry>
<entry>
<id>https://blog.jingxiyuan.cn/2022/10/19/%E9%95%BF%E4%BA%86%E4%B8%80%E5%B2%81/</id>
<title>又长了一岁</title>
@ -450,8 +506,8 @@ url 后缀必须用红线圈中的部分key 在 chevereto 登陆后 api 配
<category term="Windows" scheme="https://blog.jingxiyuan.cn/categories/Windows/" />
<category term="工具" scheme="https://blog.jingxiyuan.cn/categories/Windows/%E5%B7%A5%E5%85%B7/" />
<category term="经验分享" scheme="https://blog.jingxiyuan.cn/categories/Windows/%E5%B7%A5%E5%85%B7/%E7%BB%8F%E9%AA%8C%E5%88%86%E4%BA%AB/" />
<category term="PicGo" scheme="https://blog.jingxiyuan.cn/tags/PicGo/" />
<category term="chevereto" scheme="https://blog.jingxiyuan.cn/tags/chevereto/" />
<category term="PicGo" scheme="https://blog.jingxiyuan.cn/tags/PicGo/" />
<updated>2022-10-12T06:40:00.000Z</updated>
</entry>
<entry>
@ -833,11 +889,11 @@ server &amp;#123;
<category term="极空间" scheme="https://blog.jingxiyuan.cn/categories/%E6%9E%81%E7%A9%BA%E9%97%B4/" />
<category term="Docker" scheme="https://blog.jingxiyuan.cn/categories/%E6%9E%81%E7%A9%BA%E9%97%B4/Docker/" />
<category term="技术分享" scheme="https://blog.jingxiyuan.cn/categories/%E6%9E%81%E7%A9%BA%E9%97%B4/Docker/%E6%8A%80%E6%9C%AF%E5%88%86%E4%BA%AB/" />
<category term="chevereto" scheme="https://blog.jingxiyuan.cn/tags/chevereto/" />
<category term="docker" scheme="https://blog.jingxiyuan.cn/tags/docker/" />
<category term="极空间" scheme="https://blog.jingxiyuan.cn/tags/%E6%9E%81%E7%A9%BA%E9%97%B4/" />
<category term="docker" scheme="https://blog.jingxiyuan.cn/tags/docker/" />
<category term="图床" scheme="https://blog.jingxiyuan.cn/tags/%E5%9B%BE%E5%BA%8A/" />
<category term="图片上传" scheme="https://blog.jingxiyuan.cn/tags/%E5%9B%BE%E7%89%87%E4%B8%8A%E4%BC%A0/" />
<category term="chevereto" scheme="https://blog.jingxiyuan.cn/tags/chevereto/" />
<updated>2022-09-16T00:04:00.000Z</updated>
</entry>
<entry>