安装apache

[root@centos share]# yum -y install httpd

Loaded plugins: fastestmirror, refresh-packagekit

Loading mirror speeds from cached hostfile

 * base: mirrors.yun-idc.com

 * extras: mirrors.yun-idc.com

 * updates: mirrors.pubyun.com

Setting up Install Process

Resolving Dependencies

--> Running transaction check

---> Package httpd.i686 0:2.2.15-31.el6.centos set to be updated

--> Processing Dependency: httpd-tools = 2.2.15-31.el6.centos for package: httpd-2.2.15-31.el6.centos.i686

--> Running transaction check

---> Package httpd-tools.i686 0:2.2.15-31.el6.centos set to be updated

--> Finished Dependency Resolution



Dependencies Resolved



========================================================================================================================

 Package                     Arch                 Version                                 Repository               Size

========================================================================================================================

Updating:

 httpd                       i686                 2.2.15-31.el6.centos                    updates                 828 k

Updating for dependencies:

 httpd-tools                 i686                 2.2.15-31.el6.centos                    updates                  74 k



Transaction Summary

========================================================================================================================

Install       0 Package(s)

Upgrade       2 Package(s)



Total download size: 902 k

Downloading Packages:

(1/2): httpd-2.2.15-31.el6.centos.i686.rpm                                                       | 828 kB     00:03     

(2/2): httpd-tools-2.2.15-31.el6.centos.i686.rpm                                                 |  74 kB     00:00     

------------------------------------------------------------------------------------------------------------------------

Total                                                                                   261 kB/s | 902 kB     00:03     

Running rpm_check_debug

Running Transaction Test

Transaction Test Succeeded

Running Transaction

  Updating       : httpd-tools-2.2.15-31.el6.centos.i686                                                            1/4


  Updating       : httpd-2.2.15-31.el6.centos.i686                                                                  2/4


  Cleanup        : httpd-2.2.15-5.el6.centos.i686                                                                   3/4


  Cleanup        : httpd-tools-2.2.15-5.el6.centos.i686                                                             4/4




Updated:

  httpd.i686 0:2.2.15-31.el6.centos                                                                                     



Dependency Updated:

  httpd-tools.i686 0:2.2.15-31.el6.centos                                                                               



Complete!

安装mysql

[root@centos etc]# whereis mysql

mysql: /usr/lib/mysql /usr/share/mysql

[root@centos etc]# rpm -qa|grep mysql

mysql-libs-5.1.73-3.el6_5.i686

[root@centos etc]# rpm -e mysql-libs-5.1.73-3.el6_5.i686 --nodeps 强制删除

[root@centos etc]# whereis mysql

mysql:

[root@centos httpd]# yum -y install mysql-server

Loaded plugins: fastestmirror, refresh-packagekit

Loading mirror speeds from cached hostfile

 * base: mirrors.yun-idc.com

 * extras: mirrors.yun-idc.com

 * updates: mirrors.pubyun.com

Setting up Install Process

Resolving Dependencies

--> Running transaction check

---> Package mysql-server.i686 0:5.1.73-3.el6_5 set to be updated

--> Processing Dependency: mysql = 5.1.73-3.el6_5 for package: mysql-server-5.1.73-3.el6_5.i686

--> Processing Dependency: perl-DBD-MySQL for package: mysql-server-5.1.73-3.el6_5.i686

--> Processing Dependency: libmysqlclient_r.so.16(libmysqlclient_16) for package: mysql-server-5.1.73-3.el6_5.i686

--> Processing Dependency: libmysqlclient_r.so.16 for package: mysql-server-5.1.73-3.el6_5.i686

--> Processing Dependency: libmysqlclient.so.16(libmysqlclient_16) for package: mysql-server-5.1.73-3.el6_5.i686

--> Processing Dependency: libmysqlclient.so.16 for package: mysql-server-5.1.73-3.el6_5.i686

--> Running transaction check

---> Package mysql.i686 0:5.1.73-3.el6_5 set to be updated

---> Package mysql-libs.i686 0:5.1.73-3.el6_5 set to be updated

---> Package perl-DBD-MySQL.i686 0:4.013-3.el6 set to be updated

--> Finished Dependency Resolution



Dependencies Resolved



========================================================================================================================

 Package                         Arch                  Version                           Repository                Size

========================================================================================================================

Installing:

 mysql-server                    i686                  5.1.73-3.el6_5                    updates                  8.8 M

Installing for dependencies:

 mysql                           i686                  5.1.73-3.el6_5                    updates                  903 k

 mysql-libs                      i686                  5.1.73-3.el6_5                    updates                  1.2 M

 perl-DBD-MySQL                  i686                  4.013-3.el6                       base                     134 k



Transaction Summary

========================================================================================================================

Install       4 Package(s)

Upgrade       0 Package(s)



Total download size: 11 M

Installed size: 31 M

Downloading Packages:

(1/4): mysql-5.1.73-3.el6_5.i686.rpm                                                             | 903 kB     00:03     

(2/4): mysql-libs-5.1.73-3.el6_5.i686.rpm                                                        | 1.2 MB     00:04     

(3/4): mysql-server-5.1.73-3.el6_5.i686.rpm                                                      | 8.8 MB     00:32     

(4/4): perl-DBD-MySQL-4.013-3.el6.i686.rpm                                                       | 134 kB     00:00     

------------------------------------------------------------------------------------------------------------------------

Total                                                                                   276 kB/s |  11 MB     00:40     

Running rpm_check_debug

Running Transaction Test

Transaction Test Succeeded

Running Transaction

  Installing     : mysql-libs-5.1.73-3.el6_5.i686                                                                   1/4


  Installing     : mysql-5.1.73-3.el6_5.i686                                                                        2/4


  Installing     : perl-DBD-MySQL-4.013-3.el6.i686                                                                  3/4


  Installing     : mysql-server-5.1.73-3.el6_5.i686                                                                 4/4




Installed:

  mysql-server.i686 0:5.1.73-3.el6_5                                                                                    



Dependency Installed:

  mysql.i686 0:5.1.73-3.el6_5         mysql-libs.i686 0:5.1.73-3.el6_5         perl-DBD-MySQL.i686 0:4.013-3.el6        



Complete!

[root@centos httpd]# mysql

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

[root@centos httpd]# whereis mysql

mysql: /usr/bin/mysql /usr/lib/mysql /usr/share/mysql /usr/share/man/man1/mysql.1.gz

[root@centos httpd]# cd /var/lib/mysql

[root@centos mysql]# ls -a

.  ..

[root@centos mysql]# service mysqld restart

停止 mysqld:                                              [确定]

初始化 MySQL 数据库: Installing MySQL system tables...

OK

Filling help tables...

OK



To start mysqld at boot time you have to copy

support-files/mysql.server to the right place for your system



PLEASE 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 'new-password'

/usr/bin/mysqladmin -u root -h centos password 'new-password'



Alternatively you can run:

/usr/bin/mysql_secure_installation



which will also give you the option of removing the test

databases and anonymous user created by default.  This is

strongly recommended for production servers.



See the manual 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.pl

cd /usr/mysql-test ; perl mysql-test-run.pl



Please report any problems with the /usr/bin/mysqlbug script!



                                                           [确定]

正在启动 mysqld:                                          [确定]

[root@centos mysql]# mysql

Welcome to the MySQL monitor.  Commands end with ; or \g.

Your MySQL connection id is 2

Server version: 5.1.73 Source distribution



Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.



Oracle is a registered trademark of Oracle Corporation and/or its

affiliates. Other names may be trademarks of their respective

owners.



Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.



mysql>

mysql安装ok

安装php

[root@centos etc]# yum install php

Loaded plugins: fastestmirror, refresh-packagekit

Loading mirror speeds from cached hostfile

 * base: mirrors.yun-idc.com

 * extras: mirrors.yun-idc.com

 * updates: mirrors.pubyun.com

Setting up Install Process

Resolving Dependencies

--> Running transaction check

---> Package php.i686 0:5.3.3-27.el6_5.2 set to be updated

--> Processing Dependency: php-common(x86-32) = 5.3.3-27.el6_5.2 for package: php-5.3.3-27.el6_5.2.i686

--> Processing Dependency: php-cli(x86-32) = 5.3.3-27.el6_5.2 for package: php-5.3.3-27.el6_5.2.i686

--> Running transaction check

---> Package php-cli.i686 0:5.3.3-27.el6_5.2 set to be updated

---> Package php-common.i686 0:5.3.3-27.el6_5.2 set to be updated

--> Finished Dependency Resolution



Dependencies Resolved



========================================================================================================================

 Package                      Arch                   Version                            Repository                 Size

========================================================================================================================

Installing:

 php                          i686                   5.3.3-27.el6_5.2                   updates                   1.1 M

Installing for dependencies:

 php-cli                      i686                   5.3.3-27.el6_5.2                   updates                   2.2 M

 php-common                   i686                   5.3.3-27.el6_5.2                   updates                   527 k



Transaction Summary

========================================================================================================================

Install       3 Package(s)

Upgrade       0 Package(s)



Total download size: 3.9 M

Installed size: 13 M

Is this ok [y/N]: y

Downloading Packages:

(1/3): php-5.3.3-27.el6_5.2.i686.rpm                                                             | 1.1 MB     00:04     

(2/3): php-cli-5.3.3-27.el6_5.2.i686.rpm                                                         | 2.2 MB     00:08     

(3/3): php-common-5.3.3-27.el6_5.2.i686.rpm                                                      | 527 kB     00:01     

------------------------------------------------------------------------------------------------------------------------

Total                                                                                   259 kB/s | 3.9 MB     00:15     

Running rpm_check_debug

Running Transaction Test

Transaction Test Succeeded

Running Transaction

Warning: RPMDB altered outside of yum.

2:postfix-2.6.6-2.el6.i686 has missing requires of libmysqlclient.so.16

2:postfix-2.6.6-2.el6.i686 has missing requires of libmysqlclient.so.16(libmysqlclient_16)

2:postfix-2.6.6-2.el6.i686 has missing requires of mysql-libs

  Installing     : php-common-5.3.3-27.el6_5.2.i686                                                                 1/3


  Installing     : php-cli-5.3.3-27.el6_5.2.i686                                                                    2/3


  Installing     : php-5.3.3-27.el6_5.2.i686                                                                        3/3




Installed:

  php.i686 0:5.3.3-27.el6_5.2                                                                                           



Dependency Installed:

  php-cli.i686 0:5.3.3-27.el6_5.2                           php-common.i686 0:5.3.3-27.el6_5.2                          



Complete!

配置apache

web application 项目路径 /var/www/html

apache配置文件路径 /etc/httpd/conf

[root@centos /]# cd /ect/httpd

[root@centos httpd]# ls -a

.  ..  conf  conf.d  logs  modules  run

[root@centos conf.d]# vim README

内容为:

This directory holds Apache 2.0 module-specific configuration files;

any files in this directory which have the ".conf" extension will be

processed as Apache configuration files.



Files are processed in alphabetical order, so if using configuration

directives which depend on, say, mod_perl being loaded, ensure that

these are placed in a filename later in the sort order than "perl.conf".

".conf"结尾的文件将被服务所处理,所以创建一个站点域名为文件名称的文件来实现域名绑定配置。

[root@centos conf.d]# vim git.com

<VirtualHost *:80>

        ServerAdmin novalue@qq.com

        DocumentRoot /var/www/html/git

        ServerName www.gittest.com

        ServerAlias gittest.com



        RewriteEngine On

        RewriteCond %{HPPT_HOST} ^gittest.com$ [NC]

        RewriteRule ^(.*)$ http://www.gittest.com$1 [L,R=301]



        ErrorLog logs/dummy-www.gittest.com-error_log

        CustomLog logs/dummy-www.gittest.com-access_log common

</VirtualHose>

启动httpd服务

[root@centos conf.d]#
service httpd start

正在启动 httpd:httpd: Could not reliably determine the server's fully qualified domain name, using ::1 for ServerName

                                                           [确定]


訪问 http://192.168.1.10/

[root@centos conf.d]# cd /var/www/html

[root@centos html]# ls -a

.  ..

[root@centos html]# vim index.php

输入:

<?php

phpinfo();

訪问:http://192.168.1.10/

ok,成功了

Centos 6安装完美搭建mysql、php、apache之旅的更多相关文章

  1. 使用apt-get方式为Kubuntu安装PHP+MYSQL+Apache

    相信很多搭过动态网站的朋友都知道怎么搭web服务器, 本人是linux新手, 以前在windows是直接使用集成的wamp server, 所以在linux没有亲手搭过. 本系统: ubuntu 12 ...

  2. 阿里云CentOs服务器 安装与配置mysql数据库

    阿里云CentOs服务器 安装与配置mysql数据库 以上为Linux安装mysql数据库 Linux 安装mysql 数据库 一下为mysql 安装教程 Using username "r ...

  3. 【MySQL】CentOS下安装及搭建主从复制

    CentOS下安装MySQL 1,wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm 2,rpm -ivh m ...

  4. Linux CentOS下安装、配置mysql数据库

    假设要在Linux上做j2ee开发.首先得搭建好j2ee的开发环境.包含了jdk.tomcat.eclipse的安装(这个在之前的一篇随笔中已经有具体解说了Linux学习之CentOS(七)--Cen ...

  5. Linux 安装Jdk、mysql、apache、php、tomcat、nginx

    Jdk 安装分三步:第一步,上传跟 linux 位数相同的 jdk tar 包,解压:第二步:解压 tar 包,配置环境变量,且 source 一下 /etc/profile:第三步:检查版本 第一步 ...

  6. CentOS 7 安装并配置 MySQL 5.6

    Linux使用MySQL Yum存储库上安装MySQL 5.6,适用于Oracle Linux,Red Hat Enterprise Linux和CentOS系统. 1.添加MySQL Yum存储库 ...

  7. centos下安装ngnix+php+mysql服务

    一.nginx 安装 1.查看yum下nginx版本信息 [root@localhost ~]# yum list | grep nginx 2.手动添加nginx的yum仓库 [root@local ...

  8. CentOS 7 安装并配置 MySQL 5.7

    Linux使用MySQL Yum存储库上安装MySQL 5.7,适用于Oracle Linux,Red Hat Enterprise Linux和CentOS系统. 1.添加MySQL Yum存储库 ...

  9. CentOS上安装WordPress搭建博客平台

    前两天在服务器上搭建了AMP,今天试着在上面安装了一个WordPress(中文:http://cn.wordpress.org/,英文:http://wordpress.org/),我安装的是英文最新 ...

随机推荐

  1. 日积月累:ScrollView嵌套ListView只显示一行

    在开发的过程当中,由于手机屏幕的大小的限制,我们经常需要使用滑动的方式,来显示更多的内容.在最近的工作中,遇见一个需求,需要将ListView嵌套到ScrollView中显示.于是乎有了如下布局: & ...

  2. java中int,char,string三种类型的相互转换

    如何将字串 String 转换成整数 int? int i = Integer.valueOf(my_str).intValue(); int i=Integer.parseInt(str); 如何将 ...

  3. 由两代WIN8 Surface平板看微软心态

    要说win8平板的前景非常好,微软的两代surface做的真不错. 可是可是,微软就错在了把价格定的太高.为什么高,一是intel芯价格不低,二是每套win8和office微软得要价几百美金吧! 这两 ...

  4. Ubuntu 14.04LTS Gnome GUI初体验及163更新源配制

    Ubuntu 14.04 LTS于前天(2014.4.17)公布, 我今天将我的系统升级到最新, 体验了下最新的UI系统. 我选择了Ubuntu Gnome 的GUI界面.我曾经的系统是12.04lt ...

  5. FZOJ2110: Star

    Problem Description Overpower often go to the playground with classmates. They play and chat on the ...

  6. python实现PKCS5Padding

    python实现PKCS5Padding     python实现PKCS5Padding    2008-09-21     请参考    ssl-3-padding-mode    php的加密函 ...

  7. Atitit.软件仪表盘(2)--vm子系统--资源占用监測

    Atitit.软件仪表盘(2)--vm子系统--资源占用监測 1.  Jvisualvm.exe 2. jprofile 3. Heap //permgen   monitor 作者::老哇的爪子At ...

  8. 怎样从ext3升级到ext4?

    Ext4 文件系统提供了更佳的性能和可靠性,具有了更为丰富的功能,那么,怎样从ext3升级到ext4呢? 首先,我们须要保证系统支持ext4,一般来说,内核版本号在2.6.28及以上的版本号才支持ex ...

  9. 分析javascript关闭

    1.什么是闭包 1)官方解释 一个拥有多个变量和绑定了这些变量的环境的表达式(一般是一个函数).因而这些变量也是该表达式的一部分. 我的理解:所谓的闭包就是连接函数内部和函数外部的一座桥梁.使得在外部 ...

  10. 打开asp出现An error occurred on the server when processing the URL

    分享到:   2013-01-21 15:38   提问者采纳   方法一 以管理员身份运行CMD,将目录定位到%windir%\system32\inetsrv\,然后执行appcmd set co ...