CentOS 5.5使用yum安装LAMP环境(sohu源)

前端之家收集整理的这篇文章主要介绍了CentOS 5.5使用yum安装LAMP环境(sohu源)前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

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

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

清空CentOS-Base.repo文件内容,替换为以下内容

更新源

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

PHP MysqL MysqL-server PHP-MysqL

MysqLdMysqLd onMysqLd start

添加iptables -I INPUT -p tcp --dport 80 -j ACCEPT关闭防火墙(不推荐)

修改MysqL的密码

MysqLadmin -u root password 'root'

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

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

安装日志:

<div class="cnblogs_code">

[jianbao@localhost ~]$ yum install -y httpd PHP MysqL MysqL-server PHP-MysqL PHP-develLoaded plugins: fastestmirrorYou need to be root to perform this command.[jianbao@localhost ~]$ su -口令:[root@localhost ~]# yum install -y httpd PHP MysqL MysqL-server PHP-MysqL PHP-develLoaded plugins: fastestmirrorLoading mirror speeds from cached hostfile  base: centos.ustc.edu.cn  extras: centos.ustc.edu.cn * updates: centos.ustc.edu.cnSetting up Install ProcessResolving Dependencies--> Running transaction check---> Package httpd.i386 <span style="color: #800080;">0:<span style="color: #800080;">2.2.<span style="color: #800080;">3-<span style="color: #800080;">53.el5.centos.<span style="color: #800080;">3 set to be updated---> Package MysqL.i386 <span style="color: #800080;">0:<span style="color: #800080;">5.0.<span style="color: #800080;">95-<span style="color: #800080;">1.el5_7.<span style="color: #800080;">1 set to be updated--> Processing Dependency: perl(DBI) <span style="color: #0000FF;">for package: MysqL---> Package MysqL-server.i386 <span style="color: #800080;">0:<span style="color: #800080;">5.0.<span style="color: #800080;">95-<span style="color: #800080;">1.el5_7.<span style="color: #800080;">1 set to be updated--> Processing Dependency: perl-DBD-MysqL <span style="color: #0000FF;">for package: MysqL-server---> Package PHP.i386 <span style="color: #800080;">0:<span style="color: #800080;">5.1.<span style="color: #800080;">6-<span style="color: #800080;">27.el5_7.<span style="color: #800080;">5 set to be updated--> Processing Dependency: PHP-cli = <span style="color: #800080;">5.1.<span style="color: #800080;">6-<span style="color: #800080;">27.el5_7.<span style="color: #800080;">5 <span style="color: #0000FF;">for package: PHP--> Processing Dependency: PHP-common = <span style="color: #800080;">5.1.<span style="color: #800080;">6-<span style="color: #800080;">27.el5_7.<span style="color: #800080;">5 <span style="color: #0000FF;">for package: PHP---> Package PHP-devel.i386 <span style="color: #800080;">0:<span style="color: #800080;">5.1.<span style="color: #800080;">6-<span style="color: #800080;">27.el5_7.<span style="color: #800080;">5 set to be updated--> Processing Dependency: autoconf <span style="color: #0000FF;">for package: PHP-devel--> Processing Dependency: automake <span style="color: #0000FF;">for package: PHP-devel---> Package PHP-MysqL.i386 <span style="color: #800080;">0:<span style="color: #800080;">5.1.<span style="color: #800080;">6-<span style="color: #800080;">27.el5_7.<span style="color: #800080;">5 set to be updated--> Processing Dependency: PHP-pdo <span style="color: #0000FF;">for package: PHP-MysqL--> Running transaction check---> Package autoconf.noarch <span style="color: #800080;">0:<span style="color: #800080;">2.59-<span style="color: #800080;">12 set to be updated--> Processing Dependency: imake <span style="color: #0000FF;">for package: autoconf---> Package automake.noarch <span style="color: #800080;">0:<span style="color: #800080;">1.9.<span style="color: #800080;">6-<span style="color: #800080;">2.3.el5 set to be updated---> Package perl-DBD-MysqL.i386 <span style="color: #800080;">0:<span style="color: #800080;">3.0007-<span style="color: #800080;">2.el5 set to be updated---> Package perl-DBI.i386 <span style="color: #800080;">0:<span style="color: #800080;">1.52-<span style="color: #800080;">2.el5 set to be updated---> Package PHP-cli.i386 <span style="color: #800080;">0:<span style="color: #800080;">5.1.<span style="color: #800080;">6-<span style="color: #800080;">27.el5_7.<span style="color: #800080;">5 set to be updated---> Package PHP-common.i386 <span style="color: #800080;">0:<span style="color: #800080;">5.1.<span style="color: #800080;">6-<span style="color: #800080;">27.el5_7.<span style="color: #800080;">5 set to be updated---> Package PHP-pdo.i386 <span style="color: #800080;">0:<span style="color: #800080;">5.1.<span style="color: #800080;">6-<span style="color: #800080;">27.el5_7.<span style="color: #800080;">5 set to be updated--> Running transaction check---> Package imake.i386 <span style="color: #800080;">0:<span style="color: #800080;">1.0.<span style="color: #800080;">2-<span style="color: #800080;">3 set to be updated--> Finished Dependency ResolutionDependencies Resolved================================================================================ Package             Arch        Version                     Repository    Size================================================================================Installing: MysqL               i386        <span style="color: #800080;">5.0.<span style="color: #800080;">95-<span style="color: #800080;">1.el5_7.<span style="color: #800080;">1            updates      <span style="color: #800080;">4.9 M MysqL-server        i386        <span style="color: #800080;">5.0.<span style="color: #800080;">95-<span style="color: #800080;">1.el5_7.<span style="color: #800080;">1            updates      <span style="color: #800080;">9.8 M PHP                 i386        <span style="color: #800080;">5.1.<span style="color: #800080;">6-<span style="color: #800080;">27.el5_7.<span style="color: #800080;">5            updates      <span style="color: #800080;">2.3 M PHP-devel           i386        <span style="color: #800080;">5.1.<span style="color: #800080;">6-<span style="color: #800080;">27.el5_7.<span style="color: #800080;">5            updates      <span style="color: #800080;">504 k PHP-MysqL           i386        <span style="color: #800080;">5.1.<span style="color: #800080;">6-<span style="color: #800080;">27.el5_7.<span style="color: #800080;">5            updates       <span style="color: #800080;">86 kUpdating: httpd               i386        <span style="color: #800080;">2.2.<span style="color: #800080;">3-<span style="color: #800080;">53.el5.centos.<span style="color: #800080;">3       updates      <span style="color: #800080;">1.2 MInstalling <span style="color: #0000FF;">for dependencies: autoconf            noarch      <span style="color: #800080;">2.59-<span style="color: #800080;">12                     base         <span style="color: #800080;">647 k automake            noarch      <span style="color: #800080;">1.9.<span style="color: #800080;">6-<span style="color: #800080;">2.3.el5               base         <span style="color: #800080;">476 k imake               i386        <span style="color: #800080;">1.0.<span style="color: #800080;">2-<span style="color: #800080;">3                     base         <span style="color: #800080;">319 k perl-DBD-MysqL      i386        <span style="color: #800080;">3.0007-<span style="color: #800080;">2.el5                base         <span style="color: #800080;">148 k perl-DBI            i386        <span style="color: #800080;">1.52-<span style="color: #800080;">2.el5                  base         <span style="color: #800080;">600 k PHP-cli             i386        <span style="color: #800080;">5.1.<span style="color: #800080;">6-<span style="color: #800080;">27.el5_7.<span style="color: #800080;">5            updates      <span style="color: #800080;">2.1 M PHP-common          i386        <span style="color: #800080;">5.1.<span style="color: #800080;">6-<span style="color: #800080;">27.el5_7.<span style="color: #800080;">5            updates      <span style="color: #800080;">153 k PHP-pdo             i386        <span style="color: #800080;">5.1.<span style="color: #800080;">6-<span style="color: #800080;">27.el5_7.<span style="color: #800080;">5            updates       <span style="color: #800080;">65 kTransaction Summary================================================================================Install      <span style="color: #800080;">13 Package(s)Upgrade       <span style="color: #800080;">1 Package(s)Total download size: <span style="color: #800080;">23 MDownloading Packages:(<span style="color: #800080;">1/<span style="color: #800080;">14): PHP-pdo-<span style="color: #800080;">5.1.<span style="color: #800080;">6-<span style="color: #800080;">27.el5_7.<span style="color: #800080;">5.i386.rpm                |  <span style="color: #800080;">65 kB     <span style="color: #800080;">00:<span style="color: #800080;">00     (<span style="color: #800080;">2/<span style="color: #800080;">14): PHP-MysqL-<span style="color: #800080;">5.1.<span style="color: #800080;">6-<span style="color: #800080;">27.el5_7.<span style="color: #800080;">5.i386.rpm              |  <span style="color: #800080;">86 kB     <span style="color: #800080;">00:<span style="color: #800080;">00     (<span style="color: #800080;">3/<span style="color: #800080;">14): perl-DBD-MysqL-<span style="color: #800080;">3.0007-<span style="color: #800080;">2.el5.i386.rpm             | <span style="color: #800080;">148 kB     <span style="color: #800080;">00:<span style="color: #800080;">00     (<span style="color: #800080;">4/<span style="color: #800080;">14): PHP-common-<span style="color: #800080;">5.1.<span style="color: #800080;">6-<span style="color: #800080;">27.el5_7.<span style="color: #800080;">5.i386.rpm             | <span style="color: #800080;">153 kB     <span style="color: #800080;">00:<span style="color: #800080;">00     (<span style="color: #800080;">5/<span style="color: #800080;">14): imake-<span style="color: #800080;">1.0.<span style="color: #800080;">2-<span style="color: #800080;">3.i386.rpm                           | <span style="color: #800080;">319 kB     <span style="color: #800080;">00:<span style="color: #800080;">01     (<span style="color: #800080;">6/<span style="color: #800080;">14): automake-<span style="color: #800080;">1.9.<span style="color: #800080;">6-<span style="color: #800080;">2.3.el5.noarch.rpm                | <span style="color: #800080;">476 kB     <span style="color: #800080;">00:<span style="color: #800080;">02     (<span style="color: #800080;">7/<span style="color: #800080;">14): PHP-devel-<span style="color: #800080;">5.1.<span style="color: #800080;">6-<span style="color: #800080;">27.el5_7.<span style="color: #800080;">5.i386.rpm              | <span style="color: #800080;">504 kB     <span style="color: #800080;">00:<span style="color: #800080;">02     (<span style="color: #800080;">8/<span style="color: #800080;">14): perl-DBI-<span style="color: #800080;">1.52-<span style="color: #800080;">2.el5.i386.rpm                     | <span style="color: #800080;">600 kB     <span style="color: #800080;">00:<span style="color: #800080;">02     (<span style="color: #800080;">9/<span style="color: #800080;">14): autoconf-<span style="color: #800080;">2.59-<span style="color: #800080;">12.noarch.rpm                      | <span style="color: #800080;">647 kB     <span style="color: #800080;">00:<span style="color: #800080;">02     (<span style="color: #800080;">10/<span style="color: #800080;">14): httpd-<span style="color: #800080;">2.2.<span style="color: #800080;">3-<span style="color: #800080;">53.el5.centos.<span style="color: #800080;">3.i386.rpm            | <span style="color: #800080;">1.2 MB     <span style="color: #800080;">00:<span style="color: #800080;">05     (<span style="color: #800080;">11/<span style="color: #800080;">14): PHP-cli-<span style="color: #800080;">5.1.<span style="color: #800080;">6-<span style="color: #800080;">27.el5_7.<span style="color: #800080;">5.i386.rpm               | <span style="color: #800080;">2.1 MB     <span style="color: #800080;">00:<span style="color: #800080;">07     (<span style="color: #800080;">12/<span style="color: #800080;">14): PHP-<span style="color: #800080;">5.1.<span style="color: #800080;">6-<span style="color: #800080;">27.el5_7.<span style="color: #800080;">5.i386.rpm                   | <span style="color: #800080;">2.3 MB     <span style="color: #800080;">00:<span style="color: #800080;">08     (<span style="color: #800080;">13/<span style="color: #800080;">14): MysqL-<span style="color: #800080;">5.0.<span style="color: #800080;">95-<span style="color: #800080;">1.el5_7.<span style="color: #800080;">1.i386.rpm                 | <span style="color: #800080;">4.9 MB     <span style="color: #800080;">00:<span style="color: #800080;">18     (<span style="color: #800080;">14/<span style="color: #800080;">14): MysqL-server-<span style="color: #800080;">5.0.<span style="color: #800080;">95-<span style="color: #800080;">1.el5_7.<span style="color: #800080;">1.i386.rpm          | <span style="color: #800080;">9.8 MB     <span style="color: #800080;">00:<span style="color: #800080;">39     --------------------------------------------------------------------------------Total                                           <span style="color: #800080;">256 kB/s |  <span style="color: #800080;">23 MB     <span style="color: #800080;">01:<span style="color: #800080;">32     Running rpm_check_debugRunning Transaction TestFinished Transaction TestTransaction Test SucceededRunning Transaction  Installing     : PHP-common                                              <span style="color: #800080;">1/<span style="color: #800080;">15   Installing     : perl-DBI                                                <span style="color: #800080;">2/<span style="color: #800080;">15   Installing     : MysqL                                                   <span style="color: #800080;">3/<span style="color: #800080;">15   Installing     : perl-DBD-MysqL                                          <span style="color: #800080;">4/<span style="color: #800080;">15   Installing     : PHP-pdo                                                 <span style="color: #800080;">5/<span style="color: #800080;">15   Installing     : PHP-cli                                                 <span style="color: #800080;">6/<span style="color: #800080;">15   Installing     : imake                                                   <span style="color: #800080;">7/<span style="color: #800080;">15   Updating       : httpd                                                   <span style="color: #800080;">8/<span style="color: #800080;">15   Installing     : PHP                                                     <span style="color: #800080;">9/<span style="color: #800080;">15   Installing     : PHP-MysqL                                              <span style="color: #800080;">10/<span style="color: #800080;">15   Installing     : MysqL-server                                           <span style="color: #800080;">11/<span style="color: #800080;">15   Installing     : autoconf                                               <span style="color: #800080;">12/<span style="color: #800080;">15   Installing     : automake                                               <span style="color: #800080;">13/<span style="color: #800080;">15   Installing     : PHP-devel                                              <span style="color: #800080;">14/<span style="color: #800080;">15   Cleanup        : httpd                                                  <span style="color: #800080;">15/<span style="color: #800080;">15 Installed:  MysqL.i386 <span style="color: #800080;">0:<span style="color: #800080;">5.0.<span style="color: #800080;">95-<span style="color: #800080;">1.el5_7.<span style="color: #800080;">1         MysqL-server.i386 <span style="color: #800080;">0:<span style="color: #800080;">5.0.<span style="color: #800080;">95-<span style="color: #800080;">1.el5_7.<span style="color: #800080;">1      PHP.i386 <span style="color: #800080;">0:<span style="color: #800080;">5.1.<span style="color: #800080;">6-<span style="color: #800080;">27.el5_7.<span style="color: #800080;">5           PHP-devel.i386 <span style="color: #800080;">0:<span style="color: #800080;">5.1.<span style="color: #800080;">6-<span style="color: #800080;">27.el5_7.<span style="color: #800080;">5         PHP-MysqL.i386 <span style="color: #800080;">0:<span style="color: #800080;">5.1.<span style="color: #800080;">6-<span style="color: #800080;">27.el5_7.<span style="color: #800080;">5    Dependency Installed:  autoconf.noarch <span style="color: #800080;">0:<span style="color: #800080;">2.59-<span style="color: #800080;">12              automake.noarch <span style="color: #800080;">0:<span style="color: #800080;">1.9.<span style="color: #800080;">6-<span style="color: #800080;">2.3.el5         imake.i386 <span style="color: #800080;">0:<span style="color: #800080;">1.0.<span style="color: #800080;">2-<span style="color: #800080;">3                   perl-DBD-MysqL.i386 <span style="color: #800080;">0:<span style="color: #800080;">3.0007-<span style="color: #800080;">2.el5      perl-DBI.i386 <span style="color: #800080;">0:<span style="color: #800080;">1.52-<span style="color: #800080;">2.el5             PHP-cli.i386 <span style="color: #800080;">0:<span style="color: #800080;">5.1.<span style="color: #800080;">6-<span style="color: #800080;">27.el5_7.<span style="color: #800080;">5         PHP-common.i386 <span style="color: #800080;">0:<span style="color: #800080;">5.1.<span style="color: #800080;">6-<span style="color: #800080;">27.el5_7.<span style="color: #800080;">5     PHP-pdo.i386 <span style="color: #800080;">0:<span style="color: #800080;">5.1.<span style="color: #800080;">6-<span style="color: #800080;">27.el5_7.<span style="color: #800080;">5       Updated:  httpd.i386 <span style="color: #800080;">0:<span style="color: #800080;">2.2.<span style="color: #800080;">3-<span style="color: #800080;">53.el5.centos.<span style="color: #800080;">3                                            Complete![root@localhost ~]#

<div class="cnblogs_code">

[root@localhost ~]# chkconfig httpd on[root@localhost ~]# chkconfig --add MysqLd[root@localhost ~]# chkconfig MysqLd on[root@localhost ~]# service httpd start启动 httpd:                                               [确定][root@localhost ~]# service MysqLd start初始化 MysqL 数据库: Installing MysqL system tables...OKFilling help tables...OKTo start MysqLd at boot <span style="color: #0000FF;">time you have to copysupport-files/MysqL.server to the right place <span style="color: #0000FF;">for your systemPLEASE REMEMBER TO SET A PASSWORD FOR THE MysqL root USER !To do so, start the server, then issue the following commands:/usr/bin/MysqLadmin -u root password <span style="color: #800000;">'<span style="color: #800000;">new-password<span style="color: #800000;">'/usr/bin/MysqLadmin -u root -h localhost.localdomain password <span style="color: #800000;">'<span style="color: #800000;">new-password<span style="color: #800000;">'Alternatively you can run:/usr/bin/MysqL_secure_installationwhich will also give you the option of removing the testdatabases <span style="color: #0000FF;">and anonymous user created by <span style="color: #0000FF;">default.  This isstrongly recommended <span style="color: #0000FF;">for production servers.See the manual <span style="color: #0000FF;">for more instructions.You can start the MysqL daemon with:cd /usr ; /usr/bin/MysqLd_safe &You can test the MysqL daemon with MysqL-test-run.plcd MysqL-test ; perl MysqL-test-run.plPlease report any problems with the /usr/bin/MysqLbug script!The latest information about MysqL is available on the web athttp:<span style="color: #008000;">//<span style="color: #008000;">www.MysqL.com<span style="color: #008000;">Support MysqL by buying support/licenses at http:<span style="color: #008000;">//<span style="color: #008000;">shop.MysqL.com<span style="color: #008000;">                                                           [确定]启动 MysqL:                                               [确定][root@localhost ~]#

猜你在找的CentOS相关文章