|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
要多动手,不要怕什么搞坏了怎么办,你不搞坏,不去动手,就永远不会有收获,既然你在linux中是自由的,那就发挥自己的权利;
1.换源,sohu的相称好用。
1.1备份CentOS-Base.repo
cd/etc/yum.repos.d/
cpCentOS-Base.repoCentOS-Base.repo.bak
1.2交换源
用vi翻开CentOS-Base.repo,并将内容清空,然后将上面的内容复制出来,并保留。
#CentOS-Base.repo
#
#ThisfileusesanewmirrorlistsystemdevelopedbyLanceDavisforCentOS.
#ThemirrorsystemusestheconnectingIPaddressoftheclientandthe
#updatestatusofeachmirrortopickmirrorsthatareupdatedtoand
#geographicallyclosetotheclient.YoushouldusethisforCentOSupdates
#unlessyouaremanuallypickingothermirrors.
#
#Ifthemirrorlist=doesnotworkforyou,asafallbackyoucantrythe
#remarkedoutbaseurl=lineinstead.
#
#
[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
#releasedupdates
[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
#packagesused/producedinthebuildbutnotreleased
[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
#additionalpackagesthatmaybeuseful
[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
#additionalpackagesthatextendfunctionalityofexistingpackages
[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
1.3更新一下。
yum-yupdate
2.用yum安装Apache,Mysql,PHP.
2.1安装Apache
yuminstallhttpdhttpd-devel
安装完成后,用/etc/init.d/httpdstart启动apache
设为开机启动:chkconfighttpdon
2.2安装mysql
2.2.1yuminstallmysqlmysql-servermysql-devel
一样,完成后,用/etc/init.d/mysqldstart启动mysql
2.2.2设置mysql暗码
mysql>;USEmysql;
mysql>;UPDATEuserSETPassword=PASSWORD(newpassword)WHEREuser=root;
mysql>;FLUSHPRIVILEGES;
2.2.3同意远程登录
mysql-uroot-p
EnterPassword:<yournewpassword>
mysql>GRANTALLPRIVILEGESON*.*TO用户名@%IDENTIFIEDBY暗码WITHGRANTOPTION;
完成后就可以用mysql-front远程办理mysql了。
2.2.4设为开机启动
chkconfigmysqldon
3.安装php
yuminstallphpphp-mysqlphp-commonphp-gdphp-mbstringphp-mcryptphp-develphp-xml
/etc/init.d/httpdstart
4.测试一下
4.1在/var/www/html/新建个test.php文件,将以下内容写进,然后保留。
<?
phpinfo();
?>
4.2防火墙设置
a.增加.同意会见端口{21:ftp,80:http}.
iptables-IRH-Firewall-1-INPUT-mstateCstateNEW-mtcp-ptcpCdport21-jACCEPT
iptables-IRH-Firewall-1-INPUT-mstateCstateNEW-mtcp-ptcpCdport80-jACCEPT
b.封闭防火墙{不保举}.
serviceiptablesstop
c.重置加载防火墙
serviceiptablesrestart
4.3然后在客户端扫瞄器里翻开http://serverip/test.php,若能乐成显现,则暗示安装乐成。
至此,安装终了。感伤,yum真是太好用了。
经常看到有人问用什么版本的linux好,其实只要你认真学习无论什么版本都挺好的。 |
|