Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!

1. 本来打算在CentOS 5.5 里面安装,但是php版本低,还得重新编译,就换到CentOS 6.0,反正在虚拟机里面

需要安装的包: httpd, mysql ,php(注意要把php-mysql安上)

开机启动

chkconfig mysqld –levels 345 on

chkconfig httpd –levels 345 on

开启进程(注意把/etc/httpd/conf.d/welcome.conf里面的配置注释掉)

/etc/init.d/mysqld start

/etc/init.d/httpd start

打开iptables的80端口

修改/etc/sysconfig/iptables,在合适位置插入一条规则

/etc/init.d/iptables restart

 

2.创建mysql账户并且赋予权限

直接在终端输入mysql

create user ‘username’@'localhost’ identified by ‘password’;

grant all on *.* to ‘username’@'localhost’ identified by ‘password’;

3.创建数据库

mysql -u username -p 然后输入密码

create database word_press

4.将wordpress解压,(我重命名为blog),上传到/var/www/html,将wp-config-sample.php重命名为wp-config.php,修改配置,包括数据库用户名等

// ** MySQL settings – You can get this info from your web host ** // /** The name of the database for WordPress */ define(‘DB_NAME’, ‘word_press’);

/** MySQL database username */ define(‘DB_USER’, ‘username’);

/** MySQL database password */ define(‘DB_PASSWORD’, ‘password’);

/** MySQL hostname */ define(‘DB_HOST’, ‘localhost’);

5.在浏览器上输入服务器地址,傻瓜式安装

6.下载主题插件等

我用了zbench主题,下了一个wp-code-highlight插件,效果如下