vagrant打造跨平台可移动的开发环境五 - vagrant虚拟机优化

1、虚拟机名字
这里写图片描述
编辑虚拟机配置文件Vagrantfile :

  config.vm.provider "virtualbox" do |vb|
  #   # Display the VirtualBox GUI when booting the machine
  #   vb.gui = true
  #
  #   # Customize the amount of memory on the VM:
  #   vb.memory = "1024"
      vb.name = "ubuntu_lnmp"
  end

然后要重启虚拟机:

vagrant reload

这里写图片描述

2、虚拟机主机名

同样是修改Vagrantfile文件:

  config.vm.hostname = "ubuntu1404"

3、配置虚拟机内存和CPU

  config.vm.provider "virtualbox" do |vb|
  #   # Display the VirtualBox GUI when booting the machine
  #   vb.gui = true
  #
  #   # Customize the amount of memory on the VM:
  #   vb.memory = "1024"
      vb.name = "ubuntu_lnmp"
      vb.memory = "1024"
      vb.cpus = 2
  end

4、Nginx优化
优化同步目录:本机里写的代码同步到虚拟机里面。
需要修改Nginx主配置文件:

sudo vim /etc/nginx/nginx.conf
sendfile off;

5、Apache优化

#Apache默认是关闭的
EnableSendfile off
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值