zoukankan      html  css  js  c++  java
  • CentOS 5.5使用yum安装LAMP环境(sohu源)

    CentOS 5.5默认的是163的源,据说sohu的源很好用,今天小试了下。

     1、修改yum配置文件,更改为sohu源

    # cd /etc/yum.repos.d/ 
    #
    cp CentOS-Base.repo CentOS-Base.repo.bak
    • 清空CentOS-Base.repo文件内容,替换为以下内容:
    # CentOS-Base.repo 
    #
    # This file uses a
    new mirrorlist system developed by Lance Davis for CentOS.
    # The mirror system uses the connecting IP address of the client and the
    # update status of each mirror to pick mirrors that are updated to and
    # geographically close to the client. You should use
    this for CentOS updates
    # unless you are manually picking other mirrors.
    #
    # If the mirrorlist
    = does not work for you, as a fall back you can try the
    # remarked
    out baseurl= line instead.
    #
    #
    [
    base]
    name
    =CentOS-$releasever - Base
    baseurl
    =http://mirrors.sohu.com/centos/$releasever/os/$basearch/
    gpgcheck=1
    gpgkey
    =http://mirrors.sohu.com/centos/RPM-GPG-KEY-CentOS-5
    #released updates
    [updates]
    name
    =CentOS-$releasever - Updates
    baseurl
    =http://mirrors.sohu.com/centos/$releasever/updates/$basearch/
    gpgcheck=1
    gpgkey
    =http://mirrors.sohu.com/centos/RPM-GPG-KEY-CentOS-5
    #packages used/produced in the build but not released
    [addons]
    name
    =CentOS-$releasever - Addons
    baseurl
    =http://mirrors.sohu.com/centos/$releasever/addons/$basearch/
    gpgcheck=1
    gpgkey
    =http://mirrors.sohu.com/centos/RPM-GPG-KEY-CentOS-5
    #additional packages that may be useful
    [extras]
    name
    =CentOS-$releasever - Extras
    baseurl
    =http://mirrors.sohu.com/centos/$releasever/extras/$basearch/
    gpgcheck=1
    gpgkey
    =http://mirrors.sohu.com/centos/RPM-GPG-KEY-CentOS-5
    #additional packages that extend functionality of existing packages
    [centosplus]
    name
    =CentOS-$releasever - Plus
    baseurl
    =http://mirrors.sohu.com/centos/$releasever/centosplus/$basearch/
    gpgcheck=1
    enabled
    =0
    gpgkey
    =http://mirrors.sohu.com/centos/RPM-GPG-KEY-CentOS-5
    • 更新源
    # yum -y update

    2、使用yum命令安装apache、mysql、PHP环境

    #yum -y install httpd php mysql mysql-server php-mysql
    #
    这里只装了最基础的,其他扩展没装

    3、设定服务启动与自启动

    # chkconfig httpd on
    #
    chkconfig --add mysqld
    #
    chkconfig mysqld on

    # service httpd start
    #
    service mysqld start

    4、防火墙设置

    a.添加.允许访问端口{21: ftp, 80: http}. 
    # iptables -I INPUT -p tcp --dport 80 -j ACCEPT
    # iptables -I RH-Firewall-1-INPUT -m state –state NEW -m tcp -p tcp –dport 21 -j ACCEPT
    #
    iptables -I RH-Firewall-1-INPUT -m state –state NEW -m tcp -p tcp –dport 80 -j ACCEPT
    b.或者关闭防火墙(不推荐).
    # service iptables stop
    c.重置加载防火墙
    # service iptables restart

    5、修改mysql的密码

    #mysqladmin -u root password 'root'

    其他的配置,童鞋们自己搞吧

  • 相关阅读:
    页面 分页加载图文 微服务架构
    二阶段 三阶段 提交 Paxos
    SignatureDoesNotMatch REST接口 在任何时间、任何地点、任何互联网设备上 在Header中包含签名
    tmp
    base64 hash sha
    对云资源服务商资源读写的架构思考:前端代码走token
    微信小程序存放视频文件到阿里云用到算法js脚本文件
    REST RPC HTTP vs 高性能二进制协议 序列化和通信协议
    角色 演员
    服务端签名后直传 服务端签名直传并设置上传回调
  • 原文地址:https://www.cnblogs.com/huangzhen/p/2151120.html
Copyright © 2011-2022 走看看