一、安装lamp需要的软件

1、yum install httpd mysql-server mysql php php-mysql


2、启动mysql服务

service mysqld start


3、启动apache

service httpd start


4、测试php页面,新建/var/www/html/index.php,内容如下:


<html>

<head>

<title>php test page</title>

</head>

<body>

<h1>modular php</h1>

<?php

  phpinfo();

?>

</body>

</html>


5、访问http://192.167.127.137/


注意:防火墙是否关闭。 service iptables stop


二、安装开源网站wordpress:

WordPress部署到Apache下,wordpress的下载地址http://cn.wordpress.org/releases/#older,

版本wordpress-3.3.1-zh_CN.zip。

1、将wordpress-3.3.1-zh_CN.zip解压到/var/www/html/中。

2、修改配置文件

    (1)、#cp wp-config-sample.php wp-config.php

    (2)、修改wp-config.php中的内容,

            设置:数据库名如wpdb、数据库用户名、密码如wpuser和wppass

    

3、数据库授权:

    (1)、create database wpdb;

    (2)、grant all privileges on wpdb.*  to 'wpuser'@'localhost' identified by 'wppass';

    (3)、flush privileges 

4、访问http://192.167.127.137/

5、按照wordpress步骤即可完成安装。