前置条件 假设您已经安装好了 apache web server,mysql 数据库和 php 环境;如果还没有安装好的话,请参见下面的文档:http://library.linode.com/lamp-guides/centos-6 基本流程 我们把 /srv/www 作为我们公共的 web 程序的目录,如果还不存在的话请先建立
前置条件假设您已经安装好了 apache web server,mysql 数据库和 php 环境;如果还没有安装好的话,请参见下面的文档:http://library.linode.com/lamp-guides/centos-6
基本流程我们把 /srv/www 作为我们公共的 web 程序的目录,如果还不存在的话请先建立。
首先在 /srv/www 下面建立我们站点的目录,例如 chinese.guru001.com。
然后在 chinese.guru001.com 下面建立两个目录:public_html 目录用于放置 web 程序,logs 目录用于存放日志文件(后面会在 apache 虚拟目录中进行配置)。
cd chinese.guru001.com mkdir public_html mkdir logs修改 public_html 目录权限:
chmod 777 /srv/www/chinese.guru001.com/public_html 下载并解压 wordpress从 cn.wordpress.org 下载最新的 wordpress 程序(这里是:http://cn.wordpress.org/wordpress-3.5-zh_cn.tar.gz),然后解压到 public_html 目录中。
wget http://cn.wordpress.org/wordpress-3.5-zh_cn.tar.gz tar zxvf wordpress-3.5-zh_cn.tar.gz现在 wordpress 已经被解压到 public_html 下面的 wordpress 目录了。
把刚才下载的文件删掉
建立我们要用到的 mysql 数据库,建立 mysql 账户
mysql_secure_installation create database guruchinese; grant all on guruchinese.* to 'yourusername' identified by 'yourpassword'; 为 wordpress 配置 apache 虚拟目录配置 apache 虚拟目录:
cd /etc/httpd/conf.dsu 成 root 之后修改虚拟主机配置文件
vi vhost.conf serveradmin princetoad@126.com servername chinese.guru001.com serveralias chinese.guru001.com documentroot /srv/www/chinese.guru001.com/public_html/wordpress allowoverride all errorlog /srv/www/chinese.guru001.com/logs/error.log customlog /srv/www/chinese.guru001.com/logs/access.log combined注:allowoverride all 是为了启用 wordpress 的 url 重写的。
退出编辑,然后重启 apache
/etc/init.d/httpd restart 通过 web 进行安装在浏览器中输入你的域名,让 wordpress 自动创建一个配置文件,输入相应的数据库信息,进行安装即可。
常见问题安装插件和主题需要 ftp 账户,在 wp-config.php 最后加入下面内容(如果还没有安装 ftp 服务器的话,请先安装)
define('fs_chmod_file', 0755); define('fs_chmod_dir', 0755); define('ftp_method', 'ftpext'); define('ftp_base', '/srv/www/chinese.guru001.com/public_html/wordpress/'); define('ftp_host', 'tomcentos01'); define('ftp_content_dir', '/srv/www/chinese.guru001.com/public_html/wordpress/wp-content/'); define('ftp_user', 'your_ftp_username'); define('ftp_pass', 'your_ftp_password'); define('ftp_ssl', false);.syntaxhighlighter{padding-top:20px;padding-bottom:20px;}【说明】:本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:)!