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'
其他的配置,童鞋们自己搞吧