转载自 :http://git.oschina.net/apanly/mooc/tree/master/vagrant

  • 替换源

    • sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak #备份
    • sudo vim /etc/apt/sources.list #修改源
    • sudo apt-get update #更新列表
  • L(A|N)MP

    • Ngnix

      • apt-cache search nginx     检查nginx是否存在
      • sudo apt-get install nginx
      • nginx -v

        nginx version: nginx/1.4.6 (Ubuntu)

      • 测试Nginx

        • curl -I 'http://127.0.0.1'

          HTTP/1.1 200 OK
          Server: nginx/1.4.6 (Ubuntu)
          Date: Sat, 07 Jan 2017 07:49:41 GMT
          Content-Type: text/html
          Content-Length: 612
          Last-Modified: Tue, 04 Mar 2014 11:46:45 GMT
          Connection: keep-alive
          ETag: "5315bd25-264"
          Accept-Ranges: bytes
    • Apache

      • sudo apt-get install apache2
      • apache2 -v

        Server version: Apache/2.4.7 (Ubuntu) Server built: Jul 15 2016 15:34:04

      • 测试访问,此时不能访问,因为80端口被nginx占用了,可以先把nginx停掉  sudo /etc/init.d/nginx stop    sudo /etc/init.d/apache2 start

        • curl -I 'http://127.0.0.1'

           HTTP/1.1 200 OK
          Date: Sat, 07 Jan 2017 08:15:26 GMT
          Server: Apache/2.4.7 (Ubuntu)
          Last-Modified: Sat, 07 Jan 2017 07:17:45 GMT
          ETag: "2cf6-5457bee51dd0d"
          Accept-Ranges: bytes
          Content-Length: 11510
          Vary: Accept-Encoding
          Content-Type: text/html`
      • 更改端口,将端口设置为8888

        • 修改 ports.conf 文件   /etc/apache2/
        • curl -I 'http://127.0.0.1:8888'

           HTTP/1.1 200 OK
          Date: Sat, 07 Jan 2017 08:24:15 GMT
          Server: Apache/2.4.7 (Ubuntu)
          Last-Modified: Sat, 07 Jan 2017 07:17:45 GMT
          ETag: "2cf6-5457bee51dd0d"
          Accept-Ranges: bytes
          Content-Length: 11510
          Vary: Accept-Encoding
          Content-Type: text/html`
    • Mysql

      • sudo apt-get install mysql-server #服务器端

        • 安装期间会提示输入为mysql设置root密码,我这边不操作,直接enter 不设置密码
      • sudo apt-get install mysql-client #客户端
        • mysql -uroot -p #测试连接库,上面安装服务端没有设置密码,这里直接enter进入
    • php

      • 安装php

        • sudo apt-get install php5-cli

          • php -v

              PHP 5.5.9-1ubuntu4.20 (cli) (built: Oct  3 2016 13:00:37)
            Copyright (c) 1997-2014 The PHP Group
            Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
            with Zend OPcache v7.0.3, Copyright (c) 1999-2014, by Zend Technologies
      • PHP扩展       例:sudo apt-get install php5-mcrypt

        • php5-mcrypt
        • php5-mysql
        • php5-gd
      • 支持apache2的php模块

        • sudo apt-get install libapache2-mod-php5
        • 开启rewrite功能
          • sudo a2enmod rewrite
      • 支持nginx fastcgi

        • sudo apt-get install php5-cgi php5-fpm
        • 修改成9000端口 ,默认sock模式
          • cd /etc/php5/fpm/pool.d
          • sudo vim www.conf # search listen = 127.0.0.1:9000
          • sudo /etc/init.d/php5-fpm restart
  • 端口转发 为了验证nginx是否按照成功~~

ps_ef |grep nginx 查看运行状态

vagrant 虚拟机中安装 lnamp 环境的更多相关文章

  1. Linux环境搭建-在虚拟机中安装Centos7.0

    最近在空闲时间学习Linux环境中各种服务的安装与配置,都属于入门级别的,这里把所有的学习过程记录下来,和大家一起分享. 我的电脑系统是win7,所以我需要在win7上安装一个虚拟机-VMware,然 ...

  2. 在VM虚拟机中安装Centos操作系统

    首先我们要下载  Centos https://www.centos.org/ 这个是Centos官方 最新版本 7 https://www.centos.org/download/ 提供有 DVD安 ...

  3. 在 VirtualBox 虚拟机中安装 Arch Linux 系统指南

    How to install Arch Linux on VirtualBox 在 VirtualBox 虚拟机中安装 Arch Linux 系统指南 本文导航 1.Arch Linux 软件仓库2. ...

  4. 在VM虚拟机中安装Centos7操作系统(三)

    首先我们要下载  Centos https://www.centos.org/ 这个是Centos官方 最新版本 7 https://www.centos.org/download/ 提供有 DVD安 ...

  5. 如何在VMware ubuntu linux虚拟机中安装VMware tools

    VMware Tools可以实现在主机<->虚拟机之间拷贝文字.文件等功能.本文讲述如何在VMware ubuntu linux虚拟机中安装VMware tools. 测试环境: VMwa ...

  6. 虚拟机中安装Linux_Centos7操作系统(最小化安装)

    我们打开之前安装的VM, 点击 “创建新的虚拟机”: 我们选 典型 安装  简单点 然后下一步: 我们稍后安装操作系统 ,点下一步: 这里选 Linux 然后下拉 选CentOS 64位,然后下一步: ...

  7. 1-3课 介绍虚拟化技术、在虚拟机中安装windows7

    虚拟化技术 可以使我们在同一台计算机上运行多个操作系统 用于教学环境 用于测试环境 和硬件无关  可移植到其他电脑直接使用 Ptov技术  不支持VtoP 节省管理成本 节省硬件投资  不用买设备 省 ...

  8. 在虚拟机中安装 Ubuntu

    https://www.cnblogs.com/huohu121/p/12250869.html 火狐python 博客园 首页 新随笔 联系 订阅 管理 随笔 - 54  文章 - 0  评论 - ...

  9. 在虚拟机中安装CentOS7

    在虚拟机中安装CentOS7 听语音 | 浏览:17352 | 更新:2014-10-31 12:14 1 2 3 4 5 6 7 分步阅读 一键约师傅 百度师傅最快的到家服务,最优质的电脑清灰! 百 ...

随机推荐

  1. 【转载】 看996ICU

    原文地址: https://www.jianshu.com/p/15d8726fa8a8 作者:Demisstif 来源:简书 ------------------------------------ ...

  2. 【linux基础】使用命令行编译运行c++程序

    前言 在linux系统运行程序,小鹅知道的有3种编译方式,一种是直接命令行编译,一种是使用Cmake,一种是使用脚本文件(*.sh).本文介绍的是使用命令行编译. 使用过程 注意不同系统的编译器版本可 ...

  3. Gym-101653:acific Northwest Regional Contest (2019训练第一场)

    本套题没有什么数据结构题,图论题,唯一有价值的就是Q题博弈,在最后面,读者可以直接拉到最下面. (还剩下两个,估计每什么价值的题,懒得补了 M .Polyhedra pro:欧拉公式,V-E+F=2: ...

  4. 阮一峰关于reduce 和transduce的博客

    http://www.ruanyifeng.com/blog/2017/03/reduce_transduce.html

  5. ACM-ICPC 2018 焦作赛区网络预赛- L:Poor God Water(BM模板/矩阵快速幂)

    God Water likes to eat meat, fish and chocolate very much, but unfortunately, the doctor tells him t ...

  6. .net core consul grpc--系统服务RPC实现通信(一)

    .net core grpc 系统服务实现通信(一) 现在系统都服务化,.net core 实现服务化的方式有很多,我们通过grpc实现客户端.服务端通信. grpc(https://grpc.io/ ...

  7. oracle用exp导出dmp文件时发现空表没有导出来

    问题: 今天,从同事电脑考oracle11g中dmp文件,在自己电脑导入,发现少了很多表,而且少的这些表都是空表. 原因: oracle11g 默认的deferred_segment_creation ...

  8. LeetCode - Cut Off Trees for Golf Event

    You are asked to cut off trees in a forest for a golf event. The forest is represented as a non-nega ...

  9. MySQL Replication--修改主键为NULL导致的异常

    测试环境:MySQL 5.5.14/MySQL 5.6.36 测试脚本: create table tb001(id int primary key,c1 int); alter table tb00 ...

  10. 求两个数的平均值,不能只用(a+b)/2的方法

    #include<stdio.h> int avg1(int a, int b) { //利用移位操作符 //右移移位相当于——>除以2 :(a+b)>>1 //考虑到溢 ...