zoukankan      html  css  js  c++  java
  • linux centos apache+php+mysql 安装

    [root@localhost ~]# yum -y update
    Loaded plugins: fastestmirror
    Loading mirror speeds from cached hostfile
     * base: mirrors.ta139.com
     * extras: mirrors.ta139.com
     * updates: mirrors.ta139.com
    Setting up Update Process
    No Packages marked for Update
    [root@localhost ~]# yum -y install httpd php mysql mysql-server php-mysql httpd-manual  mod_ssl mod_perl mod_auth_mysql php-mcrypt php-gd php-xml php-mbstring  php-ldap php-pear php-xmlrpc mysql-connector-odbc mysql-devel  libdbi-dbd-mysql
    Loaded plugins: fastestmirror
    Loading mirror speeds from cached hostfile
     * base: mirrors.ta139.com
     * extras: mirrors.ta139.com
     * updates: mirrors.ta139.com
    Setting up Install Process
    Package httpd-2.2.3-45.el5.centos.1.i386 already installed and latest version
    Resolving Dependencies
    --> Running transaction check
    ---> Package httpd-manual.i386 0:2.2.3-45.el5.centos.1 set to be updated
    ---> Package libdbi-dbd-mysql.i386 0:0.8.1a-1.2.2 set to be updated
    --> Processing Dependency: libdbi-drivers = 0.8.1a-1.2.2 for package: libdbi-dbd-mysql
    ---> Package mod_auth_mysql.i386 1:3.0.0-3.2.el5_3 set to be updated
    ---> Package mod_perl.i386 0:2.0.4-6.el5 set to be updated
    --> Processing Dependency: perl(BSD::Resource) for package: mod_perl
    ---> Package mod_ssl.i386 1:2.2.3-45.el5.centos.1 set to be updated
    --> Processing Dependency: libdistcache.so.1 for package: mod_ssl
    --> Processing Dependency: libnal.so.1 for package: mod_ssl
    ---> Package mysql.i386 0:5.0.77-4.el5_6.6 set to be updated
    --> Processing Dependency: perl(DBI) for package: mysql
    ---> Package mysql-connector-odbc.i386 0:3.51.26r1127-1.el5 set to be updated
    --> Processing Dependency: libodbcinst.so.1 for package: mysql-connector-odbc
    --> Processing Dependency: unixODBC for package: mysql-connector-odbc
    ---> Package mysql-devel.i386 0:5.0.77-4.el5_6.6 set to be updated
    --> Processing Dependency: openssl-devel for package: mysql-devel
    ---> Package mysql-server.i386 0:5.0.77-4.el5_6.6 set to be updated
    --> Processing Dependency: perl-DBD-MySQL for package: mysql-server
    ---> Package php.i386 0:5.1.6-27.el5_5.3 set to be updated
    --> Processing Dependency: php-common = 5.1.6-27.el5_5.3 for package: php
    --> Processing Dependency: php-cli = 5.1.6-27.el5_5.3 for package: php
    ---> Package php-gd.i386 0:5.1.6-27.el5_5.3 set to be updated
    ---> Package php-ldap.i386 0:5.1.6-27.el5_5.3 set to be updated
    ---> Package php-mbstring.i386 0:5.1.6-27.el5_5.3 set to be updated
    ---> Package php-mcrypt.i386 0:5.1.6-15.el5.centos.1 set to be updated
    --> Processing Dependency: libmcrypt.so.4 for package: php-mcrypt
    ---> Package php-mysql.i386 0:5.1.6-27.el5_5.3 set to be updated
    --> Processing Dependency: php-pdo for package: php-mysql
    ---> Package php-pear.noarch 1:1.4.9-6.el5 set to be updated
    --> Processing Dependency: php-devel for package: php-pear
    ---> Package php-xml.i386 0:5.1.6-27.el5_5.3 set to be updated
    ---> Package php-xmlrpc.i386 0:5.1.6-27.el5_5.3 set to be updated
    --> Running transaction check
    ---> Package distcache.i386 0:1.4.5-14.1 set to be updated
    ---> Package libdbi-drivers.i386 0:0.8.1a-1.2.2 set to be updated
    --> Processing Dependency: libdbi >= 0.8 for package: libdbi-drivers
    ---> Package libmcrypt.i386 0:2.5.8-4.el5.centos set to be updated
    ---> Package openssl-devel.i386 0:0.9.8e-12.el5_5.7 set to be updated
    --> Processing Dependency: zlib-devel for package: openssl-devel
    --> Processing Dependency: krb5-devel for package: openssl-devel
    ---> Package perl-BSD-Resource.i386 0:1.28-1.fc6.1 set to be updated
    ---> Package perl-DBD-MySQL.i386 0:3.0007-2.el5 set to be updated
    ---> Package perl-DBI.i386 0:1.52-2.el5 set to be updated
    ---> Package php-cli.i386 0:5.1.6-27.el5_5.3 set to be updated
    ---> Package php-common.i386 0:5.1.6-27.el5_5.3 set to be updated
    ---> Package php-devel.i386 0:5.1.6-27.el5_5.3 set to be updated
    --> Processing Dependency: autoconf for package: php-devel
    --> Processing Dependency: automake for package: php-devel
    ---> Package php-pdo.i386 0:5.1.6-27.el5_5.3 set to be updated
    ---> Package unixODBC.i386 0:2.2.11-7.1 set to be updated
    --> Running transaction check
    ---> Package autoconf.noarch 0:2.59-12 set to be updated
    --> Processing Dependency: imake for package: autoconf
    ---> Package automake.noarch 0:1.9.6-2.3.el5 set to be updated
    ---> Package krb5-devel.i386 0:1.6.1-55.el5_6.2 set to be updated
    --> Processing Dependency: libselinux-devel for package: krb5-devel
    --> Processing Dependency: e2fsprogs-devel for package: krb5-devel
    --> Processing Dependency: keyutils-libs-devel for package: krb5-devel
    ---> Package libdbi.i386 0:0.8.1-2.1 set to be updated
    ---> Package zlib-devel.i386 0:1.2.3-3 set to be updated
    --> Running transaction check
    ---> Package e2fsprogs-devel.i386 0:1.39-23.el5_5.1 set to be updated
    ---> Package imake.i386 0:1.0.2-3 set to be updated
    ---> Package keyutils-libs-devel.i386 0:1.2-1.el5 set to be updated
    ---> Package libselinux-devel.i386 0:1.33.4-5.7.el5 set to be updated
    --> Processing Dependency: libsepol-devel >= 1.15.2-1 for package: libselinux-devel
    --> Running transaction check
    ---> Package libsepol-devel.i386 0:1.15.2-3.el5 set to be updated
    --> Finished Dependency Resolution

    Dependencies Resolved

    ================================================================================
     Package                 Arch      Version                     Repository  Size
    ================================================================================
    Installing:
     httpd-manual            i386      2.2.3-45.el5.centos.1       updates    814 k
     libdbi-dbd-mysql        i386      0.8.1a-1.2.2                base        17 k
     mod_auth_mysql          i386      1:3.0.0-3.2.el5_3           base        22 k
     mod_perl                i386      2.0.4-6.el5                 base       4.0 M
     mod_ssl                 i386      1:2.2.3-45.el5.centos.1     updates     92 k
     mysql                   i386      5.0.77-4.el5_6.6            updates    4.8 M
     mysql-connector-odbc    i386      3.51.26r1127-1.el5          base       159 k
     mysql-devel             i386      5.0.77-4.el5_6.6            updates    2.4 M
     mysql-server            i386      5.0.77-4.el5_6.6            updates    9.8 M
     php                     i386      5.1.6-27.el5_5.3            base       2.3 M
     php-gd                  i386      5.1.6-27.el5_5.3            base       117 k
     php-ldap                i386      5.1.6-27.el5_5.3            base        37 k
     php-mbstring            i386      5.1.6-27.el5_5.3            base       995 k
     php-mcrypt              i386      5.1.6-15.el5.centos.1       extras      16 k
     php-mysql               i386      5.1.6-27.el5_5.3            base        86 k
     php-pear                noarch    1:1.4.9-6.el5               base       344 k
     php-xml                 i386      5.1.6-27.el5_5.3            base        97 k
     php-xmlrpc              i386      5.1.6-27.el5_5.3            base        58 k
    Installing for dependencies:
     autoconf                noarch    2.59-12                     base       647 k
     automake                noarch    1.9.6-2.3.el5               base       476 k
     distcache               i386      1.4.5-14.1                  base       119 k
     e2fsprogs-devel         i386      1.39-23.el5_5.1             base       569 k
     imake                   i386      1.0.2-3                     base       319 k
     keyutils-libs-devel     i386      1.2-1.el5                   base        27 k
     krb5-devel              i386      1.6.1-55.el5_6.2            updates    1.9 M
     libdbi                  i386      0.8.1-2.1                   base        35 k
     libdbi-drivers          i386      0.8.1a-1.2.2                base        14 k
     libmcrypt               i386      2.5.8-4.el5.centos          extras     116 k
     libselinux-devel        i386      1.33.4-5.7.el5              base       144 k
     libsepol-devel          i386      1.15.2-3.el5                base       187 k
     openssl-devel           i386      0.9.8e-12.el5_5.7           base       1.9 M
     perl-BSD-Resource       i386      1.28-1.fc6.1                base        29 k
     perl-DBD-MySQL          i386      3.0007-2.el5                base       148 k
     perl-DBI                i386      1.52-2.el5                  base       600 k
     php-cli                 i386      5.1.6-27.el5_5.3            base       2.1 M
     php-common              i386      5.1.6-27.el5_5.3            base       153 k
     php-devel               i386      5.1.6-27.el5_5.3            base       503 k
     php-pdo                 i386      5.1.6-27.el5_5.3            base        65 k
     unixODBC                i386      2.2.11-7.1                  base       832 k
     zlib-devel              i386      1.2.3-3                     base       101 k

    Transaction Summary
    ================================================================================
    Install      40 Package(s)
    Upgrade       0 Package(s)

    Total download size: 37 M
    Downloading Packages:
    (1/40): libdbi-drivers-0.8.1a-1.2.2.i386.rpm             |  14 kB     00:00    
    (2/40): php-mcrypt-5.1.6-15.el5.centos.1.i386.rpm        |  16 kB     00:00    
    (3/40): libdbi-dbd-mysql-0.8.1a-1.2.2.i386.rpm           |  17 kB     00:00    
    (4/40): mod_auth_mysql-3.0.0-3.2.el5_3.i386.rpm          |  22 kB     00:00    
    (5/40): keyutils-libs-devel-1.2-1.el5.i386.rpm           |  27 kB     00:00    
    (6/40): perl-BSD-Resource-1.28-1.fc6.1.i386.rpm          |  29 kB     00:00    
    (7/40): libdbi-0.8.1-2.1.i386.rpm                        |  35 kB     00:00    
    (8/40): php-ldap-5.1.6-27.el5_5.3.i386.rpm               |  37 kB     00:00    
    (9/40): php-xmlrpc-5.1.6-27.el5_5.3.i386.rpm             |  58 kB     00:00    
    (10/40): php-pdo-5.1.6-27.el5_5.3.i386.rpm               |  65 kB     00:00    
    (11/40): php-mysql-5.1.6-27.el5_5.3.i386.rpm             |  86 kB     00:00    
    (12/40): mod_ssl-2.2.3-45.el5.centos.1.i386.rpm          |  92 kB     00:00    
    (13/40): php-xml-5.1.6-27.el5_5.3.i386.rpm               |  97 kB     00:00    
    (14/40): zlib-devel-1.2.3-3.i386.rpm                     | 101 kB     00:00    
    (15/40): libmcrypt-2.5.8-4.el5.centos.i386.rpm           | 116 kB     00:00    
    (16/40): php-gd-5.1.6-27.el5_5.3.i386.rpm                | 117 kB     00:00    
    (17/40): distcache-1.4.5-14.1.i386.rpm                   | 119 kB     00:00    
    (18/40): libselinux-devel-1.33.4-5.7.el5.i386.rpm        | 144 kB     00:00    
    (19/40): perl-DBD-MySQL-3.0007-2.el5.i386.rpm            | 148 kB     00:00    
    (20/40): php-common-5.1.6-27.el5_5.3.i386.rpm            | 153 kB     00:00    
    (21/40): mysql-connector-odbc-3.51.26r1127-1.el5.i386.rp | 159 kB     00:00    
    (22/40): libsepol-devel-1.15.2-3.el5.i386.rpm            | 187 kB     00:00    
    (23/40): imake-1.0.2-3.i386.rpm                          | 319 kB     00:00    
    (24/40): php-pear-1.4.9-6.el5.noarch.rpm                 | 344 kB     00:00    
    (25/40): automake-1.9.6-2.3.el5.noarch.rpm               | 476 kB     00:00    
    (26/40): php-devel-5.1.6-27.el5_5.3.i386.rpm             | 503 kB     00:00    
    (27/40): e2fsprogs-devel-1.39-23.el5_5.1.i386.rpm        | 569 kB     00:00    
    (28/40): perl-DBI-1.52-2.el5.i386.rpm                    | 600 kB     00:00    
    (29/40): autoconf-2.59-12.noarch.rpm                     | 647 kB     00:00    
    (30/40): httpd-manual-2.2.3-45.el5.centos.1.i386.rpm     | 814 kB     00:00    
    (31/40): unixODBC-2.2.11-7.1.i386.rpm                    | 832 kB     00:00    
    (32/40): php-mbstring-5.1.6-27.el5_5.3.i386.rpm          | 995 kB     00:00    
    (33/40): krb5-devel-1.6.1-55.el5_6.2.i386.rpm            | 1.9 MB     00:01    
    (34/40): openssl-devel-0.9.8e-12.el5_5.7.i386.rpm        | 1.9 MB     00:00    
    (35/40): php-cli-5.1.6-27.el5_5.3.i386.rpm               | 2.1 MB     00:00    
    (36/40): php-5.1.6-27.el5_5.3.i386.rpm                   | 2.3 MB     00:00    
    (37/40): mysql-devel-5.0.77-4.el5_6.6.i386.rpm           | 2.4 MB     00:01    
    (38/40): mod_perl-2.0.4-6.el5.i386.rpm                   | 4.0 MB     00:01    
    (39/40): mysql-5.0.77-4.el5_6.6.i386.rpm                 | 4.8 MB     00:02    
    (40/40): mysql-server-5.0.77-4.el5_6.6.i386.rpm          | 9.8 MB     00:05    
    --------------------------------------------------------------------------------
    Total                                           1.0 MB/s |  37 MB     00:36    
    Running rpm_check_debug
    Running Transaction Test
    Finished Transaction Test
    Transaction Test Succeeded
    Running Transaction
      Installing     : e2fsprogs-devel                                         1/40
      Installing     : libsepol-devel                                          2/40
      Installing     : libselinux-devel                                        3/40
      Installing     : keyutils-libs-devel                                     4/40
      Installing     : zlib-devel                                              5/40
      Installing     : php-common                                              6/40
      Installing     : perl-DBI                                                7/40
      Installing     : mysql                                                   8/40
      Installing     : php-cli                                                 9/40
      Installing     : php                                                    10/40
      Installing     : perl-DBD-MySQL                                         11/40
      Installing     : php-pdo                                                12/40
      Installing     : krb5-devel                                             13/40
      Installing     : libmcrypt                                              14/40
      Installing     : unixODBC                                               15/40
      Installing     : distcache                                              16/40
      Installing     : libdbi                                                 17/40
      Installing     : perl-BSD-Resource                                      18/40
      Installing     : imake                                                  19/40
      Installing     : autoconf                                               20/40
      Installing     : automake                                               21/40
      Installing     : php-devel                                              22/40
      Installing     : libdbi-drivers                                         23/40
      Installing     : openssl-devel                                          24/40
      Installing     : php-gd                                                 25/40
      Installing     : php-mysql                                              26/40
      Installing     : php-mcrypt                                             27/40
      Installing     : php-xml                                                28/40
      Installing     : php-mbstring                                           29/40
      Installing     : mod_ssl                                                30/40
      Installing     : mysql-connector-odbc                                   31/40
      Installing     : libdbi-dbd-mysql                                       32/40
      Installing     : mysql-devel                                            33/40
      Installing     : mod_auth_mysql                                         34/40
      Installing     : mod_perl                                               35/40
      Installing     : php-xmlrpc                                             36/40
      Installing     : mysql-server                                           37/40
      Installing     : php-ldap                                               38/40
      Installing     : httpd-manual                                           39/40
      Installing     : php-pear                                               40/40

    Installed:
      httpd-manual.i386 0:2.2.3-45.el5.centos.1                                    
      libdbi-dbd-mysql.i386 0:0.8.1a-1.2.2                                         
      mod_auth_mysql.i386 1:3.0.0-3.2.el5_3                                        
      mod_perl.i386 0:2.0.4-6.el5                                                  
      mod_ssl.i386 1:2.2.3-45.el5.centos.1                                         
      mysql.i386 0:5.0.77-4.el5_6.6                                                
      mysql-connector-odbc.i386 0:3.51.26r1127-1.el5                               
      mysql-devel.i386 0:5.0.77-4.el5_6.6                                          
      mysql-server.i386 0:5.0.77-4.el5_6.6                                         
      php.i386 0:5.1.6-27.el5_5.3                                                  
      php-gd.i386 0:5.1.6-27.el5_5.3                                               
      php-ldap.i386 0:5.1.6-27.el5_5.3                                             
      php-mbstring.i386 0:5.1.6-27.el5_5.3                                         
      php-mcrypt.i386 0:5.1.6-15.el5.centos.1                                      
      php-mysql.i386 0:5.1.6-27.el5_5.3                                            
      php-pear.noarch 1:1.4.9-6.el5                                                
      php-xml.i386 0:5.1.6-27.el5_5.3                                              
      php-xmlrpc.i386 0:5.1.6-27.el5_5.3                                           

    Dependency Installed:
      autoconf.noarch 0:2.59-12              automake.noarch 0:1.9.6-2.3.el5      
      distcache.i386 0:1.4.5-14.1            e2fsprogs-devel.i386 0:1.39-23.el5_5.1
      imake.i386 0:1.0.2-3                   keyutils-libs-devel.i386 0:1.2-1.el5 
      krb5-devel.i386 0:1.6.1-55.el5_6.2     libdbi.i386 0:0.8.1-2.1              
      libdbi-drivers.i386 0:0.8.1a-1.2.2     libmcrypt.i386 0:2.5.8-4.el5.centos  
      libselinux-devel.i386 0:1.33.4-5.7.el5 libsepol-devel.i386 0:1.15.2-3.el5   
      openssl-devel.i386 0:0.9.8e-12.el5_5.7 perl-BSD-Resource.i386 0:1.28-1.fc6.1
      perl-DBD-MySQL.i386 0:3.0007-2.el5     perl-DBI.i386 0:1.52-2.el5           
      php-cli.i386 0:5.1.6-27.el5_5.3        php-common.i386 0:5.1.6-27.el5_5.3   
      php-devel.i386 0:5.1.6-27.el5_5.3      php-pdo.i386 0:5.1.6-27.el5_5.3      
      unixODBC.i386 0:2.2.11-7.1             zlib-devel.i386 0:1.2.3-3            

    Complete!
    [root@localhost ~]#

    ===========================土豆的华丽分割线================================

    [root@localhost html]# lsb_release -a
    LSB Version: :core-3.1-ia32:core-3.1-noarch:graphics-3.1-ia32:graphics-3.1-noarch
    Distributor ID: CentOS
    Description: CentOS release 5.5 (Final)
    Release: 5.5  (貌似原来是5.3)
    Codename: Final

    1.yum -y update  (家的网速慢 更新了很久..很久... )

    2.yum -y install httpd php mysql mysql-server php-mysql httpd-manual  mod_ssl mod_perl mod_auth_mysql php-mcrypt php-gd php-xml php-mbstring  php-ldap php-pear php-xmlrpc mysql-connector-odbc mysql-devel  libdbi-dbd-mysql(一句话就OK 了)


    3.启动apache 和 mysql

    service httpd start

    service mysqld start

    4.设置apache , mysql 自启动

    chkconfig httpd on

    chkconfig mysqld on


    5.配置mysql

    mysqladmin -u root password '你的密码'

     IP访问 211.103.156.121(自己的IP)  访问的是 /var/www/html 这个文件夹  

    apache 路径

    [root@localhost local]# cd /etc/httpd  

    my.cnf  在/etc/my.cnf

    php.ini 在/etc/php.ini
    可以用 find 查找my.cnf 和php.ini 文件  

    find / -name my.cnf 

    find / -name 文件名称 

    问题 mysql 修改密码 mysqladmin 不能使用

    [root@localhost etc]# find / -name mysqladmin

    /usr/local/mysql/bin/mysqladmin

    /data/mysql5/bin/mysqladmin

    /var/www/mysql-5.5.2-m2/client/mysqladmin

    [root@localhost etc]# /var/www/mysql-5.5.2-m2/client/mysqladmin -u root password 'zz'

  • 相关阅读:
    学习 Web 开发技术的16个最佳教程网站和博客
    将会改变未来IT世界的十种编程语言
    用来理解 Java 编程语言的 8 个图表
    花样Android ProgressBar
    Android控件TextProgressBar进度条上显文字
    ViewFlipper 在同一背景下 页面左右滑动
    Android自定义进度条-带文本(文字进度)的水平进度条(ProgressBar)
    android用户界面之GridView教程实例汇总
    禁止ScrollView在子控件的布局改变时自动滚动的的方法
    ListView中使用自定义Adapter及时更xin
  • 原文地址:https://www.cnblogs.com/ylqmf/p/2170087.html
Copyright © 2011-2022 走看看