首先,对你的源进行更新:

  1. $ sudo apt-get update

第一步--安装 Apache

Apache 是一个开源软件,它目前运行在全球超过 50% 的服务器上,是 LAMP(Linux,Apache,MySQL,PHP)组成部分之一。

安装 Apache:

  1. $ sudo apt-get install apache2

安装完成后可以在浏览器地址栏输入 http://localhost/,安装成功会有一个 It works 页面。

可以通过以下命令找到你的服务器的 IP 地址:

  1. $ sudo ifconfig eth0 | grep inet | awk '{ print $2 }'

第二步--安装 MySQL

(更好的参考:http://www.cnblogs.com/xusir/p/3334217.html

MySQL是用于组织和检索数据的广泛部署的数据库管理系统。

安装 MySQL:

  1. $ sudo apt-get mysql-server

在安装过程中,MySQL 要求你设置一个 root 密码,不过你要是忘了设置,也可以在安装之后通过 MySQL shell 设置。

安装完成 MySQL 后你需要进行 MySQL 的初始设置,利用以下命令:

  1. # mysql_secure_installation

这步会要求你的 root 密码。

输入之后会是这样的:

  1. Enter current password for root (enter for none):
  2. OK, successfully used password, moving on...

之后会提示你是否想修改 root 密码,输入 N 不修改,Enter 进入下一步。

之后的步骤全部 Yes ,最后 MySQL 会重载使得设置完成,如下:

  1. By default, a MySQL installation has an anonymous user, allowing anyone
  2. to log into MySQL without having to have a user account created for
  3. them.  This is intended only for testing, and to make the installation
  4. go a bit smoother.  You should remove them before moving into a
  5. production environment.
  6. Remove anonymous users? [Y/n] y
  7. ... Success!
  8. Normally, root should only be allowed to connect from 'localhost'.  This
  9. ensures that someone cannot guess at the root password from the network.
  10. Disallow root login remotely? [Y/n] y
  11. ... Success!
  12. By default, MySQL comes with a database named 'test' that anyone can
  13. access.  This is also intended only for testing, and should be removed
  14. before moving into a production environment.
  15. Remove test database and access to it? [Y/n] y
  16. - Dropping test database...
  17. ... Success!
  18. - Removing privileges on test database...
  19. ... Success!
  20. Reloading the privilege tables will ensure that all changes made so far
  21. will take effect immediately.
  22. Reload privilege tables now? [Y/n] y
  23. ... Success!
  24. Cleaning up...

完成以上步骤后你就可以开始安装 PHP。

第三步--安装 PHP
PHP 是种开源的 Web 脚本语言,并被广泛应用来制作动态网页。

安装 PHP (Debian 7 以下):

  1. # apt-get install php5 php-pear php5-suhosin php5-mysql

安装 PHP (Debian 7 ):

  1. # apt-get install php5 php-pear php5-mysql

接下来将会有两次询问,全部 yes 即可。

完成 PHP 安装后,重载 Apache:

  1. # service apache2 restart

恭喜!你已经成功安装 LAMP!
第四步--在你的服务器上查看 PHP 版本等信息

虽然我们已经安装了 LAMP ,但我们还是需要更直观一点查看安装成功的 LAMP。

首先创建一个文件:

  1. # nano /var/www/info.php

在新文件写下:

  1. <?php
  2. phpinfo();
  3. ?>

之后保存退出。

现在你可以在浏览器中输入 http://localhost/info.php 查看 PHP 版本等信息,页面如下面这样:

【Linux】Debian 下安装 Apache,MySQL,PHP的更多相关文章

  1. linux(Debian)下安装与MySql的安装、卸载、配置及使用

    参考资料:http://www.cnblogs.com/xusir/p/3334217.html 以下是简要记录. 一.安装 安装:apt-get install mysql-server mysql ...

  2. linux系统下安装apache与tomcat

    apache的安装 把安装包放到/soft 下 [root@localhost ~]#cd /soft [root@localhost soft]#tar jxvf httpd-2.2.25.tar. ...

  3. PHP基础 windows环境下安装Apache Mysql PHP

    本篇文章主要是讲一下我自己安装wamp环境的一些步骤和见解,前方多图预警,慎入!!!!! PHP运行环境  : Linux下的三种安装方式:源码包安装.rpm包安装.集成环境安装(lnmp) wind ...

  4. linux系统下安装jdk,mysql,tomcat 和redis 和jedis入门案例

    Day47笔记Linux+redis入门 Day47   知识讲解:Jedis 1.Linux上jdk,mysql,tomcat安装(看着文档安装) 准备工作: 因为JDK,TOMCAT,MYSQL的 ...

  5. Linux环境下安装配置Mysql

    首先我们的使用的是linux的 centOS6 版本 安装mysql: 1.查看有没有安装包 yum list mysql* 2.进行安装mysql:一般我们在服务器端安装的都是服务端( mysql- ...

  6. centos7 下安装apache mysql php phpmyadmin。

    1 安装mysql yum -y install mariadb-server systemctl start mariadb.service systemctl enable mariadb.ser ...

  7. Linux虚拟机下安装配置MySQL

    一.      下载mysql5.7 http://mirrors.sohu.com/mysql/MySQL-5.7/ Linux下载: 输入命令:wget http://mirrors.sohu.c ...

  8. Linux Ubuntu下安装配置mysql

    检查系统中是否已经安装了mysql: sudo netstat -tap | grep mysql 安装mysql: sudo apt-get install mysql-server sudo ap ...

  9. Ubuntu下安装Apache mysql php的命令

    sudo apt-get install apache2 php5-mysql libapache2-mod-php5 mysql-serversudo apt-get install php5-gd ...

随机推荐

  1. PHP弱性处理0e开头md5哈希字符串缺陷/bug

    PHP在处理哈希字符串时,会利用”!=”或”==”来对哈希值进行比较,它把每一个以”0E”开头的哈希值都解释为0,所以如果两个不同的密码经过哈希以后,其哈希值都是以”0E”开头的,那么PHP将会认为他 ...

  2. 后台模板引擎ejs与前台模板引擎artTemplate的简单介绍

    动态网页是指前端页面当中的数据内容来源于后台数据库,前端的html代码会随着后台数据的变化而变化,是动态生成的.制作动态网页有两种方式,一种方式是在后台拿到前端的html模板,利用后台模板引擎(如ej ...

  3. 《FFT家族—从不会到崩溃(坑)》读blog笔记

    免责声明 原文地址https://blog.csdn.net/linjiayang2016/article/details/80341958,作者linjiayang2016.\text{linjia ...

  4. [CF544] D. Destroying Roads

    D. Destroying Roads time limit per test 2 seconds memory limit per test 256 megabytes input standard ...

  5. [CODEVS6333] (数据加强)特种部队

    题目描述 Description 某特种部队接到一个任务,需要潜入一个仓库.该部队士兵分为两路,第一路士兵已经在正面牵制住了敌人,第二路士兵正在悄悄地从后方秘密潜入敌人的仓库.当他们到达仓库时候,发现 ...

  6. Arduino学习笔记⑦ EEPROM断电保存数据

    1.前言     EEPROM,叫做电可擦可编程可读寄存器(是不是觉得好官方,不知道是什么鬼?反正我也一脸懵逼),只需要知道这是一种断电后数据不会丢失的存储设备,可以用来应对需要做记录做保存的场合.简 ...

  7. SQL查询选修了所有课程的学生姓名

    select sname from student where not exists (select * from course where not exists   (select * from s ...

  8. SpringBoot整合MybatisPlus3.X之SQL执行分析插件(十四)

    pom.xml <dependencies> <dependency> <groupId>org.springframework.boot</groupId& ...

  9. SpringBoot的Banner

    一 官方文档介绍 1 自定义横幅 通过在 classpath 中添加banner.txt文件或将banner.location设置为此类文件的位置,可以更改启动时打印的横幅.如果文件具有异常编码,则可 ...

  10. C和C++中的引用传递

    两种引用传递的定义方式 第一种 #include<stdio.h> void changeValue(int *a); int main(){ int a =1; changeValue( ...