拖了一个月终于着手并且完成了。其实没有什么难的。但是因为我对Linux的了解非常局限,还是花了一番功夫,同时学了很多东西,在这里记一下。没有试图写一篇“手把手教你搬WP”,只是记录一些我觉得有帮助的东西,希望做同样的事情的且同样不是那么牛逼的Linux学习者们有用:)
虽说是WordPress搬家,但是任何一个小型网站搬家都差不多这样了吧,嘿嘿。
如果用cPanel和MySQLAdmin之类的东西可能就很傻瓜,但是第一cPanel太贵了(竟然要425多刀一年,我都笑了),第二VPS都买了必须必须要抓住每一个学Linux的机会啊。
过程如下(断断续续弄了好几天…):
环境
虚拟主机和VPS都是host2ez的,最牛逼的主机提供商。系统是CentOS Linux 5.6,apache(现在改名叫httpd)已经装好了,再装
yum php mysql mysql-server
就成。
文件
这个简单,cPanel把虚拟主机上文件打包,VPS上wget下来就好。WP的独立性做的好,文件路径改变不会有什么问题。备份用的插件BackUpWordpress倒因为出问题了,不能识别路径,我直接禁用掉了,VPS嘛马上弄个备份方案还不容易,不需要用WP的插件了。在[wordpress path]/wp_config.php里把信息改一下,数据库部分的怎么改见下面。
数据库
对数据库命令不了解的同学建议先看一下mysql的教程。我不能把所有操作都写出来…这次弄这个还学了不少数据库的东西…tutorial很容易搜到,我觉得有一个比较好的命令列表点 这里,里面包括了所有常用的命令。
在虚拟主机的cPanel – mysqladmin里备份出.sql文件,传上VPS,导入文件的命令是
mysql – u user_name -p database_name < file_name.sql
很多地方写的-p后面跟密码,我用的版本-p后面不跟东西,回车以后才提示输密码,可能是新版本不提倡显式输入密码了吧。非要用的话就–password=”xxxxxx”
如果你导出文件选的是整个mysql,需要打开文件把database”information_schema”部分删掉,否则会失败,这个db貌似是mysql自己的,不能改..不懂
之后要建立一个用户并给此用户分配使用相应db的权限,虽然我们也可以直接把root用户写进wp_config.php但是稍微有点安全意识的程序员都不会想要这么做的…虽然权限没什么大不了的,但是名字叫root就是不行! 所以进数据库:
mysql -u root -p
进去以后添加用户:
mysql> create user 'username'@'localhost' identified by 'mypass';
分配权限:
mysql> grant all privileges on databasename.* to username@localhost; mysql> flush privileges;
然后就把这个用户甩给Wordpress啦(编辑wp_config.php)
测试的时候有一些问题
上面完了就能http进vps的ip看到博客了,但是不要去点任何东西…因为数据库里“本站”的地址还是原来的域名,这样如果你原来的网站还开着那么随便点个链接就进到原来网站了,如果没开那就can’t find page啦。
而且因为没法进后台改,所以只好进mysql改了
mysql> use viaxlcom_viaxlcom; mysql> select * from wp_options where option_value rlike "^http"; +-----------+---------+-------------+----------------------------+----------+| option_id | blog_id | option_name | option_value | autoload | +-----------+---------+-------------+----------------------------+----------+ | 2 | 0 | siteurl | http://axlarts.com/blog | yes | | 39 | 0 | home | http://axlarts.com | yes | | 41 | 0 | ping_sites | http://rpc.pingomatic.com/ | yes | +-----------+---------+-------------+----------------------------+----------+ 3 rows in set (0.06 sec) update wp_options set option_value="http://12.34.56.78/blog" where option_id=2; update wp_options set option_value="http://12.34.56.78" where option_id=39;
这样就把VPS上的网站地址改成本身的IP了。
————————————-
另外我发现一些插件会出现权限问题,比如JW player(放flv视频用的插件),没法启用插件因为提示不能写目录,我整个www目录都是755权限,设置成777以后可以开启了,然后再弄回来。这个问题解决了但是原因一直不知道,直到我因为另一个问题搜了一下才搞明白。
另一个问题是:更新插件update的时候会提示我输入ftp帐号,以前没这事啊,于是我就去装了个vsftpd(ftp的服务端),设置好能更新了,但是为什么?后来搜到这篇文章 <Auto Update WordPress Without FTP> 解决了ftp的问题并且意识到上面的问题也和这个有关系,即因为目录的owner不是httpd,所以网站脚本没有对文件操作的权限。
/var/www目录的owner要设置成httpd的运行者(可以用ps aux或者top命令查看),可能是www,apache或者nobody或者其他的。我的是apache,所以在chown apache:apache /var/www -R之后update就不用输ftp了,我立刻关了vsftpd依然ok,可见之前是绕了弯子了,没权限还用ftp操作文件…
绑域名
进godaddy面板直接改A地址就好了,没有别的要操作的。
但是因为我本来虚拟主机上就放了两个网站,所以怎么在一个VPS上绑定多个域名多个网站?之前用cPanel是傻瓜操作,没有怎么弄?这个我也弄了好半天最终解决了,马上再写一篇单独说吧
好啦好啦,到此结束,路人有问题可以在下面留言~
Probably the kind of site that should be more widely read than it appears to be, and a look at solostarlit reinforced that quiet wish, the gap between a sites quality and its apparent reach is sometimes large and that gap exists for this site in a way that makes me want to mention it more.
Thanks for putting this online without locking it behind email signups or paywalls, and a quick visit to solidvector kept that open feel going, content that trusts the reader to come back rather than gating access is the kind of approach I will reward with regular return visits over time happily.
Came in expecting another generic take and got something with actual character instead, and a look at tractshade carried that personality forward, finding a distinct voice on a saturated topic is impressive and worth pointing out when it happens because most sites end up sounding identical to their nearest competitors quickly.
My usual pattern is to skim and bounce but this site has reset that pattern temporarily, and a stop at solacevelour maintained the slower reading mode, content that changes how I read is content with structural influence and this site has clearly nudged my reading behaviour toward something better at least for the duration of these visits.
Worth saying that this is one of the better things I have read on the topic in months, and a stop at logicllama reinforced that ranking, the topic is well covered by many sources but few do it with this level of care and the few that do deserve to be flagged so other readers can find them.
Reading this confirmed a small detail I had been uncertain about, and a stop at suburbsurge provided the source for further checking, content that supports verification through citations or links rather than just asserting facts is more trustworthy and this site has clearly built its credibility through that kind of verifiable approach consistently.
Considered alongside other sources I have been reading this one consistently rises to the top, and a stop at studiosalute maintained that top ranking, the informal ongoing comparison between sources is something I do whenever reading on a topic and this site keeps coming out near the top of those comparisons over many sessions.
Skipped to a specific section because I knew that was the question I had, and the answer was clean, and a stop at relqano similarly delivered targeted answers without burying them, content engineered for readers who arrive with specific needs rather than open ended browsing is increasingly valuable in a search heavy reading environment.
Worth pointing out that the post avoided the temptation to summarise everything at the end, and a look at tulipsedan continued that confident closing approach, content that trusts readers to retain the substance without being reminded of it at the end is content that respects the reader and this site practices that respect.
Looking back on this reading session it stands as one of the better ones recently, and a look at shrinetender extended that ranking, the informal ranking of reading sessions against each other is something I do mentally and this session ranks high largely because of this site and a couple of related pages here.
Most attempts at writing on this topic feel like they are missing something and this post finally identified what was missing, and a look at silovault extended that diagnostic clarity, content that names what is wrong with adjacent treatments while doing better itself is content with both critical and constructive value and this site has both.
Recommended to anyone working in or curious about this area, the depth and clarity combine well, and a look at sparkcast keeps that going across more pages, the kind of site that earns regular visits rather than chasing trends has my respect because it suggests genuine commitment to the topic itself rather than to chasing trends.
Felt mildly happier after reading, which sounds silly but is true, and a look at solacevelour extended that small mood lift, content that improves rather than degrades my mental state is content I want more of and the cumulative effect of reading sites that lift versus sites that drag is real over time.
Well done, the writing is professional without being stiff, and the topic is treated with care, and a look at logicllama reflected that approach, the kind of site I would point a colleague to if they asked for a reliable starting point on this topic in the future without any hesitation at all.
Worth pointing out that the writer made the topic feel more interesting than I had been expecting, and a look at draftlog continued that elevation effect, content that improves the apparent quality of its subject through skilled treatment is doing something real and this site has clearly developed that kind of editorial alchemy throughout.
Now planning a longer reading session for the archives, and a stop at sheentiny confirmed the archives are worth that longer commitment, sites with archives I want to read deliberately rather than just sample are rare and this one has clearly earned that level of interest based on the consistency of what I have already read.
Well done, the writing is professional without being stiff, and the topic is treated with care, and a look at studiosalute reflected that approach, the kind of site I would point a colleague to if they asked for a reliable starting point on this topic in the future without any hesitation at all.
Reading this felt easy in the best way, no friction and no confusion at any point, and a stop at qalmizo carried that same comfort across more pages, the kind of editorial flow that lets you absorb information without fighting the format which is increasingly hard to find on the open web today across topics.
Compared to the usual results for this kind of search this site stands well above the average, and a quick visit to mauvepeach kept the standard high, you can tell within seconds whether a site is going to waste your time or actually deliver and this one clearly delivers without any false starts.
Refreshing change from the usual sites covering this topic, no clickbait and no padding, and a stop at muscatneedle confirmed the difference, this place clearly has its own voice rather than copying the formulas everyone else uses to chase clicks online which is becoming increasingly rare these days across nearly every popular subject.
Well done, the writing is professional without being stiff, and the topic is treated with care, and a look at tyrantvolume reflected that approach, the kind of site I would point a colleague to if they asked for a reliable starting point on this topic in the future without any hesitation at all.
Felt like the post had been edited rather than just drafted and published, and a stop at shadowtrojan suggested the same care across the site, the difference between edited and unedited content is enormous for the reader and this site has clearly invested in the editing pass that most blogs skip entirely which really does show up.
Really appreciate this kind of writing, no shouting and no clickbait headlines just steady useful content, and a quick look at temposofa kept that going, definitely a site I will be returning to whenever I need a sensible take on similar topics in the days ahead and also during slower work weeks.
A piece that left me thinking I had been undercaring about the topic, and a look at relqano reinforced that mild concern, content that raises the appropriate weight of a subject without being preachy about it is doing important work and this site is providing that gentle elevation of attention for me consistently.
Now thinking about this site as a small example of what good independent writing looks like, and a stop at draftlog continued that exemplary status, the few sites that serve as good examples are sites worth holding up in conversations about quality and this one has earned that exemplary placement through patient consistent effort over time.
Now wishing I had found this site sooner, and a look at sheentiny extended that mild regret, the calculation of how many years of good content I missed by not finding the right sources earlier is one I try not to make too often but it does come up sometimes when I find sites this good.
Reading this with a fresh mind in the morning brought out details I might have missed in the afternoon, and a stop at tigerteacup earned the same fresh attention, content that rewards being read at full attention rather than at energy lows is content with real density and this site has that density consistently.
Worth your time, that is the simplest endorsement I can give, and a stop at voguestrait extends that endorsement across the rest of the site, this is one of those increasingly rare places that delivers on what it promises rather than over selling the content and under delivering on substance every time which I find frustrating elsewhere.
Solid value for anyone willing to read carefully, and a look at silovault extends that value across the rest of the site, this is the kind of place that rewards return visits rather than offering everything in a single splashy post and then leaving readers nothing to come back for later which is unfortunately common.
Such writing is increasingly rare and worth supporting through attention, and a stop at thatchvista extended that supportive attention across more pages, the conscious choice to spend time on sites that produce careful work rather than convenient consumption is itself a small form of patronage and this site is receiving that conscious patronage from me.
Speaking carefully because I do not want to overstate things this site is genuinely above average across multiple measurements, and a stop at muscatneedle continued the above average performance, the calibration of judgement against potential overstatement is something I take seriously and this site clears the higher bar even after that calibration applies.
Once you start reading carefully here it is hard to go back to lower quality alternatives, and a stop at tyrantvolume reinforced that ratchet effect, the way good content raises standards is real over time and this site has clearly contributed to raising my expectations for what is possible in writing on the topic generally.
Comfortable reading experience throughout, no jarring tone shifts and no awkward formatting, and a look at loneload kept that smooth feel going, the kind of editorial polish that goes unnoticed when present but glaring when absent is something this site has clearly invested in across the broader content as well which deserves recognition.
A piece that did not try to be timeless and ended up reading as durable anyway, and a look at simbasienna extended that durable feel, content that stays useful past its publication date without straining for permanence is content that ages well and this site has the kind of evergreen quality that I value highly today.
Started this morning and finished at lunch with a small sense of having spent the time well, and a look at shadowtrojan extended that satisfaction into the afternoon, content that fits naturally into the rhythm of a working day rather than demanding a dedicated reading block is increasingly the kind I prefer.
Just wanted to say this was useful and leave a small note of thanks, and a quick visit to temposofa earned a similar nod from me, the small acknowledgements add up over time and represent the real economy of trust that good content runs on across the open and increasingly fragmented modern internet.
Compared to the usual results for this kind of search this site stands well above the average, and a quick visit to mauvepeach kept the standard high, you can tell within seconds whether a site is going to waste your time or actually deliver and this one clearly delivers without any false starts.
Steam Desktop Authenticator https://sdasteam.com (SDA). It allows you to generate account login codes and automatically confirm trades or item sales on the Community Market without using your smartphone.
Thanks for the readable length, I finished it without checking how much was left, and a stop at tundrasyrup kept me reading the same way, when I stop noticing the length of a piece because the content is engaging enough to sustain attention without willpower the writer has done their job well today.
Appreciate the practical examples, they made the abstract points easier to grasp, and a stop at tigerteacup added more of the same, this site clearly understands that real examples beat empty theory every single time which is the mark of a writer who knows their audience well and respects their time.
Now planning to come back when I have the right kind of attention to read carefully, and a stop at thatchvista reinforced that plan, choosing the right moment to read certain content is a quiet form of respect for the work and this site is generating those careful planning behaviours from me consistently as a reader.
Now feeling mildly impressed in a way I do not quite remember feeling about a blog in a while, and a stop at loneload extended that mild impression, content that produces specific positive emotional responses rather than just neutral information transfer is content with extra dimensions and this site has those extra dimensions clearly.
Found something new in here that I had not seen explained this way before, and a quick stop at voguestrait expanded the idea even further, the kind of writing that nudges your thinking forward a bit without forcing the issue is exactly what I look for online today and rarely actually find anywhere.
The pacing of the post was just right, never rushed and never dragged out unnecessarily, and a look at tagbyte maintained the same rhythm, you can tell the writer has experience because the difficult skill of pacing is something only practiced writers manage to handle well in long form content over time and across formats.
Saving the link for sure, this one is a keeper, and a look at simbasienna confirmed I should bookmark the entire site rather than just this page, the consistency across what I have seen so far suggests there is a lot more here worth coming back for soon when I have more time.
Now noticing that the post did not mention the writer at all, focus stayed on the topic, and a look at snippetvamp continued that author absent quality, content that disappears the writer to focus on the substance is a particular kind of generosity and this site has clearly chosen the substance over the personality consistently.
Really appreciate this kind of writing, no shouting and no clickbait headlines just steady useful content, and a quick look at draftport kept that going, definitely a site I will be returning to whenever I need a sensible take on similar topics in the days ahead and also during slower work weeks.
A welcome reminder that thoughtful writing still happens online, and a look at selectshare extended that reassurance, the modern web makes it easy to forget that careful writing exists and finding sites that practice it is a small antidote to the cynicism that builds up from too much exposure to algorithmic content.
Just wanted to say this was useful and leave a small note of thanks, and a quick visit to tundrasyrup earned a similar nod from me, the small acknowledgements add up over time and represent the real economy of trust that good content runs on across the open and increasingly fragmented modern internet.
Found the rhythm of the prose particularly enjoyable on this read through, and a look at qalnexo kept that musical quality going across the related pages, sentence rhythm is something most blog writers ignore but it makes a real difference in how content lands with the careful reader who cares.