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