一、安装Apache
1、安装apache
[html] view plain
copy
print ?
yum -y install httpd
2、开机自动启动
[html] view plain
copy
print ?
chkconfig httpd on
3、启动http服务
[html] view plain
copy
print ?
service httpd start
4、安装apache一些扩展
[html] view plain
copy
print ?
yum -y install httpd-manual mod_ssl mod_perl mod_auth_mysql
二、安装配置MySQL
# MySQL 客户端程序
# mysql-server 服务端程序
# mysql-devel 开发设计的库
1、安装MySQL
[html] view plain
copy
print ?
yum -y install mysql mysql-server mysql-devel
2、开机启动
[html] view plain
copy
print ?
chkconfig mysqld on
3、启动mysqld服务
[html] view plain
copy
print ?
service mysqld start
4、进行安全配置
[html] view plain
copy
print ?
/usr/bin/mysql_secure_installation
5、查看mysqld监听3306上
[html] view plain
copy
print ?
netstat -tulpn | grep -i mysql
6、mysql开启远程连接
[html] view plain
copy
print ?
mysql -h localhost -u root //这样应该可以进入MySQL服务器
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION //赋予任何主机访问数据的权限
FLUSH PRIVILEGES //修改生效
EXIT //退出MySQL服务器
三、安装PHP
1、配置yum源
追加CentOS 6.5的epel及remi源
[html] view plain
copy
print ?
# rpm -Uvh http://ftp.iij.ad.jp/pub/linux/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm
# rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
CentOS 7.0的源
[html] view plain
copy
print ?
# yum install epel-release
# rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
使用yum list命令查看可安装的包(Packege)。
[html] view plain
copy
print ?
# yum list--enablerepo=remi--enablerepo=remi-php56 | grep php
2、安装PHP5.6
yum install --enablerepo=remi --enablerepo=remi-php56 php php-opcache php-devel php-mbstring php-mcrypt php-mysqlnd php-phpunit-PHPUnit php-pecl-xdebug php-pecl-xhprof php-gd
3、配置httpd 解析php
打开/etc/httpd/confg/httpd.conf
vim /etc/httpd/conf/httpd.conf
找到
AddType application/x-gzip .gz .tgz
/AddType application
在下一行加入AddType application/x-httpd-php .php
重启 httpd
service httpd.conf restart