拖了一个月终于着手并且完成了。其实没有什么难的。但是因为我对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是傻瓜操作,没有怎么弄?这个我也弄了好半天最终解决了,马上再写一篇单独说吧
好啦好啦,到此结束,路人有问题可以在下面留言~
Really clear writing, the kind that makes you want to share the link with someone who has been asking about the topic, and a quick browse through guavahilt only made me more sure of that, the information here stays useful long after the first read is done which says a lot.
A piece that did not try to be timeless and ended up reading as durable anyway, and a look at idleketo 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.
Going to share this with a friend who has been asking the same questions for a while now, and a stop at fawngate added a few more pages I will pass along too, this is the kind of generous information that earns a small thank you from me right now and again later this week.
Going to share this with a friend who has been asking the same questions for a while now, and a stop at herbharp added a few more pages I will pass along too, this is the kind of generous information that earns a small thank you from me right now and again later this week.
A well calibrated piece that knew its scope and stayed inside it, and a look at orchardharborvendorparlor maintained the same scope discipline, scope creep is one of the failure modes of long blog posts and this site has clearly invested in the editorial discipline to prevent it which shows up in tightly contained pieces.
Closed the laptop after this and let the ideas settle for a few hours, and a stop at flintgala similarly rewarded reflective time, content that benefits from sitting with rather than racing past is the kind I want more of and the kind that this site appears to consistently produce week after week here.
Granted my mood today might be elevating my reading experience but I still think this is genuinely good, and a stop at intentionallysourcedgoods reinforced that even discounted assessment, controlling for the mood adjustment that affects content perception this site still reads as substantively above average across multiple pieces I have read carefully today.
My professional context would benefit from having this kind of resource available, and a look at seothread extended the professional applicability, the rare site that contributes meaningfully to professional work rather than just personal interest is content with multiplied value and this one is providing that professional utility consistently across multiple pieces.
Beyond the immediate post itself the editorial sensibility behind the site is what struck me, and a stop at guavahilt continued displaying that sensibility, content that reveals editorial choices through accumulated reading is content with structural quality and this site has clearly developed an underlying approach worth identifying through multiple sessions of reading.
Just enjoyed the experience without needing to think about why, and a look at idleketo kept that effortless feeling going, sometimes the best content is invisible in the sense that you forget you are reading until you reach the end and realise time has passed without you noticing it pass naturally.
Reading this prompted me to dig into a related topic later, and a stop at dealvilo provided some of the starting points for that follow up reading, content that triggers further exploration rather than satisfying curiosity completely is content with real generative energy and this site has plenty of that energy throughout it.
A welcome contrast to the loud takes that have dominated my feed lately, and a look at livzaro extended that calm voice, content that arrives without yelling has become unusual in the modern attention economy and this site is one of the few places I have found that consistently delivers without raising its voice.
Liked how the post handled an objection I was forming as I read, and a stop at gambithusk similarly anticipated where my thinking was going next, the rare writer who can predict reader concerns and address them in advance is doing something most online content fails to do despite that being basic editorial work.
Came away feeling slightly smarter than I was when I started, that is a real win, and a stop at walnutvendor added a bit more to that, the rare site that actually transfers some of its knowledge to the reader in a way that sticks rather than just creating an illusion of learning briefly.
Left me wanting to read more rather than feeling burned out, that is a good sign, and a look at melvizo confirmed there is plenty more here to explore, the kind of writing that builds appetite rather than killing it which is a rare quality on the modern open internet today across most categories of content.
Now adjusting my expectations upward for the topic based on this post, and a stop at discovernewworld continued that bar raising effect, content that resets what I think is possible on a subject is doing real work in shaping my standards and this site is providing those bar raising experiences at a notable rate during sessions.
Now thinking I want more sites built on this kind of editorial foundation, and a stop at flintgala extended that wish into a broader hope, sites built on substance and care rather than on metrics and growth are the kind of sites I want to see more of and this one is a small example worth supporting.
Reading this felt easy in the best way, no friction and no confusion at any point, and a stop at molzino 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.
Now adding this site to a small mental group of recommendations I keep ready for specific kinds of inquiries, and a stop at harborpick extended the recommendation readiness, content that I can confidently point friends and colleagues toward in specific contexts is content with real social utility and this site has that utility clearly.
Now feeling mildly impressed in a way I do not quite remember feeling about a blog in a while, and a stop at tilvexa 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.
Worth flagging that this approach to the topic is fresh without being contrarian, and a stop at urbanmixo extended the same fresh angle, finding original perspective on familiar subjects is rare and this site has clearly developed its own way of seeing rather than echoing the dominant takes from elsewhere consistently.
Well done, the kind of post that makes you slow down and actually read instead of skimming for keywords, and a look at rovnero kept me reading carefully too, that is a sign of writing that has been crafted rather than churned out for an algorithm to see today and tomorrow.
Now planning to share the link with a small group of readers I trust, and a look at venxari suggested more material to share with the same group, recommending content into a curated circle requires confidence in the recommendation and this site is making me confident in those personal recommendations on multiple separate occasions now.
Now appreciating that the post did not require me to agree with the writer to find it valuable, and a look at herbharp maintained the same useful regardless of agreement quality, content that informs even when it does not convince is content with broader utility and this site reads as useful even when I disagree.
Picked this up between two other things I was doing and got drawn in completely, and after qarnexo my original tasks were completely forgotten for a while, content that derails a workflow in a positive way by being more interesting than what you were already doing is rare and worth recognising clearly.
Bookmark earned and folder updated to track this site separately, and a look at seothread confirmed the folder upgrade was the right call, organising my reading list so that good sites do not get lost in a sea of casual bookmarks is something I do more carefully now and this site warranted its own spot.
Such writing is increasingly rare and worth supporting through attention, and a stop at lunarvendor 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.
Thanks for the breakdown, it gave me a clearer picture of something I had been confused about for a while now, and a stop at intentionallysourcedgoods closed the remaining gaps in my understanding nicely, no need to hunt around twenty other articles to put the pieces together which is a real time saver.
Well done, the kind of post that makes you slow down and actually read instead of skimming for keywords, and a look at livzaro kept me reading carefully too, that is a sign of writing that has been crafted rather than churned out for an algorithm to see today and tomorrow.
Reading this site over the past week has changed how I evaluate content in this space, and a look at clipchoice extended that recalibration, the standards I bring to reading on the topic have shifted upward as a direct result of regular exposure to this kind of work and that shift will outlast any single reading session.
Honestly enjoyed reading this more than I expected to when I first clicked through, and a stop at gambithusk kept that pleasant surprise going, sometimes you stumble onto a site that just clicks with how you like to read and this is one of those for me right now today which is great.
Reading this slowly and letting each paragraph land before moving on, and a stop at dealvilo earned the same patient approach, content that rewards slow reading rather than speed is content with real density and the writers here are clearly producing work that benefits from the careful eye rather than the rushed scan.
A piece that left me thinking I had been undercaring about the topic, and a look at discovernewworld 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.
Definitely returning here, that is decided, and a look at boldcartstation only made the case stronger, this is one of those rare websites that rewards regular visits rather than feeling stale after the first read which is something I cannot say about most of the places I bookmark today across all my topics.
Worth every minute of the time spent reading, and a stop at urbanmixo extends that value across more pages, in a media environment where most content is engineered to waste attention this site stands out by treating reader time as something valuable rather than something to be exploited and stretched as far as possible.
Walked away with a clearer head than I had before reading this, and a quick visit to harborpick only sharpened that, the writing has a way of cutting through the noise that surrounds most topics online which is something I will definitely remember the next time I am searching for an answer to anything.
Worth saying that the prose reads naturally without straining for style, and a stop at melvizo maintained the same unforced quality, writing that achieves elegance without effort is the highest tier and this site has clearly worked out how to land that effortless quality consistently rather than only on the writers best days.
Compared to the usual results for this kind of search this site stands well above the average, and a quick visit to venxari 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.
Honestly enjoyed every minute spent here, that is not something I say lightly, and a look at tilvexa confirmed I will be back, the bar for spending time online is high for me these days but this site clears it without effort which is high praise indeed from this reader who is usually rather demanding.
More original than the recycled takes I keep finding on the topic elsewhere, and a quick look at foamhull confirmed it, the kind of site that has its own voice rather than echoing whatever is trending which makes it stand out as a refreshing change from the usual rotation of generic content I see daily.
Well done, the kind of post that makes you slow down and actually read instead of skimming for keywords, and a look at rovnero kept me reading carefully too, that is a sign of writing that has been crafted rather than churned out for an algorithm to see today and tomorrow.
Pass this along to colleagues if the topic comes up, the framing here is sensible, and a stop at igloohaze adds more useful angles to share, the kind of content that improves conversations rather than just feeding them is what makes a resource genuinely valuable in professional contexts going forward over time and across project boundaries too.
monopoly live results yesterday https://imonopoly.live/
Picked something concrete from the post that I will use immediately, and a look at lunarvendor added another concrete piece, content that produces immediately useful output rather than just abstract appreciation is content that earns its place in my regular rotation without needing any further evaluation from me at this point honestly.
Now recognising the specific pleasure of reading writing that shows real care for sentence shapes, and a look at feathalo extended that craft pleasure, sentence level writing quality is something most blog content ignores entirely and this site has clearly invested in the prose layer alongside the substance which is rare today.
Really like the way the post resists reaching for cliches that would have made it feel generic, and a quick visit to gulfflux kept that fresh feel going, original phrasing and unexpected metaphors are signs that the writer is actually thinking rather than just stitching together familiar phrases into the appearance of content.
Top notch writing, every paragraph carries weight and nothing feels like filler, and a stop at walnutvendor reflected that same care, a rare thing on the open web these days where most pages exist for clicks rather than actual reader value or anything close to that which is honestly a real shame.
mostbet hesab parametrləri mostbet hesab parametrləri
Even on a quick first read the substance of the post comes through, and a look at flockergo reinforced that immediate quality, content that does not require a slow careful read to demonstrate value but rewards one anyway is content with real depth and this site has produced work of that demanding depth class.
Now thinking about how to apply some of this to a project I have been planning, and a look at boldcartstation added more material for the planning, content that connects to my actual creative work rather than just being interesting in the abstract is the kind that earns priority placement in my reading rotation consistently going forward.