转载自 :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. 20165228 预备作业3 Linux安装及学习

    (一)安装虚拟机 根据娄老师给的Ubuntu版本和安装教程,我曾遇到如下问题: Q1:首先遇到的问题是没有开启虚拟化 解决方法:在重启电脑时进入BIOS>Configuratio > In ...

  2. 模拟主库创建数据文件,dg备库空间不足时问题处理

    本篇文档测试目的: 模拟实际环境中,主库对表空间添加数据文件,备库空间不足,最终导致MRP进程自动断开,处理方式. 1.问题环境模拟 1)正常情况下的dg 主库创建数据文件,备库接受日志,自动创建表空 ...

  3. WEBBASE篇: 第二篇, HTML知识2

    HTML知识2 <!doctype html> <html lang="en"> <head> <meta charset="U ...

  4. Python之路,第十九篇:Python入门与基础19

    python3  面向对象3 数值转换函数重载: str(obj)              __str__ complex(x)       __complex__ int(obj)         ...

  5. Templates中的for标签

    for 标签 {% for 变量 in 元组|列表|字典 %} {% endfor %} 在 Jinja2 模板的循环中,支持内部变量 - loop loop作用:记载当前循环中的一些相关信息 loo ...

  6. search的 制作

    <meta charset="utf-8">  <title>search的制作</title> <style type="te ...

  7. acm 2043

    ////////////////////////////////////////////////////////////////////////////////#include<iostream ...

  8. 《DSP using MATLAB》Problem 5.1

    恰逢清明,这几天是清明时节雪纷纷,断崖式降温:又回到了老家,儿时上蹿下跳的核桃树,远去的故乡,远去的时代…… 用到的公式: 这里只放前两个小题的计算过程,都比较简单,细心就行.代码如下: %% --- ...

  9. Maven命令安装jar包到本地仓库

    https://blog.csdn.net/moxiong3212/article/details/78767480 当需要的jar包在中央仓库找不到或者是想把自己生成的jar包放到的Maven仓库中 ...

  10. 【BZOJ1213】高精度开根

    python是坠吼的! 原题: 不贴原题,就是高精度开根,结果向下取整 首先二分答案,高精度嘛……python即可 二分右端点设为n会T掉,需要先倍增一个r,while(r **m <= n) ...