拖了一个月终于着手并且完成了。其实没有什么难的。但是因为我对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是傻瓜操作,没有怎么弄?这个我也弄了好半天最终解决了,马上再写一篇单独说吧
好啦好啦,到此结束,路人有问题可以在下面留言~
1вин регистрация http://1win07492.help/
Honestly this hits the sweet spot between detail and brevity, no rambling and no shortcuts, and a quick visit to ironfleet kept that going across the related pages, the kind of place that respects your attention without trying to grab it through cheap tactics or attention seeking design choices that get tired fast.
Honestly this hits the sweet spot between detail and brevity, no rambling and no shortcuts, and a quick visit to herongrip kept that going across the related pages, the kind of place that respects your attention without trying to grab it through cheap tactics or attention seeking design choices that get tired fast.
This is a perfect example of how to write an accessible and useful article. The clear formatting and completely neutral tone made it an absolute pleasure to read through today.
fastest withdrawal online casino canada
cum depun pe mostbet https://www.mostbet19438.help
Worth pointing out that the writer made the topic feel more interesting than I had been expecting, and a look at thoughtfuldesigncollective 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.
Such writing is increasingly rare and worth supporting through attention, and a stop at gullgoal 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.
Solid post, the structure is easy to follow and the language stays simple even when the topic gets a bit more involved, and a look at freshcartoptions kept that same standard going, so I left feeling like the time spent here was actually worth something for once which is rare lately.
Reading this on a difficult day was a small bright spot, and a stop at foilgenie extended that brightness, content that improves a hard day is content that has earned a particular kind of place in my reading habits and this site is occupying that uplifting role for me today which I appreciate clearly.
Different feel from the algorithmically optimised posts that dominate the topic, and a stop at gapkraft reinforced that human touch, you can tell when a site is being run by someone who reads what they publish versus someone just hitting submit and moving on quickly to the next assignment without checking the result.
Now feeling confident that this site will continue producing work I will want to read, and a look at tirqano extended that confidence into the future, projecting forward from current quality to expected future quality is something I do for sites I genuinely follow and this one has earned that forward looking trust clearly today.
Once I had read three posts the editorial pattern was clear, and a look at shopvato confirmed the pattern from a fourth angle, sites where the underlying approach reveals itself through accumulated reading rather than being announced are sites with real depth and this one has that quality clearly visible across multiple pieces consistently.
High quality writing, no marketing speak and no buzzwords that mean nothing, and a stop at buymixo kept that going, simple direct content that actually communicates something is harder to find than it should be and this is one of the rare places that gets it right consistently across many different posts.
A clear case of writing that does not try to do too much in one post, and a look at fairvendor maintained the same scoped discipline, posts that try to cover too much end up covering nothing well and this site has clearly chosen scope discipline as a core editorial principle which shows up clearly in what I read.
Reading this in a quiet hour and finding it suited the quiet, and a stop at feltglen extended the quiet reading mood, content that matches its own optimal reading conditions rather than fighting them is content that has been thoughtfully calibrated and this site reads as having a particular reading mood in mind throughout.
Came in skeptical and left mostly convinced, that is the highest praise I can offer, and a look at lovqaro pushed me further in the same direction, content that survives a critical first read is rare and worth recognising because most blog posts crumble under any real scrutiny these days when you actually pay attention closely.
Reading the writers other posts after this one suggests the quality is consistent rather than peak, and a stop at kalqavo confirmed the consistent quality reading, sites that hold the same level across many pieces rather than peaking on a few are sites with sustainable editorial discipline and this one has clearly developed that.
Reading this on a slow Sunday and finding it perfectly suited to a slow Sunday read, and a quick stop at gullgoal kept the same gentle pace, content that fits the mood of the moment is something I notice and remember and this site has the kind of pace that suits relaxed reading sessions especially well.
Liked the post enough to read it twice and the second read found new things, and a stop at thoughtfuldesigncollective similarly rewarded the second look, content with hidden depths that only reveal themselves on careful rereading is the rare kind that earns lasting respect rather than fleeting first impressions only briefly held.
Top tier post, the kind that makes you want to share the link with friends working in the same area, and a stop at urbantix only made me more confident in doing that, this site is one of the better resources I have seen on the topic recently across both new and older posts.
Most of my reading time goes to a small number of trusted sources and this one is now joining that group, and a stop at morqino reinforced the group membership, the few sites that earn a place in my regular rotation are sites I expect ongoing returns from and this one has earned that elevated position consistently.
I came here looking for a quick answer and ended up reading the whole post because it was actually interesting, and after gapkraft I had a much fuller picture, no stress and no confusion just a clear walk through the topic that made everything fall into place without much effort.
A piece that read smoothly because the writer understood how readers actually move through prose, and a look at qavmizo maintained the same reader awareness, writers who think about the reading experience as much as the writing experience produce better work and this site has clearly made that shift in editorial approach.
I came here looking for a quick answer and ended up reading the whole post because it was actually interesting, and after ironkrill I had a much fuller picture, no stress and no confusion just a clear walk through the topic that made everything fall into place without much effort.
A piece that did not waste any of its substance on sales or promotion, and a look at fashiondailychoice continued that pure content focus, sites that resist the urge to monetise every paragraph are increasingly rare and this one has clearly made the editorial choice to keep the writing clean from commercial intrusion which I value highly.
Loved the writing voice here, friendly without being fake and confident without being arrogant, and a stop at eagerkilt carried the same tone forward, the kind of personality that makes a reader feel welcome rather than lectured at which is a balance plenty of writers struggle to find no matter how long they have been at it.
Speaking honestly this is among the better discoveries of my recent browsing, and a stop at vuznaro reinforced that discovery quality, the ranking of recent discoveries is informal but meaningful and this site has placed near the top of that ranking based on the consistency of quality across what I have already read carefully.
However selective I am about new bookmarks this one made it past my filter, and a look at shopvato confirmed the bookmark was worth the slot, the precious slots in my permanent bookmark folder are difficult to earn and this site earned one without making me think twice about whether the slot was justified by the quality.
Reading this in the gap between work projects was a small but meaningful break, and a stop at lovqaro extended that gentle reset, content that provides genuine refreshment rather than just distraction during work breaks is content with a particular kind of utility and this site fits that role for me reliably during work days.
Considered as a whole this site has developed a coherent point of view that comes through in individual pieces, and a look at foilgenie continued displaying that coherence, sites with a unified perspective rather than a grab bag of takes are sites with editorial maturity and this one has clearly developed that maturity through years of work.
The way the post stayed on topic throughout without going on tangents was really refreshing, and a look at heronhilt kept that focused approach going, discipline like this in writing is rare and worth recognising because most writers cannot resist wandering off into related subjects that dilute their main point and confuse readers along the way.
Came in skeptical of the angle and left mostly persuaded, and a stop at dailyshoppinghub pushed me a bit further in the same direction, content that can move a critical reader by argument rather than rhetoric is rare and worth pointing out because it indicates real substance underneath the surface presentation here.
Reading this between two meetings turned out to be the highlight of the morning, and a stop at kalqavo continued that highlight quality, content that outshines the structured parts of a working day is doing something well beyond ordinary and this site has produced multiple such highlights for me already this week alone.
Worth marking this site as one to come back to deliberately rather than by accident, and a stop at mexvoro reinforced that intention, the difference between sites I find again by chance and sites I return to on purpose is meaningful and this one has clearly moved into the deliberate return category for me.
Glad the writer kept this short rather than padding it out, the points stand on their own without needing extra context, and a look at urbantix kept the same approach going, brevity is a sign of confidence in the substance and the team here clearly trusts their content to land without filler.
Got pulled in by the headline and stayed because the content actually delivered on the promise, and a stop at buyrova kept that trust intact, when a site lives up to its own framing it earns the right to keep showing up in my browser tabs going forward indefinitely from here on out really.
Glad I gave this fifteen minutes rather than the usual three minute skim, and a look at ironkrill earned the same investment, time spent on quality content is rarely wasted but the reverse is also true and learning which sites deserve which kind of attention is part of being a careful online reader.
Felt like the writer was speaking directly to someone with my level of curiosity, neither talking down nor showing off, and a stop at fashiondailychoice kept that comfortable matching going, finding writing that meets you where you are rather than asking you to climb up or stoop down feels great every time it happens.
A piece that handled a controversial angle without becoming heated, and a look at vuznaro continued that calm engagement, content that can address contested topics without inflaming them is doing rare diplomatic work and this site has clearly developed the editorial maturity to handle sensitive material with the appropriate temperature of writing throughout.
Genuine reaction is that I will probably think about this on and off for a few days, and a look at wavevendor added fuel to that, the best content lingers in your head after you close the tab rather than evaporating immediately and this site clearly knows how to write that kind of memorable content.
I learned more from this short post than from longer articles I read earlier today, and a stop at tirvaxo added even more useful detail without going off topic, this site clearly knows how to keep things focused without sacrificing depth which is a hard balance to strike for any writer.
Bookmark added in three places to make sure I do not lose the link, and a look at dailyshoppinghub got the same redundant treatment, sites I am afraid to lose are the rare keepers and this is clearly one of them based on what I have read so far across this and a couple of related posts.
Probably one of the more reliable sources I have found for this kind of careful coverage, and a look at gullkindle reinforced the reliability, the small group of sources I would describe as reliable for a given topic is curated carefully and this site has earned a place in that small group through consistent performance.
The way the post stayed on topic throughout without going on tangents was really refreshing, and a look at heronhilt kept that focused approach going, discipline like this in writing is rare and worth recognising because most writers cannot resist wandering off into related subjects that dilute their main point and confuse readers along the way.
Skipped the social share buttons but might come back to actually use one later, and a stop at buyrova extended that share urge, content that triggers genuine sharing impulses rather than performative ones is content that has actually moved me and not many posts in a typical week do that for me actually.
Just want to say thank you for putting this together, posts like these make searching online actually worth it sometimes, and a quick look at gaussfawn kept that going, useful and easy to read without any of the tricks that ruin most blog comment sections lately on the wider open web.
Picked up a couple of new ideas here that I can actually try out, and after my visit to morqino I have even more notes saved, this is the kind of resource that pays you back for the time you spend on it which is rare to come across in this corner of the web.
Liked that there was nothing performative about the writing, and a stop at festglade continued that genuine quality, performative writing tries to be witnessed rather than read and the difference between performance and substance is huge for the careful reader and this site has clearly chosen substance every time clearly.
The post made the topic feel approachable without making it feel trivial, that is a fine balance, and a stop at qavmizo maintained the same balance, finding the middle ground between welcoming and serious is genuinely difficult and the writers here have clearly figured out how to consistently hit it well across many different posts.
Thanks for putting this online without locking it behind email signups or paywalls, and a quick visit to mexvoro 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.