因为源码编译安装LAMP+WORDPRESS老会因为不同LINUX版本,或者别的什么原因导致编译安装时出现各种各样的问题,一个个去解决很麻烦.
所以经过测试,实践,总结后;发表下用RPM包在红帽RHEL5.2系统上安装MYSQL+APACHE+PHP+WORDPRESS的步骤.因为不涉及源码编译,所以显得比较简单.这里分享给大家.^_^
首先需要安装一个干净的Red Hat 5.2系统,什么叫干净的?就是安装时不附带任何额外的软件程序(默认的除外..) 
还有什么定义主机名啊,配置IP啊,这些个常规就不说了.玩LINUX的人都知道.
//1,安装Mysql Server
[root@station30 ~]# yum install mysql-server         
Installing: perl-DBI ######################### [1/4]
Installing: mysql ######################### [2/4]
Installing: perl-DBD-MySQL ######################### [3/4]
Installing: mysql-server ######################### [4/4]
[root@station30 ~]# /etc/init.d/mysqld restart            //启动服务
[root@station30 ~]# chkconfig mysqld on                //开机自启
[root@station30 ~]# /usr/bin/mysqladmin -u root password 123456        //给MYSQL创建登录用户名和密码,注意此ROOT非系统的ROOT也
[root@station30 ~]# mysql -u root -p                    //登录MYSQL
mysql> status;           //查看数据库版本
mysql> create database wordpress;            //创建wordpress数据库
Query OK, 1 row affected (0.00 sec)            //出现这个表示成功
mysql> show databases;                        //查看当前数据库
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| test |
| wordpress |
+--------------------+
4 rows in set (0.00 sec)
//2,安装Apache
[root@station30 ~]# yum install httpd
Installing: apr ######################### [1/4]
Installing: postgresql-libs ######################### [2/4]
Installing: apr-util ######################### [3/4]
Installing: httpd ######################### [4/4]
[root@station30 ~]# /etc/init.d/httpd restart
[root@station30 ~]# chkconfig httpd on
[root@station30 ~]# links 127.0.0.1                //检查是否能看到测试页,看到以下显示表示成功
rhel5.2 LAMP+wordpress RPM包安装方法_职场
//3,安装PHP
[root@station30 ~]# yum install php
Installing: gmp ######################### [1/4]
Installing: php-common ######################### [2/4]
Installing: php-cli ######################### [3/4]
Installing: php ######################### [4/4]
[root@station30 ~]# yum install php-mysql
Installing: php-pdo ######################### [1/2]
Installing: php-mysql ######################### [2/2]
[root@station30 ~]# vim /etc/httpd/conf.d/php.conf         //修改php在apache中的配置文件
//注意一下内容都已写入php.conf中
LoadModule php5_module modules/libphp5.so
AddHandler php5-script .php
AddType text/html .php
DirectoryIndex index.php
AddType application/x-httpd-php-source .phps
[root@station30 ~]# /etc/init.d/httpd restart        //修改完后勿忘重启服务
[root@station30 ~]# vim /var/www/html/index.php    //编辑一个index.php网页
<?
phpinfo();
?>
//在浏览器中输入服务器的IP,看到以下内容表示PHP配置成功
rhel5.2 LAMP+wordpress RPM包安装方法_休闲_02
//4,安装wordpress
[root@station30 ~]# cd /var/www/html/
[root@station30 html]# unzip /mnt/wordpress-2.8.4-zh_CN.zip    
[root@station30 html]# ls
index.php wordpress
[root@station30 html]# cd wordpress/
[root@station30 wordpress]# cp wp-config-sample.php wp-config.php
[root@station30 wordpress]# rpm -ivh /mnt/Server/fonts-chinese-3.02-12.el5.noarch.rpm         //因为是中文的WORDPRESS,所以安装中文包来显示中文哦
[root@station30 wordpress]# vim wp-config.php             //进入WP的配置文件
// ** MySQL设置 - 具体信息来自您正在使用的主机 ** //
/** WordPress数据库的名称,替换掉 “putyourdbnamehere” *//
define('DB_NAME', 'wordpress');
//** MySQL数据库用户名,替换掉 “usernamehere” *//
define('DB_USER', 'root');
//** MySQL数据库密码,替换掉 “yourpasswordhere” *//
define('DB_PASSWORD', '123456');
//完成以上修改后,在IE里输入http://192.168.1.30/wordpress//wp-admin/install.php   ; 出现以下显示就恭喜你,成功了^_^rhel5.2 LAMP+wordpress RPM包安装方法_职场_03
输入以上信息后,点击"安装WordPress",一定要记录好系统给你的admin密码,切忌! 接下来就是网页安装了,很简单.  看下效果图
rhel5.2 LAMP+wordpress RPM包安装方法_职场_04
好了,这样一个以PRM包YUM安装方式配置的LAMP+WP就完成了,有兴趣的朋友可以去尝试下,来架设属于自己的个人博客.^_^
参考资料:
http://dreamfire.blog.51cto.com/418026/197595          //源码编译法安装LAMP+WP
http://www.javaeye.com/topic/369148                   // linux下mysql(rpm)安装使用手册
http://dgfpeak.blog.51cto.com/195468/d-2               // 编译安装MYSQL和APACHE时经常出的错误及解决办法
http://jiangzhanyong.com/2007/05/wordpress-chinese-lesson-series-1-320.html        //Wordpress 中文教程系列
http://21nw.com/2009/04/13/mysql-扩展-拓展的安装/                    //出现"您的 PHP 似乎没有安装运行 WordPress 必须的 MySQL 拓展''错误提示的解决办法
  • 收藏
  • 评论
  • 举报
提问和评论都可以,用心的回复会被更多人看到 评论
发布评论
相关文章