Site updated: 2022-10-20 09:47:16
This commit is contained in:
64
atom.xml
64
atom.xml
@ -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"><h4 id="安装"><a class="anchor" href="#安装">#</a> 安装</h4>
|
||||
<ul>
|
||||
<li>下载最新版 wordpress 镜像,如极空间无法下载,可到<span class="exturl" data-url="aHR0cHM6Ly9wdWxsaW1hZ2UucGFzc2VybWEuY29tLw=="> passerma 网站</span>下载。</li>
|
||||
<li>需要先在 mysql 中创建给 wordpress 使用的库。</li>
|
||||
<li>文件路径映射(目前极空间不能映射到高速盘,否则无法启动)。<br />
|
||||
<img data-src="https://file.jingxiyuan.cn/images/2022/10/20/2022-10-20-08-58-31.png" alt="" /></li>
|
||||
<li>端口映射。<br />
|
||||
<img data-src="https://file.jingxiyuan.cn/images/2022/10/20/2022-10-20-08-58-56.png" alt="" /></li>
|
||||
<li>通过映射的端口访问安装界面(一定要通过最终访问的页面进行安装,否则修改配置比较麻烦。如最终是域名访问,就先把域名解析代理等先配置好,再通过域名访问安装)。</li>
|
||||
</ul>
|
||||
<h4 id="配置"><a class="anchor" href="#配置">#</a> 配置</h4>
|
||||
<ul>
|
||||
<li>如需使用 https 访问,需要在 wp-config.php 中加入以下代码,否则资源文件无法访问。</li>
|
||||
</ul>
|
||||
<pre><code class="language-php">if((!empty( $_SERVER['HTTP_X_FORWARDED_HOST'])) || (!empty( $_SERVER['HTTP_X_FORWARDED_FOR'])) ) &#123;
|
||||
$_SERVER['HTTP_HOST'] = $_SERVER['HTTP_X_FORWARDED_HOST'];
|
||||
$_SERVER['HTTPS'] = 'on';
|
||||
&#125;
|
||||
</code></pre>
|
||||
<ul>
|
||||
<li>后台安装插件时如果跳转到 ftp 配置,则需要在 wp-config.php 中加入以下代码,并到 wp-content 目录下创建 tmp 目录,最后还需要给 tmp 目录赋予读写权限。</li>
|
||||
</ul>
|
||||
<pre><code class="language-php">define('WP_TEMP_DIR', ABSPATH.'wp-content/tmp');
|
||||
define('FS_METHOD', 'direct');
|
||||
define('FS_CHMOD_DIR', 0777);
|
||||
define('FS_CHMOD_FILE', 0777);
|
||||
</code></pre>
|
||||
<ul>
|
||||
<li>目录和文件所有者、组会自动变为 root,目前我是通过访问页面时通过命令修正。暂时未发现问题,如果不行则只能通过定时任务来定时修正了。需要在 wp-config.php 中加入以下代码。</li>
|
||||
</ul>
|
||||
<pre><code class="language-php">chown('/var/www/html', 'www-data');
|
||||
chgrp('/var/www/html', 'www-data');
|
||||
chmod('/var/www/html/wp-content/plugins', 0777);
|
||||
chmod('/var/www/html/wp-content/themes', 0777);
|
||||
chmod('/var/www/html/wp-content/tmp', 0777);
|
||||
</code></pre>
|
||||
<ul>
|
||||
<li>隐藏后台访问需要在 wp-login.php 中加入以下代码,key、value 和 https://www.xxx.com/ 需要修改为自己的。修改后只能通过 https://www.xxx.com/wp-login.php?key=value 访问,其它访问需要登录的页面都会跳转到配置的 https://www.xxx.com/ 地址。</li>
|
||||
</ul>
|
||||
<pre><code class="language-php">if($_GET['key'] != 'value') &#123;
|
||||
header('Location: https://www.xxx.com/');
|
||||
&#125;
|
||||
</code></pre>
|
||||
</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 &#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>
|
||||
|
Reference in New Issue
Block a user