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'

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

  • 相关阅读:
    尝试加载 Oracle 客户端库时引发 BadImageFormatException。如果在安装 32 位 Oracle 客户端组件的情况下以 64 位模式运行 已解决!
    iis 无法在Web服务器上启动调试。打开的URL的IIS辅助进程当前没有运行
    aspx页面,Page_Load 无人进入,解决
    Ajax后台传数组参数,接收不到报错!
    FusionCharts和highcharts 饼图区别!
    redis
    Hibernate不同数据库的连接及SQL方言
    Kafka
    Zookeeper
    BaseDao+万能方法 , HibernateDaoSupport
  • 原文地址:https://www.cnblogs.com/huangzhen/p/2151120.html
Copyright © 2011-2022 走看看