在128MB内存的VPS上搭建WordPress

安装WordPress

下载并解压WordPress文件:

apt-get install unzip
cd /home/64mb/web
wget http://cn.wordpress.org/latest-zh_CN.zip
unzip *.zip
mv wordpress/* ./
rm -rf *.zip wordpress

让WordPress支持SQLite数据库,插件SQLite Integration

cd /home/64mb/web
wget https://downloads.wordpress.org/plugin/sqlite-integration.1.8.1.zip
unzip *.zip
mv sqlite-integration wp-content/plugins
cp wp-content/plugins/sqlite-integration/db.php wp-content
rm *.zip

修改WordPress配置文件:

cp wp-config-sample.php wp-config.php
vi wp-config.php

把下面几行注释或删除掉:

define('DB_NAME', 'database_name_here');
define('DB_USER', 'username_here');
define('DB_PASSWORD', 'password_here');
define('DB_HOST', 'localhost');

替换或添加上:

define('DB_FILE', '64mb');
define('DB_DIR', '/home/64mb/db');

重置站点目录、数据库目录用户和用户组:

chown -R www-data.www-data /home/64mb

浏览器中打开域名,填写博客名称等信息安装就可以了。

安装之后有下面的提示,无视之(默认已经在虚拟主机配置文件中做了安全配置):

Your webserver doesn't seem to be Apache. So the database directory access restriction by the .htaccess file may not function. We strongly recommend that you should restrict the access to the directory /home/64mb/db/ in some other way.

END..

不出意外你的WordPress程序就已经运行在128MB内存的VPS上了!

此条目发表在日常分类目录。将固定链接加入收藏夹。

发表回复

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