linux centos安装lamp(yum快速安装)

来源:互联网 发布:中文版国际象棋软件 编辑:程序博客网 时间:2024/05/18 01:36

对于我们大部分人来说linux系统的开发环境安装部署就是麻烦(确实没window方便)

一下是lamp安装步骤

apache+mysql+php

对于一般开发足够了

  • 更新yum:yum -y update
  • 安装apache服务:yum install httpd httpd-devel
    • 启动/etc/init.d/httpd start
    • 配置/etc/httpd/conf/httpd.conf
    • 开机启动chkconfig httpd on
  • 安装mysql 服务: 
    • 启动/etc/init.d/mysqld start 
    • 配置/etc/my.cnf
    • 开机启动chkconfig mysqld on
    • 初始化root密码
      • mysql启动后执行 mysql进入mysql控制台
      • mysql>use mysql
      • mysql>UPDATE user SET Password=PASSWORD('newpassword') WHERE user='root'; 
      • mysql>FLUSH PRIVILEGES;
    • 开启远程访问
      • 登录mysql -uroot -p
      • 输入root密码
      • mysql>GRANT ALL PRIVILEGES ON *.* TO '用户名'@'%' IDENTIFIED BY '密码' WITH GRANT OPTION;
      • mysql>FLUSH PRIVILEGES;
  • 安装php(要安装>=5.3版本的)
    • rpm -Uvh http: // mirror.webtatic.com/yum/el5/latest.rpm (初始化安装源)
    • yum install php55w.x86_64 php55w-cli.x86_64 php55w-common.x86_64 php55w-gd.x86_64 php55w-ldap.x86_64 php55w-mbstring.x86_64 php55w-mcrypt.x86_64 php55w-mysql.x86_64 php55w-pdo.x86_64





0 0