CentOS 6.5下安装LAMP
第一步:安装Apache 2.2
Yum安装apache:
打开终端
[root@localhost ~]# yum install httpd
同样配置系统让 Apache 随系统启动:
[root@localhost~]# chkconfig --levels 235 httpd on
配置完毕,启动 Apache:
[root@localhost~]# /etc/init.d/httpd start
网页访问 127.0.0.1/ 看到“Apache 2 Test Page powered by CentOS” 的测试页面;
Apache 安装完成;
第二步:安装Mysql 5.5
安装mysql-5.5的yum源:
http://repo.mysql.com/yum/mysql-5.5-community/el/6/x86_64/mysql-community-release-el6-5.noarch.rpm# rpm -ivh
修改安装好的yum源:
# vim mysql-community.repo 编辑 /etc/yum.repos.d/mysql-community.repo文件,将5.5的enabled改为1;5.6的enabled改为0
安装mysql-5.5:
# yum -y install mysql-community-clientmysql-community-devel mysql-community-server php-mysql
安装完毕,让 MySQL 能够随系统自动启动:
设置 MySQL 数据 root 账户的密码:
Mysql 5.5安装完成;
第三步:安装PHP 5.5
安装php-5.5更新源:
1. #rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
2. #rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm
查看php版本列表:
#yum list php*
安装php及相关软件:
# yum install php55w php55w-devel php55w-common php55w-mysql php55w-pdophp55w-opacache php55w-xml
Php-5.5安装完成;
第四步:安装phpMyAdmin
推荐博客:
https://m.aliyun.com/yunqi/ziliao/48274
问题:
1.关于 yum源的http和https问题
解决办法:修改/etc/yum.repos.d/webtatic.repo 文件中https 改为http
2.更改apache根目后apache服务正常,访问出现403错误
推荐博客:http://blog.csdn.net/codesvn/article/details/7171101
centos防火墙问题:http://blog.csdn.net/agoago_2009/article/details/28269563
3. Apache更改网页根目录
参考博客:http://blog.csdn.net/u014702999/article/details/55667090