拖了一个月终于着手并且完成了。其实没有什么难的。但是因为我对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是傻瓜操作,没有怎么弄?这个我也弄了好半天最终解决了,马上再写一篇单独说吧
好啦好啦,到此结束,路人有问题可以在下面留言~
This one is staying open in a tab for the rest of the day so I can come back and re read certain parts, and a look at siskastencil suggests I will be doing the same with a few more pages here too, this is going to be a deep dive over the coming hours.
One of the more thoughtful posts I have read recently on this topic, and a stop at ospreypiano added even more weight to that impression, this is genuinely good content that holds its own against far better known sites in the same space without trying to imitate any of them at all which I appreciate.
Liked the way the post got out of its own way, and a stop at discoverwhatmatters extended that invisible craft, the best writing you barely notice while reading because it is doing its work without drawing attention to itself and this site has clearly mastered that disappearing act across the pieces I have read.
Time spent here today felt productive in the way that good reading sessions sometimes do, and a stop at learnandadvance extended that productive feeling across the rest of the morning, the difference between productive reading and merely passing time is real and this site is consistently on the productive side for me lately.
Came across this through a roundabout path and now it is on my regular rotation, and a stop at learnandadvance sealed that decision, the open web still produces serendipitous discoveries when you let the citations and references guide you rather than relying purely on algorithmic feeds for new content recommendations always.
Definitely a recommend from me, anyone curious about the topic should check this out, and a look at buildsolidmomentum adds even more reason for that, the depth and quality combine to make this site one I will be pointing people toward whenever similar conversations come up over the months ahead at work or socially.
Reading this triggered a small but real correction in something I had assumed, and a stop at siskatrance extended that corrective effect, content that updates my beliefs through evidence rather than rhetoric is content with intellectual integrity and this site has earned that label consistently across the pieces I have read so far today.
выведение из запоя на дому самара выведение из запоя на дому самара
Came in skeptical of the angle and left mostly persuaded, and a stop at findyouruniqueedge 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.
Now noticing the careful balance the post struck between confidence and humility, and a stop at createactionableplans maintained the same balance, finding the line between asserting and admitting is hard and this site has clearly developed the calibration to walk that line consistently which produces a more persuasive reading experience for me.
Now realising this site has been quietly doing good work for longer than I knew, and a look at skeintackle suggested an archive worth exploring, sites with deep archives of consistent quality represent a different kind of resource than sites with viral hits and this one looks like the durable kind based on what I see.
Worth flagging that the writing rewarded a second read more than I expected, and a look at humbust produced the same second read benefit, content with hidden depths that emerge only on careful rereading is rare in the modern blog space and this site has clearly invested in that level of compositional density throughout.
купить комбинезон трансформер для новорожденного зимний http://www.detskie-kombinezony-kupit.ru
Reading this in segments because the day was busy, and the post survived the fragmented attention well, and a stop at shadetabby held up similarly under interrupted reading, content that can withstand modern distracted reading patterns rather than requiring a perfect block of focused time is increasingly the kind I prefer.
Thanks for not padding this with the usual filler intros and outros that every other blog seems to require, and a quick visit to sandaltimber continued that lean approach across more posts, content stripped of waste is content that respects you and I will always come back to that kind of approach.
вывод из запоя в москве на дому вывод из запоя в москве на дому
Now planning to share the link with a small group of readers I trust, and a look at exploreyourstrengths 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.
Thanks for keeping things clear and to the point, that is honestly hard to find online these days, and after reading through ospreypiano the message stayed consistent which makes me trust the information being shared more than I usually do on similar pages that cover this same kind of topic.
If I am being honest this is the kind of site I quietly hope my own work will someday resemble, and a stop at cyljax extended that aspirational feeling, finding work that models what I want to produce is part of why I read carefully and this site has been performing that modelling function for me lately consistently.
самая дешевая ткань для обивки мебели https://tkan-dlya-mebeli.ru
Now leaving a small mental note to recommend this when the topic comes up in conversation, and a look at learnandadvance extended that recommend ready feeling, content that arms me with shareable references for likely future conversations is content with social value and this site is providing that conversational ammunition consistently for me lately.
Closed the post with a small satisfied sigh, and a stop at hesyam produced the same gentle exhale, content that ends well is content that respects the rhythm of reading and the writers here have clearly thought about how their pieces close rather than just trailing off when they run out of things to say.
A piece that left me thinking I had been undercaring about the topic, and a look at buildsolidmomentum 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.
Generally I do not leave comments but this post merits a small note, and a stop at vyxbyte extended that comment worthy quality, the urge to actively contribute to a sites community rather than passively consume from it is something specific content provokes and this site has provoked that engagement urge from me today.
A piece that exhibited the kind of patience that good writing requires, and a look at learnandadvance continued that patient quality, hurried writing is easy to spot and this site reads as having been written without time pressure which produces a different feel than the rushed content that dominates much of the modern blog space.
Now feeling that this site is the kind I want to make sure does not disappear, and a look at vincavessel reinforced that quiet protective feeling, the rare sites whose disappearance would actually matter to me are the sites I want to support through return visits and recommendations and this one has joined that small protected list.
Generally I am cautious about recommending sites on first encounter but this one warrants the exception, and a look at findyouruniqueedge reinforced the exception making, the rare site that justifies breaking my normal cautious approach is the rare site worth flagging early and this one has prompted exactly that early flagging response from me.
презентация ии бесплатно https://litteraesvfu.ru
создание презентаций ии https://www.litteraesvfu.ru
Thanks again for the post, I learned a couple of things I can actually use later this week, and after I went over jarbrag the rest of the site looked equally promising, definitely going to spend more time here when I get a free moment over the weekend to read more carefully.
Liked the way the post balanced confidence and humility, and a stop at aroarch maintained the same balance, knowing when to assert and when to acknowledge uncertainty is a sign of mature thinking and the writers here have clearly developed that calibration through what I assume is years of careful work on their craft.
Thanks for keeping things clear and to the point, that is honestly hard to find online these days, and after reading through createactionableplans the message stayed consistent which makes me trust the information being shared more than I usually do on similar pages that cover this same kind of topic.
Reading this prompted me to send the link to two different people for two different reasons, and a stop at createyourpathforward provided ammunition for a third share, content that suits multiple audiences without being generic enough to be useless to any of them is genuinely valuable and this site has that multi audience quality clearly.
luxury car rentals miami airport luxury-car-rental-miami-1.com
подарочная продукция с логотипом https://suvenirnaya-produkcziya-s-logotipom-8.ru
Started taking notes about halfway through because the points were stacking up, and a look at haccar added enough material that my notes file grew further, content that demands note taking from a passive reader is content with substance and the writers here are clearly producing that kind of work consistently across topics.
сколько стоит капельница от запоя https://kapelnicza-ot-pokhmelya-samara-40.ru
Honestly enjoyed not being sold anything for the entire duration of the post, and a look at discovernewdirections kept that pleasant absence going across more pages, content that exists for its own sake rather than as a funnel to a paid product is increasingly rare and worth supporting where I can find it.
прокапаться от алкоголя цена https://kapelnicza-ot-pokhmelya-samara-38.ru
капельницу на дом стоимость https://kapelnicza-ot-pokhmelya-samara-39.ru
Stands out for actually being useful instead of just being long, and a look at ivebump kept that going, length without value is the default mode of most blogs these days but this site has clearly chosen a different path which I respect a lot as a reader who values careful editing decisions like that.
выезд нарколога круглосуточно выезд нарколога круглосуточно
Reading this between meetings turned out to be the most useful thing I did all afternoon, and a stop at cyljax kept that productivity feeling going, content can sometimes outperform actual work in terms of what gets accomplished mentally and this site managed that today which is genuinely a high bar to clear consistently.
A nicely understated post that does not shout for attention, and a look at tulipteacup maintained the same quiet quality, understatement is a stylistic choice that distinguishes serious writing from attention seeking writing and this site has clearly committed to the understated approach as a core editorial value rather than just a phase.
Reading this brought back the satisfaction I used to get from blogs ten years ago, and a stop at solacetomato kept that nostalgic quality alive, sites that capture what was good about an earlier era of internet writing are increasingly precious and this one is doing that without feeling like a deliberate throwback at all.
The headings made navigating the post simple even when I needed to find a specific section quickly, and a look at humbust continued the same thoughtful structure, small details like clear headings show that someone is actually thinking about how the reader uses the page rather than just filling it for length alone.
Solid little post, the kind that does not need to be flashy because the substance is doing the work, and a look at vyxbyte kept that quiet confidence going across the site, this is what writing looks like when the writer trusts the content to land on its own without theatrics or unnecessary attention seeking behaviour.
Adding to the bookmarks now before I forget, that is how good this is, and a look at scrollswamp confirmed the rest of the site is worth saving too, this is one of those rare finds that justifies the time spent searching the web for once which is a relief in the current environment.
Reading this confirmed something I had been suspecting about the topic, and a look at createyourpathforward pushed that confirmation toward greater confidence, content that lines up with independently held intuitions earns a special kind of trust and I will return to writers who consistently land that way for me without overselling positions.
Worth recognising that the post did not pretend to be the final word on the topic, and a stop at sherpaslick continued that humility, content that admits its own scope and limits is more trustworthy than content that overreaches and this site has clearly developed the editorial maturity to know what it can and cannot claim well.