安装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

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

启动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

输入:

phpinfo();

訪问:http://192.168.1.10/

ok,成功了

centos 6 php mysql_Centos 6安装完美搭建mysql、php、apache之旅相关推荐

  1. Centos 6安装完美搭建mysql、php、apache之旅

    安装apache [root@centos share]# yum -y install httpd Loaded plugins: fastestmirror, refresh-packagekit ...

  2. linux apa配置php,Centos 6安装完美搭建mysql、php、apache

    You can test the MySQL daemon with mysql-test-run.pl cd /usr/mysql-test ; perl mysql-test-run.pl Ple ...

  3. centos jdk tomcat mysql_centos 下安装jdk+tomcat+mysql

    centos下安装tomcat: 一.下载安装包: 1.不想自己文件目录太乱,先创建了一个tomcat的文件: mkdir tomcat(可以切换到自己需要的 目录然后创建): 2.直接在官网找到自己 ...

  4. linux mint 安装php,使用apt-get方式为Linux Mint 13安装PHP+MYSQL+Apache

    使用apt-get方式为Ubuntu安装PHP+MYSQL+Apache 分别执行如下命令: (1)安装MYSQL sudo apt-get install mysql-server sudo apt ...

  5. linux proftpd mysql_Linux安装ProFTPd、MySQL以及Apache后有感

    第一部分ProFTPd的安装与配置 对于任何知识,只有自己真正掌握后才能做到"庖丁解牛,游刃有余".下面是我在自己安装RedHat Linux 9.0后的一些体会总结. 在安装过程 ...

  6. docker二进制安装mysql_Docker搭建MySQL读写分离主从模式 分布式数据库中间件Mycat分库分表应用...

    一.MySQL读写分离主从模式 1. 下载镜像 docker pull mysql 当前最新版本:mysql Ver 8.0.19 for Linux on x86_64 (MySQL Communi ...

  7. CENTOS 7.0 安装discuz ,搭 mysql +php+apache 环境

    CentOS 7的yum源中没有Mysql-sever文件,需要去官网上下载: 1.下载支持Mysql-sever的rpm文件 # wget http://dev.mysql.com/get/mysq ...

  8. 用centOS 7安装cadence搭建适合IC Design的科研环境

    https://blog.csdn.net/maxwell2ic/article/details/51991735 用centOS 7安装cadence搭建适合IC Design的科研环境(一)--相 ...

  9. CentOS 7.6 源码安装搭建LNMP架构(Nginx、MYSQL、PHP)

    LNMP架构 LNMP是什么 搭建环境 搭建准备 LNMP软件包 搭建nginx 搭建mysql数据库 搭建php 搭建Discuz!论坛 LNMP是什么 LNMP:Linux系统下Nginx+MyS ...

  10. CentOS 7一键安装Seafile搭建私有云存储

    Seafile 是一款开源企业云盘,和Owncloud类似,个人感觉Seafile更加稳定,搭建也很简单,为了方便,xiaoz写了一个一键脚本,方便快速搭建自己的私有云. 环境要求 CentOS 7 ...

最新文章

  1. 多位博士毕业去了985/211/三四流高校,后来怎么样了?
  2. 如何让Unity支持中文
  3. iOS数据持久化--归档
  4. lintcode:打劫房屋 III
  5. 远程调用RestTemplate
  6. 如何才能在SQL查询器中使用语句查询出表的列名及数据类型(包括类型和长度)...
  7. 漫谈Google的Native Client(NaCl)技术
  8. JQuery发起ajax请求,并在页面动态的添加元素
  9. 解决为什么JDK要带着JRE一起下载
  10. 自己写daemon守护进程
  11. 为什么选择语音验证码?
  12. 计算机只存在于计算机硬盘上,计算机病毒只存在于计算机硬盘上。
  13. 浅谈基于openssl的多级证书,Multi-level CA的签发和管理,以及双向认证
  14. 测绘资质在线处理资质问题
  15. OpenMV 线性回归巡线之一:赛道提取
  16. 2008威客模式网站有哪些创新
  17. 获取本机的真实IP地址
  18. 连接网络设备的交叉线和直通线的区别
  19. 太赛博朋克!华为天才少年自制B站百大Up奖杯,网友:技术难度不高,侮辱性极强...
  20. tomcat7性能优化(转)

热门文章

  1. 再仔细读读react18官方文档吧 20220531
  2. 路由器重温——BGP路由-1
  3. 解决remote: You are not allowed to upload code.fatal: unable to access.The requested URL error:403
  4. 97. Interleaving String
  5. 如何把50多张jpg图片合成一张PDF图片?——下载了破解版PS也不怎么会用的傻瓜极简做法用Word一招解决
  6. QA和软件测试员的区别
  7. Qt ui 到底是什么?
  8. 计算机网络适配器找不到,网络适配器不见了怎么办?电脑Windows网络适配器不见了的5个解决方法...
  9. gtp怎么安装系统_UEFI+GTP模式下使用GHO文件安装Win8系统的具体操作方法
  10. Windows锁屏图片文件存放位置