你的位置:灵当CRM >> 首页 >> 常见问题 >> 环境配置 >> 详细内容

centos6.5配置php+mysql+apache配置方法

热度0票  浏览507次 时间:2015年11月03日 18:04
=======================================
#配置网络:vi /etc/sysconfig/network-scripts/ifcfg-eth0
TYPE=Ethernet
BOOTPROTO=static
DEFROUTE=yes
DEVICE=eth0
HWADDR=00:1F:29:C8:86:BA
ONBOOT=yes
IPADDR=101.226.197.73
GATEWAY=101.226.197.1
NETMASK=255.255.255.128


service iptables stop
chkconfig iptables off
chkconfig iptables on

#校准时间
ntpdate cn.pool.ntp.org

#安装wget
yum install wget

#若没有安装
yum install ntp
hwclock --systohc

#关闭防火墙
/etc/init.d/iptables stop

#关闭SELINUX
vi /etc/selinux/config

#SELINUX=enforcing
#SELINUXTYPE=targeted
SELINUX=disabled

#保存
:wq!

#使配置立即生效
setenforce 0


#安装apache
yum install httpd

#安装mysql
rpm -qa | grep mysql

#卸载已安装的mysql
yum remove mysql mysql-server mysql-libs compat-mysql51
rm -rf /var/share/mysql
rm /etc/my.cnf

#安装必要软件包
yum -y install  gcc-g77 autoconf automake zlib* fiex* libxml* ncurses-devel libmcrypt* libtool-ltdl-devel* make cmake

wget http://cdn.mysql.com/archives/mysql-5.6/mysql-5.6.14-linux-glibc2.5-x86_64.tar.gz
tar -zxvf mysql-5.6.14-linux-glibc2.5-x86_64.tar.gz
mv mysql-5.6.14-linux-glibc2.5-x86_64 /usr/local/mysql

#创建mysql用户及用户组
groupadd mysql
useradd -g mysql -M mysql

mkdir -p /home/mysql/data
chown -R mysql.mysql /home/mysql/data

#提示:运行下面的命令初始化安装mysql之前确认系统没有/etc/my.cnf
/usr/local/mysql/scripts/mysql_install_db --basedir=/usr/local/mysql --datadir=/home/mysql/data --user=mysql

#添加mysqld 成为系统服务并设置自启动:
cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld
chkconfig --add mysqld
chkconfig mysqld on


#安装php
rpm -Uvh http://repo.webtatic.com/yum/el6/latest.rpm

yum install php54w

yum install php54w-mysql php54w-gd libjpeg* php54w-ldap php54w-odbc php54w-pear php54w-xml php54w-xmlrpc php54w-mbstring php54w-bcmath php54w-mhash php54w-mcrypt

yum install php54w-httpd
上一篇 下一篇