1、安装Apache

[root@localhost ~]# yum -y install httpd

# 开机自启动

[root@localhost ~]# chkconfig httpd on

# 启动httpd 服务

[root@localhost ~]# service httpd start

### 安装apache 一些扩展

root@localhost ~]# yum -y install httpd-manual mod_ssl mod_perl mod_auth_mysql

现在直接在浏览器键入http://localhost  或 http://本机IP  ,应该会看到Apache的测试页面

这里需要注意iptables的设置哦。

2、安装配置MySQL

# mysql          客户端程序

# mysql-server    服务端程序

# mysql-devel    开发设计的库

[root@localhost ~]# yum -y install mysql mysql-server mysql-devel

# 开机启动

[root@localhost ~]# chkconfig mysqld on

# 启动mysqld服务

[root@localhost ~]# service mysqld start

# 进行一些安全性配置

[root@localhost ~]# /usr/bin/mysql_secure_installation

[root@localhost ~]# netstat -tulpn | grep -i mysql

tcp        0      0 0.0.0.0:3306          0.0.0.0:*          LISTEN      1723/mysqld

OK, 我们看到mysqld已经启动,监听在3306端口上。

3、安装php

安装相关模块:为了让PHP支持MySQL,我们可以安装php-mysql软件包;也可使用以下命令搜索可用的php模块

[root@localhost ~]# yum -y install php php-mysql

# 安装php常用扩展

[root@localhost ~]# yum search php

[root@localhost ~]# yum -y install gd php-gd gd-devel php-xml php-common php-mbstring php-ldap php-pear php-xmlrpc php-imap

### 重启httpd服务,这一步很重要

[root@localhost ~]# service httpd restart

然后,我们提供php页面,测试

[root@localhost ~]# cd /var/www/html/

[root@localhost html]# vi index.php

<?php

phpinfo();

?>

然后,我们再次在浏览器键入http://localhost  或 http://本机IP  ,应该会看到如下页面

4、安装配置phpMyAdmin

安装好MySQL,Apache及PHP后,为了可视化的管理MySQL数据库,我们可以安装phpMyAdmin。到其官网下载最新版本:http://www.phpmyadmin.net/home_page/

在Windows下,其实Navicat也是一个非常好用的MySQL可视化工具,推荐使用。

[root@localhost ~]# unzip phpMyAdmin-4.2.6-all-languages.zip

[root@localhost ~]# mv phpMyAdmin-4.2.6-all-languages /var/www/html/phpmyadmin

[root@localhost ~]# cd /var/www/html/phpmyadmin

[root@localhost ~]# cp libraries/config.default.php config.inc.php

[root@localhost ~]# vi cnfig.inc.php

$cfg['PmaAbsoluteUri'] = '';这里填写 phpMyAdmin 的访问网址。

$cfg['Servers'][$i]['host'] = 'localhost'; // MySQL hostname or IP address

$cfg['Servers'][$i]['port'] = ''; // MySQL port - leave blank for default port

$cfg['Servers'][$i]['user'] = 'root'; // 填写 MySQL 访问 phpMyAdmin 使用的 MySQL 用户名,默认为 root。

fg['Servers'][$i]['password'] = ''; // 填写对应上述 MySQL 用户名的密码。

# 然后重启,httpd服务

[root@localhost ~]# service httpd restart

在浏览器键入http://localhost/phpmyadmin 即可访问。

转自:https://www.linuxidc.com/Linux/2014-07/104563.htm

Centos6 使用yum快速搭建LAMP环境的更多相关文章

  1. redhat利用yum快速搭建LAMP环境

    LAMP LAMP环境,对于PHP开发及其开源的PHP项目的部署都很关键的. LAMP的含义: L   ---Linux A  ---Apache   web M ---Mysql     datab ...

  2. CentOS6.5使用yum快速搭建LAMP环境

    1.安装Apache # yum -y install httpd # 开机自启动 # chkconfig httpd on # 启动httpd 服务 # service httpd start # ...

  3. CentOS 6.5使用yum快速搭建LAMP环境

    由于这里采用yum方式安装,前提是我们必须配置好yum源.为了加快下载速度,建议使用网易的yum源. 这种方式对于初学者来说,非常方便,但是可定制性不强,而且软件版本较低.一般用于实验和学习环境. 1 ...

  4. CentOS 7使用yum快速搭建LAMP环境

    1.安装Apache [root@localhost ~]# yum -y install httpd # 开机自启动 [root@localhost ~]# chkconfig httpd on # ...

  5. Centos6.4版本下搭建LAMP环境

    Centos6.4版本下搭建LAMP环境 配置yum mkdir/mnt/cdrom mount/dev/cdrom  /mnt/cdrom 装载光盘 vi /etc/yum.repos.d/Cent ...

  6. 如何《快速搭建LAMP环境》

    阿里云体验平台简介 阿里云开发者实验室提供免费云资源和丰富的场景化实践,旨在帮助开发者在学习应用技术,了解阿里云产品的特性. 教程介绍 本教程引用自阿里云体验实验室介绍如何快速搭建Docker环境,并 ...

  7. 用yum快速搭建LAMP平台

    实验环境: [root@nmserver-7 html]# cat /etc/redhat-release CentOS Linux release 7.5.1804 (Core) [root@nms ...

  8. 通过yum命令搭建lamp环境(centos6.5)

    centos 6.5 1.yum安装和源代码编译在使用的时候没啥区别,但是安装的过程就大相径庭了,yum只需要3个命令就可以完成,源代码需要13个包,还得加压编译,步骤很麻烦,而且当做有时候会出错,源 ...

  9. CentOS7用yum快速搭建LAMP平台

    实验环境: [root@nmserver-7 html]# cat /etc/redhat-release CentOS release 7.3.1611 (AltArch) [root@nmserv ...

随机推荐

  1. 【转】不错的linux下通用的java程序启动脚本

    虽然写起动shell的频率非常不高...但是每次要写都要对付一大堆的jar文件路径,新加jar包也必须要修改起动shell. 在网上找到一个挺好的通用shell脚本. 只需要修改一些配置变量,就可以用 ...

  2. application配置和profile隔离配置

    前言 github: https://github.com/vergilyn/SpringBootDemo 说明:我代码的结构是用profile来区分/激活要加载的配置,从而在一个project中写各 ...

  3. Android学习笔记_3_四种布局

    Android布局是应用界面开发的重要一环,在Android中,共有四种布局方式, 分别是:FrameLayout( 帧布局 ).LinearLayout (线性布局).TableLayout(表格布 ...

  4. An Algorithm for Surface Encoding and Reconstruction From 3D Point Cloud Data

    An Algorithm for Surface Encoding and Reconstruction From 3D Point Cloud Data https://www.youtube.co ...

  5. img的空白内容如何处理

    给img加一个 vertical-align: bottom;

  6. SpringBoot非官方教程 | 第四篇:SpringBoot 整合JPA

    转载请标明出处: 原文首发于:https://www.fangzhipeng.com/springboot/2017/07/11/springboot4-jpaJ/ 本文出自方志朋的博客 JPA全称J ...

  7. VC中edit控件使用

    SetSel(start,end)作用:定制EDIT的所选择内容.间接地可以用于定位光标位置. 使用例子:EXP1:设置光标CEdit*      pEdit=(CEdit*)GetDlgItem(I ...

  8. PHP接收http请求头信息

    1.PHP 自带函数 getallheaders() 目前 getallheaders() 只能用于 apache 中.如果想在 nginx 中也能使用,可以使用自定义函数. foreach (get ...

  9. ECSHOP快递单号查询插件圆通V8.2专版

    本ECSHOP快递物流单号跟踪插件提供国内外近2000家快递物流订单单号查询服务例如申通快递.顺丰快递.圆通快递.EMS快递.汇通快递.宅急送快递.德邦物流.百世快递.汇通快递.中通快递.天天快递等知 ...

  10. python读取大文件和普通文件

    读取文件,最常见的方式是: with open('filename', 'r', encoding = 'utf-8') as f: for line in f.readlines(): do_som ...