Wordpress 是世界上用户最多的blog 工具,其优点就不多说了。
1. 下载所需软件包
MySQL-5.5.2-m2.tar.gz httpd-2.2.15.tar.gz PHP-5.3.2.tar.gz WordPress-2.9.2.tar.gz
都是最新的。
2. 安装软件包
tar xvf MySQL-5.5.2-m2.tar.gz
./configure –prefix=/usr/local/mysql
tar xvf httpd-2.2.15.tar.gz
装Apache是需要其他包
wget http://labs.renren.com/apache-mirror/apr/apr-util-1.3.9.tar.gz
wget http://apache.freelamp.com/apr/apr-1.4.2.tar.gz
先装apr
./configure –prefix=/usr/local/apr
在装apr-util
./configure --with-apr=/usr/local/apr
安装Apache
./configure --prefix=/usr/local/apache \
--with-apr=/usr/local/apr \
--enable-rewrite \
--enable-so
安装php
./configure –prefix=/usr/local/apache/php \
--with-zlib \
--with-jpej \
--with-png \
--with-apxs2=/usr/local/apache/bin/apxs \
--with-mysql=/usr/local/mysql
(若是不选zlib,可能在安装WordPress theme和plusin无法在线安装)
3.修改Apache配置文件
/usr/local/apache/conf/httpd.conf
添加
AddType application/x-httpd-php .php
AddType application/x-httpd-php-sourece .phps
<IfModule dir_module>
DirectoryIndex index.php index.html
#若是不添加 index.php打开blog只显示目录,无法正常显示blog首页
</IfModule>
其他的根据自己的需要修改
3. 创建数据库
Mysql –u root
Create database wpdb;
Grant all privileges on wpdb.* to ‘wp’@127.0.0.1 identified by ‘wpdbpwd’;
Flush privileges
\q
4. 修改WordPress的wp-config.php
mv wp-config-example.php wp-config.php
/** The name of the database for WordPress */
define('DB_NAME', 'wpdb');
/** MySQL database username */
define('DB_USER', 'wp');
/** MySQL database password */
define('DB_PASSWORD', 'wpdbpwd');
/** MySQL hostname */
define('DB_HOST', '127.0.0.1');
5. 开始安装WordPress
/usr/local/apache/bin/apachectl start
(这一步可能出现libphp5.so访问拒绝,修改/etc/selinux/conf 改成SELINUX=disabled reboot)
在浏览器中打开http://ip/wp-admin/install.php若显示error其继续修改以上配置文件