vagrant 虚拟机中安装 lnamp 环境
转载自 :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进入
- sudo apt-get install mysql-server #服务器端
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是否按照成功~~
- 8888 端口转发到 80
- 8889 端口转发到 8888
ps_ef |grep nginx 查看运行状态
vagrant 虚拟机中安装 lnamp 环境的更多相关文章
- Linux环境搭建-在虚拟机中安装Centos7.0
最近在空闲时间学习Linux环境中各种服务的安装与配置,都属于入门级别的,这里把所有的学习过程记录下来,和大家一起分享. 我的电脑系统是win7,所以我需要在win7上安装一个虚拟机-VMware,然 ...
- 在VM虚拟机中安装Centos操作系统
首先我们要下载 Centos https://www.centos.org/ 这个是Centos官方 最新版本 7 https://www.centos.org/download/ 提供有 DVD安 ...
- 在 VirtualBox 虚拟机中安装 Arch Linux 系统指南
How to install Arch Linux on VirtualBox 在 VirtualBox 虚拟机中安装 Arch Linux 系统指南 本文导航 1.Arch Linux 软件仓库2. ...
- 在VM虚拟机中安装Centos7操作系统(三)
首先我们要下载 Centos https://www.centos.org/ 这个是Centos官方 最新版本 7 https://www.centos.org/download/ 提供有 DVD安 ...
- 如何在VMware ubuntu linux虚拟机中安装VMware tools
VMware Tools可以实现在主机<->虚拟机之间拷贝文字.文件等功能.本文讲述如何在VMware ubuntu linux虚拟机中安装VMware tools. 测试环境: VMwa ...
- 虚拟机中安装Linux_Centos7操作系统(最小化安装)
我们打开之前安装的VM, 点击 “创建新的虚拟机”: 我们选 典型 安装 简单点 然后下一步: 我们稍后安装操作系统 ,点下一步: 这里选 Linux 然后下拉 选CentOS 64位,然后下一步: ...
- 1-3课 介绍虚拟化技术、在虚拟机中安装windows7
虚拟化技术 可以使我们在同一台计算机上运行多个操作系统 用于教学环境 用于测试环境 和硬件无关 可移植到其他电脑直接使用 Ptov技术 不支持VtoP 节省管理成本 节省硬件投资 不用买设备 省 ...
- 在虚拟机中安装 Ubuntu
https://www.cnblogs.com/huohu121/p/12250869.html 火狐python 博客园 首页 新随笔 联系 订阅 管理 随笔 - 54 文章 - 0 评论 - ...
- 在虚拟机中安装CentOS7
在虚拟机中安装CentOS7 听语音 | 浏览:17352 | 更新:2014-10-31 12:14 1 2 3 4 5 6 7 分步阅读 一键约师傅 百度师傅最快的到家服务,最优质的电脑清灰! 百 ...
随机推荐
- win都是数据更新
1:一种新的类型: 枚举: 枚举是一种描述性的名称 定义一组有限的值,不能包含方法 对可能的值进行约束 枚举保证了赋值的合理性 2: public enum Grader(枚举的名称){ Male ...
- ORB(oriented FAST and rotated BRIEF)特征提取与检测
ORB采取FAST算法检测特征点,采取BRIEF算法计算特征点描述子. 1.检测特征点 检测候选特征点周围一圈的像素值,若有足够多的像素值与候选特征点的差异都较大,则认为该候选特征点是特征点. 对于上 ...
- dfs——n的全排列(回溯)
#include <iostream> #include <cstring> #include <string> #include <map> #inc ...
- nmon使用命令
nmon使用命令 启动nmon后, c 查看CPU监控的窗口 mV 查看内存和虚拟内存 V是大写 ndt 查看网络.磁盘和虚拟进程 q ...
- German Collegiate Programming Contest 2013-B:Booking(贪心)
Booking Pierre is in great trouble today! He is responsible for managing the bookings for the AC ...
- 2018.4.24 java实现8皇后算法
import java.util.Scanner; public class Nqueens { private boolean verify(int[] arr,int i) { // TODO A ...
- (16)模型层Models - ORM的使用
需求:通过orm创建user表 先配置settings文件夹 连接数据库和配置数据库 Django的模块有两种 1.mysqlDB django内置的模块,只能在python2.X版本下用 2.py ...
- C++学习(一)之Visual Studio安装以及首次使用
一.安装Visual Studio 首先下载Visual Studio 链接: http://pan.baidu.com/s/1pLhJt0Z 密码:uqyc 将.ios文件解压得到以下文件: 点击v ...
- whmcs模板路径
whmcs网站根目录 比如你的域名是server.nongbin.vip,你需要cd /home/wwwroot/server.nongbin.vip,该目录下然后,cd template/ 给文件夹 ...
- linux系统lnmp环境包搬家教程
打包搬家apt-get install zip unzip -yyum install zip unzip -y# debian ubuntu 用apt-get,centos用yumcd /home/ ...