小内存VPS快速搭建WordPress

微魔之前入手了一台123Systems的10美元/年的便宜VPS,内存只有128M,且没有突发,入手后编译LNMP错误频出,无奈也就一直闲置了。之前看了LEB上的一篇文章,心想既然LEB这样的网站都可以建立在80M的Xen上,为什么我的123Systems就只能用来FF墙呢?呵呵,于是照着里面的内容学习了一下,顺便和大家分享一下~原文请看这里

最后搭建的效果:移除不必要的系统软件,采用更加轻便的软件代替之,构建Debian + Ngnix + php + MySQL + WordPress的组合。

1.首先,你要拥有一台自己的VPS,不必太高配置,128M内存足矣,在微魔部落,你可以轻松的找到~如果你想完全和我一样,入手个123Systems当玩具也可以~还有就是本文的脚本是针对Debian的,为啥?因为Debian相比CentOS更省内存吧(这个说法并不官方哦~),而且推荐系统安装32位的版本,也是内存原因~

2.下载LEB的脚本,这个都懂的,wget命令嘛

wget –no-check-certificate https://github.com/lowendbox/lowendscript/raw/master/setup-debian.sh

3.修改系统设置,这里会有一些设置,直接【OK】,【YES】,【y】就行了。

bash setup-debian.sh system

4.exim4代替系统的sendmail

bash setup-debian.sh exim4

5.安装Nginx

bash setup-debian.sh nginx

6.安装MySQL

bash setup-debian.sh mysql

7.安装PHP

bash setup-debian.sh php

8.安装Wordpress

bash setup-debian.sh wordpress 博客域名,如google.com

9.接下来的工作就是把你的域名DNS的A记录绑到VPS上了,呵呵其实早就应该这么做了~,如果你要添加其他Wordpress,只需要重复第8步的语句“bash setup-debian.sh wordpress 博客域名,如google.com”即可~

一切安装完毕后,访问你的域名直接进入设置站点名称,管理员用户名和密码这一页,MySQL啥的都已经链接就绪了~就着Wordpress 3.2的全新发布,微魔也顺便体验了一下,后台确实Cool了很多~

顺便看下系统占用:

只用了54M的内存,呵呵还不错吧~

下面是LEB脚本包含的软件和对系统的修改,偷个懒,就不翻译了~

安装/替换的软件

  • dropbear to replace openssh. Invoked from xinetd.
  • inetutils-syslogd to replace rsyslog.
  • exim4 to replace sendmail (if installed). Re-configured to allow Internet delivery.
  • cron
  • nginx
  • mysql. Re-configured to remove innodb support, remove query cache and reduce key buffer size.
  • php with built-in FastCGI interface. Running only 1 child process and respawn after 5,000 requests.

对系统/软件的修改:

  • Removing some commonly bundled applications that should not be there in the first place for a minimal distro (apache2, sendmail, bind9, samba, nscd, etc).
  • MySQL root is given a new password (which can be found in ~root/.my.cnf)
  • Installing each WordPress site under /var/www/<hostname>. It will create appropriate database, users and password for the site.

安装/更新Wordpress插件时需要输入FTP的解决方法,请查看此文

猜你 喜欢

关于作者: 微魔

小微魔,大智慧!

多条评论

    1. 安装的时候就会提示域名吧,时间太久我也忘了,网站目录在/var/www。省心的话还是用军哥的lnmp吧~那个说明文件很全,可以搜索本站得到帮助。

  1. 微魔你好,刚买了一个123system的10刀,128M的VPS,按上面的步骤一直不成功,请教下该怎么弄喃?

      1. 就是优化系统时更新很多不行,然后安装mysql后重启失败,mysql报错Access denied for user ‘debian-sys-maint’@’localhost’ (using password: YES)。装wordpress时也不能把文件夹移动出来正常安装,也报错。不知道是否还需要怎么设置一下?

  2. 我用xshell运行命令

    root@vps:~# 
    Type `help' to learn how to use Xshell prompt.
    Xshell:\> bash setup-debian.sh wordpress 我的域名
    Xshell: bash: command not found.

    总是提示:command not found.

    用其他ssh工具就 正常,不知道原因出在哪里,求助!!!

  3. 8.安装Wordpress

    bash setup-debian.sh wordpress 博客域名,如google.com 

    这样的如何查看自己的mysql帐号和密码?

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注