http://www.cnblogs.com/ceocreator/archive/2011/04/07/2007500.html
1. 更新系统内核到最新. [root@linuxfei ~]#yum -y update 系统更新后,如果yum安装时提示错误信息,请执行以下命令修复. [root@linuxfei ~]#rpm –import /etc/pki/rpm-gpg/RPM-GPG-KEY*
2. 安装Apahce, PHP, Mysql, 以及php连接mysql库组件 [root@linuxfei ~]#yum -y install httpd php mysql mysql-server php-mysql //安装mysql扩展 [root@linuxfei ~]#yum -y install mysql-connector-odbc mysql-devel libdbi-dbd-mysql //安装php的扩展 [root@linuxfei ~]# yum -y install php-gd php-xml php-mbstring php-ldap php-pear php-xmlrpc //安装apache扩展 [root@linuxfei ~]#yum -y install httpd-manual mod_ssl mod_perl mod_auth_mysql 一次性粘贴安装: [root@linuxfei ~]# yum -y install httpd php mysql mysql-server php-mysql httpd-manual mod_ssl mod_perl mod_auth_mysql php-mcrypt php-gd php-xml php-mbstring php-ldap php-pear php-xmlrpc mysql-connector-odbc mysql-devel libdbi-dbd-mysql
3. 启动服务配置 [root@linuxfei ~]# /sbin/chkconfig httpd on [设置apache为自启动] [root@linuxfei ~]# /sbin/chkconfig –-add mysqld [mysql服务] [root@linuxfei ~]# /sbin/chkconfig mysqld on [mysqld服务] [root@linuxfei ~]# /sbin/service httpd start [自启动 httpd 服务] [root@linuxfei ~]# /sbin/service mysqld start [自启动mysqld服务]
4.设置mysql数据库root帐号密码。 [root@linuxfei ~]# mysqladmin -u root password 'linuxfei' [引号内填密码] [root@linuxfei ~]# mysql -u root -p ← 通过空密码用root登录 Enter password:linuxfei ← 在这里输入密码
Welcome to the MySQL monitor. Commands end with ; or \g. ← 确认用密码能够成功登录 Your MySQL connection id is 5 to server version: 4.1.20
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.