环境的搭建

2020/11/25 LinuxDockerNginx

🌙 1.开发环境准备

🌙 2.本地环境

# win10安装linux子系统

wsl -o -l # 查看子系统

  NAME            FRIENDLY NAME
* Ubuntu          Ubuntu
Debian          Debian GNU/Linux
kali-linux      Kali Linux Rolling
openSUSE-42     openSUSE Leap 42
SLES-12         SUSE Linux Enterprise Server v12
Ubuntu-16.04    Ubuntu 16.04 LTS
Ubuntu-18.04    Ubuntu 18.04 LTS
Ubuntu-20.04    Ubuntu 20.04 LTS


# 开始安装
wsl --install Ubuntu-20.04 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

🌙 3.linux环境

docker pull mongo:4


>  mongodb服务可视化工具[Robot 3T](https://robomongo.org/)



## 4.docker简单使用

+ 使用cn加速镜像:

在`/etc/docker/daemon.json`中新增:

```json
{
  "registery-mirrors": ["https://registery.docker-cn.com"]
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

保存之后重启docker服务即可.service docker restart重启

🌙 5.ubuntu安装nginx

tomcat 与 nginx,apache的区别是什么? (opens new window)

  • 1、Nginx的软件包在Ubuntu默认软件仓库中可用。 安装非常简单,只需键入以下命令:

    # 更新
    sudo apt update
    
    # 安装nginx
    sudo apt install nginx
    
    1
    2
    3
    4
    5
  • 2、安装完成后,检查Nginx版本:

    nginx –v
    
    1
  • 3、启动nginx服务:

    # 开启
    sudo service nginx start
    # 停止
    sudo service nginx stop
    # 重启
    sudo service nginx restart
    
    1
    2
    3
    4
    5
    6
  • 4、访问 localhost:80 安装默认的目录在 /etc/nginx

  • 5.查看配置文件

    
    sudo nginx -t
     
    # nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
    # nginx: configuration file /etc/nginx/nginx.conf test is successful
    
    1
    2
    3
    4
    5