centos7.2.box下载地址

链接: https://pan.baidu.com/s/1ny20PN2x7YuA6dwYA-P0yQ 提取码: wrdk

1 下载centos.box

新建dnmp目录 下载的复制到该目录下

vagrant box add dnmp vagrant-centos-7.2.box

vagrant init dnmp  //生成Vagrantfile

复制下面到Vagrantfile里面

Vagrant.configure("2") do |config|

  config.vm.box = "dnmp"

	config.vm.network "forwarded_port", guest: 22, host: 2222, id: "ssh", disabled: "true"
config.vm.network "forwarded_port", guest: 22, host: 7777
config.vm.network "private_network", ip: "192.168.33.70"
config.vm.synced_folder "d:/dnmp", "/www/dnmp"
config.vm.synced_folder "e:/src", "/usr/local/src" config.vm.provider "virtualbox" do |v|
v.memory = 2048
v.cpus = 2
end end

vagrant up

E:\vbox_list\dnmp>vagrant box add dnmp vagrant-centos-7.2.box
==> box: Box file was not detected as metadata. Adding it directly...
==> box: Adding box 'dnmp' (v0) for provider:
box: Unpacking necessary files from: file://E:/vbox_list/dnmp/vagrant-centos-7.2.box
box:
==> box: Successfully added box 'dnmp' (v0) for 'virtualbox'!

E:\vbox_list\dnmp>vagrant init dnmp
A `Vagrantfile` has been placed in this directory. You are now
ready to `vagrant up` your first virtual environment! Please read
the comments in the Vagrantfile as well as documentation on
`vagrantup.com` for more information on using Vagrant. E:\vbox_list\dnmp>vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'dnmp'...
==> default: Matching MAC address for NAT networking...
==> default: Setting the name of the VM: dnmp_default_1568880279009_33589
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
default: Adapter 2: hostonly
==> default: Forwarding ports...
default: 22 (guest) => 7777 (host) (adapter 1)
default: 29324 (guest) => 29324 (host) (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 127.0.0.1:7777
default: SSH username: vagrant
default: SSH auth method: private key
default: Warning: Connection reset. Retrying...
default: Warning: Connection aborted. Retrying...
default: Warning: Remote connection disconnect. Retrying...
default: Warning: Connection reset. Retrying...
default: Warning: Connection aborted. Retrying...
default: Warning: Remote connection disconnect. Retrying...
default: Warning: Connection reset. Retrying...
default: Warning: Connection aborted. Retrying...
default: Warning: Remote connection disconnect. Retrying...
default:
default: Vagrant insecure key detected. Vagrant will automatically replace
default: this with a newly generated keypair for better security.
default:
default: Inserting generated public key within guest...
default: Removing insecure key from the guest if it's present...
default: Key inserted! Disconnecting and reconnecting using new SSH key...
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
default: The guest additions on this VM do not match the installed version of
default: VirtualBox! In most cases this is fine, but in rare cases it can
default: prevent things such as shared folders from working properly. If you see
default: shared folder errors, please make sure the guest additions within the
default: virtual machine match the version of VirtualBox you have installed on
default: your host and reload your VM.
default:
default: Guest Additions Version: 4.3.30
default: VirtualBox Version: 6.0
==> default: Configuring and enabling network interfaces...
==> default: Mounting shared folders...
default: /vagrant => E:/vbox_list/dnmp
default: /www/dnmp => D:/dnmp
default: /usr/local/src => E:/src
==> default: Starting notify-forwarder ...
default: Notify-forwarder: guest listening for file change notifications on 0.0.0.0:29324.
==> default: Notify-forwarder: Unsupported host operating system

 

使用xshell登录

账号root vagrant

密码 vagrant

更新root密码和yum

[root@localhost ~]# sudo passwd root
Changing password for user root.
New password:
BAD PASSWORD: The password is shorter than characters
Retype new password:
passwd: all authentication tokens updated successfully.
[root@localhost ~]# yum -y update

安装git 和上传工具

yum -y install git lrzsz vim

安装docker

1、Docker 要求 CentOS 系统的内核版本高于 3.10 ,查看本页面的前提条件来验证你的CentOS 版本是否支持 Docker 。

通过 uname -r 命令查看你当前的内核版本

 $ uname -r

2、使用 root 权限登录 Centos。确保 yum 包更新到最新。

$ sudo yum update

3、卸载旧版本(如果安装过旧版本的话)

$ sudo yum remove docker  docker-common docker-selinux docker-engine

4、安装需要的软件包, yum-util 提供yum-config-manager功能,另外两个是devicemapper驱动依赖的

$ sudo yum install -y yum-utils device-mapper-persistent-data lvm2

5、设置yum源

$ sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo

6、可以查看所有仓库中所有docker版本,并选择特定版本安装

$ yum list docker-ce --showduplicates | sort -r

7、安装docker

$ sudo yum install docker-ce  #由于repo中默认只开启stable仓库,故这里安装的是最新稳定版17.12.0
$ sudo yum install <FQPN> # 例如:sudo yum install docker-ce-17.12.0.ce

8、启动并加入开机启动

$ sudo systemctl start docker
$ sudo systemctl enable docker

9、验证安装是否成功(有client和service两部分表示docker安装启动都成功了)

$ docker version

[root@localhost ~]# docker -v
Docker version 19.03.2, build 6a30dfc

  

 

安装docker-compose

[root@localhost bin]#

curl -L https://github.com/docker/compose/releases/download/1.24.0-rc1/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose

[root@localhost bin]# chmod 777 /usr/local/bin/docker-compose
[root@localhost bin]# docker-compose -v
docker-compose version 1.22.0, build f46880fe

windows 下面

git  clone  git@github.com:brady-wang/my-dnmp.git  dnmp

docker-compose up

conf.d目录下配置域名  wang.conf

server {
listen 80;
server_name wang.com;
root /var/www/html/wang;
index index.php index.html index.htm; access_log /dev/null;
access_log /var/log/nginx/wang.access.log main;
error_log /var/log/nginx/wang.error.log warn; error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
} location ~ \.php$ {
fastcgi_pass php72:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
} }

  

dnmp安装的更多相关文章

  1. dnmp(docker的lnmp)安装WordPress之后图片上传问题 问题:图片上传大小问题解决和 报错413 Request Entity Too Large

    首先是提示超过图片尺寸和大小, 最后发现都是图片大小的问题, 需要修改php的最大上传size 修改之后查看php配置  已经生效  但是还是报错, 提示返回不是合法的json,  查看控制台, 报错 ...

  2. win7下docker环境centos容器中安装mysql5.7

    docker环境基于镜像skiychan/nginx-php7,进行安装 ps:skiychan/nginx-php7此镜像已封装nginx1.15.3+php7.2.9 1.环境配置 配置共享文件夹 ...

  3. docker——容器安装tomcat

    写在前面: 继续docker的学习,学习了docker的基本常用命令之后,我在docker上安装jdk,tomcat两个基本的java web工具,这里对操作流程记录一下. 软件准备: 1.jdk-7 ...

  4. 网络原因导致 npm 软件包 node-sass / gulp-sass 安装失败的处理办法

    如果你正在构建一个基于 gulp 的前端自动化开发环境,那么极有可能会用到 gulp-sass ,由于网络原因你可能会安装失败,因为安装过程中部分细节会到亚马逊云服务器上获取文件.本文主要讨论在不变更 ...

  5. Sublime Text3安装JsHint

    介绍 Sublime Text3使用jshint依赖Nodejs,SublimeLinter和Sublimelinter-jshint. NodeJs的安装省略. 安装SublimeLinter Su ...

  6. Fabio 安装和简单使用

    Fabio(Go 语言):https://github.com/eBay/fabio Fabio 是一个快速.现代.zero-conf 负载均衡 HTTP(S) 路由器,用于部署 Consul 管理的 ...

  7. gentoo 安装

    加载完光驱后 1进行ping命令查看网络是否通畅 2设置硬盘的标识为GPT(主要用于64位且启动模式为UEFI,还有一个是MBR,主要用于32位且启动模式为bois) parted -a optima ...

  8. Linux平台 Oracle 10gR2(10.2.0.5)RAC安装 Part3:db安装和升级

    Linux平台 Oracle 10gR2(10.2.0.5)RAC安装 Part3:db安装和升级 环境:OEL 5.7 + Oracle 10.2.0.5 RAC 5.安装Database软件 5. ...

  9. Linux平台 Oracle 10gR2(10.2.0.5)RAC安装 Part1:准备工作

    Linux平台 Oracle 10gR2(10.2.0.5)RAC安装 Part1:准备工作 环境:OEL 5.7 + Oracle 10.2.0.5 RAC 1.实施前准备工作 1.1 服务器安装操 ...

随机推荐

  1. 软件定义网络基础---OpenFlow概述

    一:OpenFlow概述 二:交换机模型架构 (一)OpenFlow构架三个组成成分 三:OpenFlow 1.0版本 自OpenFlow1.0发布以来,目前已经有多个版本的OF规范版本被发布 四:O ...

  2. MongoDB学习笔记一:MongoDB基础

    目录 MongoDB是什么? 学了有什么用? MongoDB入门 安装 修改数据库位置 MongoDB的启动方式 MongoDB的图形化工具 MongoDB基本命令 增 查询 更新 删除 排序 投影 ...

  3. NPOI OFFICE 2007 文件格式不被支持,读取异常

    在使用public XSSFWorkbook(FileInfo file) 时报文件格式不被支持,(读取异常/格式错误),根目录少了 ICSharpCode.SharpZipLib.dll . NPO ...

  4. 【嵌入式硬件Esp32】Ubuntu 1804下ESP32交叉编译环境搭建

    一.ESP32概述EPS32是乐鑫最新推出的集成2.4GWi-Fi和蓝牙双模的单芯片方案,采用台积电(TSMC)超低功耗的40nm工艺,拥有最佳的功耗性能.射频性能.稳定性.通用性和可靠性,适用于多种 ...

  5. PHP判断上传图片的类型

    PHP判断上传图片的类型用getimagesize来判断上传图片的类型比$_FILES函数的type更可靠 同一个文件,使用不同的浏览器php返回的type类型是不一样的,由浏览器提供type类型的话 ...

  6. 遨游TypeScript海洋之定义变量和数据类型

    变量和数据类型 熟悉JavaScript的小伙伴都知道,typescript是JavaScript的超集,也就是说它包含JavaScript.所以我觉得,只要你想拥有更佳的模块管理,让你的开发更佳严谨 ...

  7. Win10使用Xmanager6远程桌面连接CentOS7服务器

    服务器:CentOS 7.6 GNOME桌面环境(若最小化安装,默认是无桌面的,那么就要安装桌面,参考百度) 个人主机:Windows 10专业版,请安装Xmanager Power Suite 6( ...

  8. [转帖]大数据hadoop与spark的区别

    大数据hadoop与spark的区别 https://www.cnblogs.com/adnb34g/p/9233906.html Posted on 2018-06-27 14:43 左手中倒影 阅 ...

  9. 十分钟快速入门 Python,看完即会,不用收藏!

    本文以 Eric Matthes 的<Python编程:从入门到实践>为基础,以有一定其他语言经验的程序员视角,对书中内容提炼总结,化繁为简,将这本书的精髓融合成一篇10分钟能读完的文章. ...

  10. xsy 2414【CF587C】Duff in the Army

    Description [题目描述]: 最近有一场战争发生,Duff是战争里一名士兵,Malek是她的长官. 他们的国家——Andarz Gu有n个城市(编号为1到n),总共有n-1条道路,每条道路连 ...