<?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>CDN 归档 - 初晴神社</title>
	<atom:link href="https://vki.cc/tag/cdn/feed/" rel="self" type="application/rss+xml" />
	<link>https://vki.cc/tag/cdn/</link>
	<description>白露的博客</description>
	<lastBuildDate>Fri, 02 Apr 2021 10:34:04 +0000</lastBuildDate>
	<language>zh-Hans</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1</generator>

<image>
	<url>https://cdn.vki.cc/wp-content/uploads/2018/03/cropped-icemaplen-1-32x32.png</url>
	<title>CDN 归档 - 初晴神社</title>
	<link>https://vki.cc/tag/cdn/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>网站迁移笔记</title>
		<link>https://vki.cc/greattruth/experience/819/</link>
					<comments>https://vki.cc/greattruth/experience/819/#respond</comments>
		
		<dc:creator><![CDATA[白露]]></dc:creator>
		<pubDate>Fri, 02 Apr 2021 04:23:27 +0000</pubDate>
				<category><![CDATA[咸鱼心得]]></category>
		<category><![CDATA[朝闻道]]></category>
		<category><![CDATA[CDN]]></category>
		<category><![CDATA[Nginx]]></category>
		<category><![CDATA[WordPress]]></category>
		<guid isPermaLink="false">https://vki.cc/?p=819</guid>

					<description><![CDATA[<p>为了网站访问速度以及之后展示摄影照片，近期把服务器从香港迁移到了上海。过程中踩了不少坑，以此来记录一下。 运行环境 网站基于WordPress搭建，WordPress需要PHP，MySQL以及Apache（或者Nginx）。 旧服务&#8230;</p>
<p><a href="https://vki.cc/greattruth/experience/819/">网站迁移笔记</a>最先出现在<a href="https://vki.cc">初晴神社</a>。</p>
]]></description>
										<content:encoded><![CDATA[
<pre class="wp-block-preformatted">为了网站访问速度以及之后展示摄影照片，近期把服务器从香港迁移到了上海。过程中踩了不少坑，以此来记录一下。</pre>



<h2 class="wp-block-heading" id="5T9kc"><span id="%e8%bf%90%e8%a1%8c%e7%8e%af%e5%a2%83">运行环境</span></h2>



<p class="has-black-color has-text-color wp-block-paragraph">网站基于WordPress搭建，WordPress需要PHP，MySQL以及Apache（或者Nginx）。</p>



<p class="has-black-color has-text-color wp-block-paragraph">旧服务器使用CentOS加宝塔面板，使用简单方便，堪称傻瓜式操作。。缺点就是占用资源，还会可能出现漏洞，推荐小白或者不喜欢折腾的用户使用。</p>



<figure class="wp-block-table"><table><tbody><tr><td class="has-text-align-center" data-align="center">项目</td><td class="has-text-align-center" data-align="center">旧服务器</td><td class="has-text-align-center" data-align="center">新服务器</td></tr><tr><td class="has-text-align-center" data-align="center">配置</td><td class="has-text-align-center" data-align="center">1C1G30M</td><td class="has-text-align-center" data-align="center">1C2G5M</td></tr><tr><td class="has-text-align-center" data-align="center">系统</td><td class="has-text-align-center" data-align="center">CentOS（BT-Panel）</td><td class="has-text-align-center" data-align="center">Aliyun Linux 2.19.03</td></tr><tr><td class="has-text-align-center" data-align="center">地理位置</td><td class="has-text-align-center" data-align="center">香港</td><td class="has-text-align-center" data-align="center">上海</td></tr><tr><td class="has-text-align-center" data-align="center">WordPress</td><td class="has-text-align-center" data-align="center">5.7</td></tr><tr><td class="has-text-align-center" data-align="center">PHP</td><td class="has-text-align-center" data-align="center">7.4</td></tr><tr><td class="has-text-align-center" data-align="center">Nginx</td><td class="has-text-align-center" data-align="center">1.18</td><td class="has-text-align-center" data-align="center">1.16</td></tr><tr><td class="has-text-align-center" data-align="center">MySQL</td><td class="has-text-align-center" data-align="center">MySQL 5.6</td><td class="has-text-align-center" data-align="center">阿里云 云数据库RDS（MySQL 8.0）</td></tr><tr><td class="has-text-align-center" data-align="center">OSS</td><td class="has-text-align-center" data-align="center">阿里云OSS</td></tr><tr><td class="has-text-align-center" data-align="center">CDN</td><td class="has-text-align-center" data-align="center">无</td><td class="has-text-align-center" data-align="center">阿里云CDN/DCDN加速</td></tr></tbody></table><figcaption>对比</figcaption></figure>



<p class="has-black-color has-text-color wp-block-paragraph">相较于旧的，新服务器移除了宝塔面板，系统和服务更加精简，且使用了CDN加速，缺点就是大陆服务器需要备案，一套流程走下来费时费力。。</p>



<h2 class="wp-block-heading" id="LJiw8"><span id="%e5%ae%89%e8%a3%85nginx">安装Nginx</span></h2>



<p class="has-black-color has-text-color wp-block-paragraph">注意：以下内容基于Aliyun Linux系统，不过CenOS应该也能用。</p>



<p class="has-black-color has-text-color wp-block-paragraph">老规矩，先更新软件。</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">yum update</pre>



<p class="has-black-color has-text-color wp-block-paragraph">自带的yum源就有nginx，直接安装即可。</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">yum -y install nginx</pre>



<figure class="wp-block-image size-large"><img  fetchpriority="high"  decoding="async"  width="1024"  height="442"  src="https://oss.vki.cc/wp-content/uploads/2021/04/1617359633-20210402-11.png"  alt=""  class="wp-image-843"  title="image.png" ></figure>



<p class="has-black-color has-text-color wp-block-paragraph">安装完成之后使用以下命令添加到开机启动项。</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">systemctl enable nginx</pre>



<p class="has-black-color has-text-color wp-block-paragraph">然后启动nginx服务。</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">systemctl start nginx</pre>



<p class="has-black-color has-text-color wp-block-paragraph">其他命令：</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">// 关闭Nginx
systemctl stop nginx

// 重启Nginx
systemctl restart nginx</pre>



<p class="has-black-color has-text-color wp-block-paragraph">启动Nginx之后，打开浏览器，地址栏输入服务器的IP并回车，不出意外就能看到成功安装Nginx的提示了。</p>



<figure class="wp-block-image size-large"><img  decoding="async"  width="602"  height="222"  src="https://oss.vki.cc/wp-content/uploads/2021/04/1617336538-2021-04-02-2.png"  alt=""  class="wp-image-821"  title="image.png" ></figure>



<h2 class="wp-block-heading" id="rMSMx"><span id="%e5%ae%89%e8%a3%85php">安装PHP</span></h2>



<p class="has-black-color has-text-color wp-block-paragraph">这一步稍显麻烦，首先查看是否有适合的php版本：</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">yum list php</pre>



<p class="has-black-color has-text-color wp-block-paragraph">然后发现只有5.4的版本，这肯定是不行的，推荐使用php 7以上。</p>



<figure class="wp-block-image size-large"><img  decoding="async"  width="1038"  height="78"  src="https://oss.vki.cc/wp-content/uploads/2021/04/1617336539-2021-04-02-3.png"  alt=""  class="wp-image-822"  title="image.png" ></figure>



<p class="wp-block-paragraph">安装remi</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm</pre>



<p class="has-black-color has-text-color wp-block-paragraph">重建yum缓存，可以提高检索速度。</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">yum clean all
yum makecache</pre>



<p class="has-black-color has-text-color wp-block-paragraph">进入正题，安装php全家桶。</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">yum install -y php74-php-fpm php74-php-cli php74-php-bcmath php74-php-gd php74-php-json php74-php-mbstring php74-php-mcrypt php74-php-mysqlnd php74-php-opcache php74-php-pdo php74-php-pecl-crypto php74-php-pecl-mcrypt php74-php-pecl-geoip php74-php-recode php74-php-snmp php74-php-soap php74-php-xmll</pre>



<p class="has-black-color has-text-color wp-block-paragraph">注意，这行是安装php7.4的。如果想安装7.3版本，将上述命令中的74替换成73即可。然后</p>



<p class="has-black-color has-text-color wp-block-paragraph">然后开机启动。</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">systemctl enable php74-php-fpm</pre>



<p class="has-black-color has-text-color wp-block-paragraph">启动php服务。</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">systemctl start php74-php-fpm</pre>



<p class="has-black-color has-text-color wp-block-paragraph">这里面最坑的就是php74-php-fpm这个服务名。。特么的试了好多次才试出来，不知道是不是系统是阿里云的原因。</p>



<p class="has-black-color has-text-color wp-block-paragraph">如果是CentOS，这个服务名应该是php-fpm.service</p>



<h2 class="wp-block-heading" id="KA9tT"><span id="%e9%85%8d%e7%bd%aenginx">配置Nginx</span></h2>



<p class="has-black-color has-text-color wp-block-paragraph">到这一部，已经装好了Nginx和PHP，但是还有一些问题。</p>



<p class="has-black-color has-text-color wp-block-paragraph">新建一个名为info.php的文件，内容如下：</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">&amp;lt;?php 
    phpinfo(); 
?&amp;gt;</pre>



<p class="has-black-color has-text-color wp-block-paragraph">将该文件上传到网站根目录/usr/share/nginx/html，然后使用浏览器打开 服务器IP/info.php ，正常情况下会显示php的详细信息，但是现在会发现浏览器把info.php文件下载下来了。。</p>



<p class="has-black-color has-text-color wp-block-paragraph">原因是Nginx配置错误。</p>



<p class="has-black-color has-text-color wp-block-paragraph">打开nginx的配置文件 /etc/nginx/ngin.conf，里面有如下配置：</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">    server {
        listen       80 default_server;
        listen       [::]:80 default_server;
        server_name  _;
        root         /usr/share/nginx/html;

        # Load configuration files for the default server block.
        include /etc/nginx/default.d/*.conf;

        location / {
        }

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

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



<p class="has-black-color has-text-color wp-block-paragraph">其中root &nbsp; &nbsp; &nbsp; &nbsp; /usr/share/nginx/html; 就是指网站的根目录。</p>



<p class="has-black-color has-text-color wp-block-paragraph">在server { } 区块内添加如下代码：</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">location ~ .*\.php$ {
  fastcgi_pass 127.0.0.1:9000;
  fastcgi_index index.php;
  fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  include fastcgi_params;
  }</pre>



<p class="has-black-color has-text-color wp-block-paragraph">这段代码意思是让php后缀的文件传入后端php服务处理，添加之后重启nginx服务。</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">systemctl restart nginx</pre>



<p class="has-black-color has-text-color wp-block-paragraph">再次访问 IP/info.php，页面也正常显示。</p>



<figure class="wp-block-image size-large"><img  loading="lazy"  decoding="async"  width="1892"  height="762"  src="https://oss.vki.cc/wp-content/uploads/2021/04/1617336540-2021-04-02-4.png"  alt=""  class="wp-image-823"  title="image.png" ></figure>



<p class="has-black-color has-text-color wp-block-paragraph">其中<strong>Loaded Configuration File</strong>是php的配置信息目录，以后修改WordPress的文件上传大小限制会用得到。</p>



<h2 class="wp-block-heading" id="Mm4bu"><span id="%e9%85%8d%e7%bd%aemysql%e6%95%b0%e6%8d%ae%e5%ba%93">配置MySQL数据库</span></h2>



<p class="has-black-color has-text-color wp-block-paragraph">为了追求安全和性能，这次不再在本地搭建MySQL，转而使用阿里云的数据库服务。</p>



<p class="has-black-color has-text-color wp-block-paragraph">登录阿里云RDS，创建完用户和数据库之后登陆DMS后台，将备份的sql文件进行导入。</p>



<p class="has-black-color has-text-color wp-block-paragraph">（如果是第一次搭建网站，这一步可以略过）</p>



<figure class="wp-block-image size-large"><img  loading="lazy"  decoding="async"  width="1526"  height="1136"  src="https://oss.vki.cc/wp-content/uploads/2021/04/1617336541-2021-04-02-5.png"  alt=""  class="wp-image-824"  title="image.png" ></figure>



<p class="has-black-color has-text-color wp-block-paragraph">如果新网站的域名和旧的不一样，或者域名还未解析（比如我的还在备案，无法解析到大陆服务器），就要手动改一下数据库里存储的网站地址，不然打开新网站会自动跳转到旧网站。</p>



<p class="has-black-color has-text-color wp-block-paragraph">在DMS后台使用以下命令查询：</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">SELECT * FROM `wp_options`</pre>



<figure class="wp-block-image size-large"><img  loading="lazy"  decoding="async"  width="1818"  height="690"  src="https://oss.vki.cc/wp-content/uploads/2021/04/1617336542-2021-04-02-6.png"  alt=""  class="wp-image-825"  title="image.png" ></figure>



<p class="has-black-color has-text-color wp-block-paragraph">点击开启编辑，将siteurl和home字段改为新的服务器地址。</p>



<p class="has-black-color has-text-color wp-block-paragraph">如果用的其他数据库管理a系统没有可视化界面，也可以使用命令行修改：</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">UPDATE `数据库名`.`wp_options` SET `option_value`='新网站地址' WHERE `option_id`=1;
UPDATE `数据库名`.`wp_options` SET `option_value`='新网站地址' WHERE `option_id`=2;</pre>



<p class="has-black-color has-text-color wp-block-paragraph">另外记得将服务器IP地址加入白名单，否则无法访问。</p>



<figure class="wp-block-image size-large"><img  loading="lazy"  decoding="async"  width="1050"  height="1372"  src="https://oss.vki.cc/wp-content/uploads/2021/04/1617336543-2021-04-02-7.png"  alt=""  class="wp-image-826"  title="image.png" ></figure>



<p class="wp-block-paragraph">设置完毕之后可以在服务器上ping一下数据库地址，如果能ping通，代表能正常访问。</p>



<h2 class="wp-block-heading" id="kQrsJ"><span id="%e5%af%bc%e5%85%a5wordpress">导入WordPress</span></h2>



<p class="has-black-color has-text-color wp-block-paragraph">打开备份好的WordPress目录里的wp-config.php文件，修改数据库配置。</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define( 'DB_NAME', '数据库名' );

/** MySQL database username */
define( 'DB_USER', '用户名' );

/** MySQL database password */
define( 'DB_PASSWORD', '密码' );

/** MySQL hostname */
define( 'DB_HOST', '数据库地址' );

/** Database Charset to use in creating database tables. */
define( 'DB_CHARSET', 'utf8mb4' );

/** The Database Collate type. Don't change this if in doubt. */
define( 'DB_COLLATE', '' );</pre>



<p class="has-black-color has-text-color wp-block-paragraph">然后将所有文件上传到服务器根目录。</p>



<p class="has-black-color has-text-color wp-block-paragraph">（如果是第一次搭建网站，直接使用WordPress官网下载的文件即可）</p>



<p class="has-black-color has-text-color wp-block-paragraph">上传完毕后使用浏览器打开网址，可能会出现403错误，这个时候需要继续修改nginx配置。</p>



<p class="has-black-color has-text-color wp-block-paragraph">打开nginx.conf，在location / {&nbsp;} 区块内添加代码如下：</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">location / {
    index index.php index.html index.htm;
}</pre>



<p class="has-black-color has-text-color wp-block-paragraph">然后重启nginx，再次打开网址就正常了。</p>



<p class="has-black-color has-text-color wp-block-paragraph">如果什么都看不到，可能是数据库配置出了问题，建议删除网站根目录的wp-config.php文件，重新打开网址一步步配置。</p>



<h2 class="wp-block-heading" id="RW7LU"><span id="%e5%85%b6%e4%bb%96%e7%9a%84%e5%9d%91">其他的坑</span></h2>



<p class="has-vivid-red-color has-text-color wp-block-paragraph">WordPress-设置-固定链接只能只用朴素类型，其他其他的类型时打开文章或分类出现403，404错误。</p>



<p class="has-black-color has-text-color wp-block-paragraph">这个也是因为nginx配置问题，</p>



<p class="has-black-color has-text-color wp-block-paragraph">打开nginx.conf，在location / {&nbsp;} 区块内添加代码如下：</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">location / {
    index index.php index.html index.htm;
  try_files $uri $uri/ /index.php?$args;
}</pre>



<p class="has-black-color has-text-color wp-block-paragraph">然后重启nginx就可以了。</p>



<p class="has-vivid-red-color has-text-color wp-block-paragraph">更新插件/系统或上传文件提示没有权限，要输入FTP账号。</p>



<p class="has-black-color has-text-color wp-block-paragraph">这个就更坑了。。本质上是Linux系统的权限问题，WordPress没有访问自身文件夹的权限，解决方法有两个：</p>



<p class="has-black-color has-text-color wp-block-paragraph">1.将网站根目录权限改为777；</p>



<p class="has-black-color has-text-color wp-block-paragraph">网上很多教程都是这么建议的，讲道理，但凡有点安全方面的尝试，就不会这么做。</p>



<p class="has-black-color has-text-color wp-block-paragraph">2.创建FTP服务和账号；</p>



<p class="has-black-color has-text-color wp-block-paragraph">这个可以用，但是太麻烦了。。</p>



<p class="has-black-color has-text-color wp-block-paragraph">2.将网站根目录所有者改为WordPress</p>



<p class="has-black-color has-text-color wp-block-paragraph">简单好用，就它了。蛋疼的事情来了，我需要知道WordPress的user名是什么，但这个user名既不是WordPress又不是root，更不是nginx，也不是网上说的www，www-data。</p>



<p class="has-black-color has-text-color wp-block-paragraph">最终试了一圈，嘿！居然是 apache</p>



<p class="has-black-color has-text-color wp-block-paragraph">apache？？？我不是用的nginx吗？？</p>



<p class="has-black-color has-text-color wp-block-paragraph">结果就是，使用chown命令赋予权限。</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">chown -R apache:apache 网站根目录</pre>



<p class="wp-block-paragraph">设置完成后可使用ll命令查看：</p>



<figure class="wp-block-image size-large"><img  loading="lazy"  decoding="async"  width="1032"  height="534"  src="https://oss.vki.cc/wp-content/uploads/2021/04/1617336544-2021-04-02-8.png"  alt=""  class="wp-image-827"  title="image.png" ></figure>



<p class="has-vivid-red-color has-text-color wp-block-paragraph">​使用www.域名方式访问网站报403错误</p>



<p class="has-black-color has-text-color wp-block-paragraph">比如我的网站域名是 vki.cc，本意是想使用 www.vki.cc 也能访问网站。于是在域名解析那里使用 cname 将 www.vki.cc 指向 vki.cc，就有了403错误。</p>



<p class="has-black-color has-text-color wp-block-paragraph">尝试了下，将解析方式改为A记录指向服务器IP就能访问了。</p>



<p class="has-black-color has-text-color wp-block-paragraph">虽然可能造成CDN无法加速，不过问题不大。</p>



<p class="has-vivid-red-color has-text-color wp-block-paragraph">主机记录为@时，记录类型 cname 与邮箱解析 MX 冲突</p>



<p class="has-black-color has-text-color wp-block-paragraph">​换句话说，如果我使用CDN服务，就不能同时<strong>以 vki.cc 访问网站</strong>和<strong>使用 vki.cc 域名邮箱</strong>。</p>



<p class="has-black-color has-text-color wp-block-paragraph">这是我没有料到的，以前没有用CDN的时候，域名直接A记录指向服务器IP，同时使用域名邮箱没有问题。现在这两个冲突，只能选一个，只好放弃邮箱了Orz</p>



<p class="has-black-color has-text-color wp-block-paragraph">搜了一下，有些域名服务商使用link表什么的骚操作可以避免冲突，不过我邮箱用得少，而且转出域名太麻烦，就懒得折腾了，有兴趣可以了解下。</p>



<h2 class="wp-block-heading" id="2luDB"><span id="cdn%e5%8a%a0%e9%80%9f">CDN加速</span></h2>



<p class="wp-block-paragraph">这个有空写个文章详细说，先放两张结构图吧，一个前，一个后。</p>



<p class="wp-block-paragraph"><strong>未使用CDN</strong></p>



<figure class="wp-block-image size-large"><img  loading="lazy"  decoding="async"  width="746"  height="361"  src="https://oss.vki.cc/wp-content/uploads/2021/04/1617336545-2021-04-02-9.png"  alt=""  class="wp-image-828"  title="image.png" ></figure>



<p class="wp-block-paragraph"><strong>使用CDN</strong></p>



<figure class="wp-block-image size-large"><img  loading="lazy"  decoding="async"  width="1440"  height="726"  src="https://oss.vki.cc/wp-content/uploads/2021/04/1617336546-2021-04-02-10.png"  alt=""  class="wp-image-829"  title="image.png" ></figure>
<p><a href="https://vki.cc/greattruth/experience/819/">网站迁移笔记</a>最先出现在<a href="https://vki.cc">初晴神社</a>。</p>
]]></content:encoded>
					
					<wfw:commentRss>https://vki.cc/greattruth/experience/819/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
