CentOS yum 安装 Apache + PHP + MySQL

# 检查并卸载
rpm -qa|grep httpd
rpm -e httpd
rpm -qa|grep mysql
rpm -e mysql
rpm -qa|grep php
rpm -e php

# 删除默认的Apache
yum -y remove httpd

# 查找最快的源
yum -y install yum-fastestmirror

# 更新
yum -y update

# 安装必要的组件
yum -y install patch make gcc gcc-c++ gcc-g77 flex bison file
yum -y install libtool libtool-libs autoconf kernel-devel
yum -y install libjpeg libjpeg-devel libpng libpng-devel libpng10 libpng10-devel gd gd-devel
yum -y install freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel
yum -y install glib2 glib2-devel bzip2 bzip2-devel libevent libevent-devel
yum -y install ncurses ncurses-devel curl curl-devel e2fsprogs
yum -y install e2fsprogs-devel krb5 krb5-devel libidn libidn-devel
yum -y install openssl openssl-devel vim-minimal nano sendmail
yum -y install fonts-chinese gettext gettext-devel
yum -y install ncurses-devel
yum -y install gmp-devel pspell-devel
yum -y install unzip

# 安装Apache+MySQL+PHP
yum -y install httpd php mysql mysql-server php-mysql

# 启动httpd服务
/sbin/service httpd start

# 启动mysql服务
/sbin/service mysqld start

# 设置mysql数据库root帐号密码,引号内填密码
mysqladmin -u root password ’123′

# 默认站点目录为/var/www/html/

# 安装apache扩展
yum -y install httpd-manual mod_ssl mod_perl mod_auth_mysql
# 安装php的扩展
yum install php-gd
yum -y install php-gd php-xml php-mbstring php-ldap php-pear php-xmlrpc
# 安装mysql扩展
yum -y install mysql-connector-odbcmysql-devel libdbi-dbd-mysql

 

 

 

重新映射http目录:

[root@VM_185_51 /]# vim /etc/nginx/conf.d/default.conf

修改完成后实际配置如下,红色文字为修改过的部分:

server {

  listen       80;
  root   /usr/share/nginx/html;
posted @ 2015-01-23 11:01  廖先生  阅读(420)  评论(0编辑  收藏  举报