月度归档:2017年11月

WordPress整站迁移到Hawkhost

我之前的5个网站全放在bluehost,最近转到hawkhost,折腾了一个周日才完成。下面说一下流程,方便后来者

  1. 进入Bluehost后台的Cpanel,file manager,把每个wordpress站的文件全部(compress)压缩成zip格式。下载推荐用网页(例如 http://网站/压缩文件名.zip),比ftp快很多。
  2. 进入Cpanel里面的phpmysql,把对应wordpress的数据库导出(export)成sql格式,备用。(下面基本没有bluehost的事了)
  3. 进入Hawkhost的Cpanel,mysql database, 创建新的数据库和用户名,并关联两者。再进入phpmysql,把第2步的sql导入(import)到新的数据库。
  4. Cpanel,添加域名(我选的是 addon domain,name sever换成hawkhost的,方便设置二级域名),同时会生成该域名对应的文件夹。
  5. Cpanel,file manager,将第1步下载回来的zip文件上传到域名对应目录并extarct(解压缩)。修改根目录下wp-config文件
    define('DB_NAME', 'AAA'); AAA为新站MySQL数据库名
    define('DB_USER', 'BBB'); BBB为新站的数据库用户名
    define('DB_PASSWORD', 'CCC'); CCC为新站数据库密码
    define('DB_HOST', 'DDD'); DDD为数据库主机名,这里填localhost
  6. 检查根目录上的.htaccess 有没有以前的奇怪路径,不懂的话直接删了吧
  7. 理论上,按照我这样操作,只要域名name server成功转移到hawkhost上,wordpress首页和后台就可以访问了。

下面是遇到的一些常见问题:

  1. 域名迁移到hawkhost后,所有域名显示空白页working,或者 显示”ERROR The requested URL could not be retrieved”。
    官网找不到技术支持,然后我意外找到解决方法- 出现这个情况应该是通过hawkhost后台的快捷键添加的addon domain,而且还设置了什么密码。解决方法:删掉这些之前的设置,重新在cpanel添加域名addon domain。一定要在cpanel操作,一定要在cpanel操作,一定要在cpanel操作。
  2. wordpress首页和后台正常,其他页面打不开。解决方法:进入wordpress后台,setting,permalink重新点击一次。
  3. 收不到忘记密码邮件、或收不到 contact form7 来信。我是用网易的域名邮箱,实测gmail却收的到,估计是网易对hawkhost上的wordpress邮件不友好吧。解决方法:进入phpmysql,对应的wordpress数据库的wp-option,里面有一行email改成其他邮箱。另外,把contact form7 里面的邮箱也换成其他邮箱(gmail)。
  4. SSL证书显示不安全。Hawkhost提供了免费的https加密,我有一个站却一直提示“不安全”。解决方法:Cpanel, SSL/TLS status, 选中那几个打红叉的问题网址,再点击Run AutoSSL。

折腾一天才搞懂这些,希望对其他人有帮助。

Blog’s moved to Hawkhost

Thanks to the Black Friday Promotion, I’ve move my blog from Bluehost to Hawkhost.

Our company website and this blog has been hosted at Bluehost for almost 3 years, if you want to ask why I move? Price will be an answer, other thing need to be considered is the access speed.

I live in China, occasionally travel around Asia and USA, from my past experience Bluehost is VERY SLOW in China, slow in Japan, normal in USA. I don’t have time to evaluate the speed of Hawkhost in other countries, but it’s acceptable in China, and that’s enough to me.

Oh, it appears Hawkhost gave this blog a free SSL certificate. It’s a paid service in bluehost!