华风 发表于 2015-8-19 13:36:00

CentOS 6.6 yum 搭建LAMP环境

  CentOS 查看操作系统版本
  # cat /etc/redhat-release
CentOS release 6.6 (Final)
  参考linux centos yum安装LAMP环境
  Yum(全称为 Yellow dog Updater, Modified)是一个在Fedora和RedHat以及CentOS中的Shell前端软件包管理器。
  基于RPM包管理,能够从指定的服务器自动下载RPM包并且安装,可以自动处理依赖性关系,并且一次安装所有依赖的软件包,无须繁琐地一次次下载、安装。
  
  1、更新一下yum
  # yum -y update
  2、用yum安装Apache,Mysql,PHP
  安装Apache:
  # yum install httpd httpd-devel
  安装完成后, 启动apache
  # /etc/init.d/httpd start
Starting httpd: httpd: apr_sockaddr_info_get() failed for oa.aioute.com
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName

  设为开机启动
  # chkconfig httpd on
  
  安装mysql:
  # yum install mysql mysql-server mysql-devel
  启动mysql
  # /etc/init.d/mysqld start
  参考: CentOS 配置mysql允许远程登录
CentOS下开启mysql远程连接,远程管理数据库
  设置mysql密码,并开启远程权限:
  mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'yourpassword' WITH GRANT OPTION;
Query OK, 0 rows affected (0.00 sec)
  mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)
  mysql> EXIT
  
  允许3306端口:
  # iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 3306 -j ACCEPT
# iptables -L -n
  
  安装php:
  yum install php php-devel
  重启apache使php生效:
  /etc/init.d/httpd restart
  # yum install php php-mysql php-common php-gd php-mbstring php-mcrypt php-devel php-xml
  重新启动php:
  # /etc/init.d/httpd restart
Starting httpd:
  3、允许端口访问
  # iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT
# iptables -L -n
  参考 centos下vi的用法大全
  参考 CentOS配置VSFTP服务器
  配置文档参考 CentOS下安装配置LAMP(Linux+Apache+MySQL+PHP)
  文件夹权限 CentOS的文件权限与目录配置
页: [1]
查看完整版本: CentOS 6.6 yum 搭建LAMP环境