How to configure NAS on Windows Server 2019

How to configure NAS on Windows Server 2019

Preface

This tutorial installs the latest version. Since NAS makes it run very stably, try not to install any software that can be avoided.

1. Preparation

【Update system】

Nothing, I just want to use the latest one.

右鍵點擊開始鍵->設置->更新與安全

2. Smaba

【Install】

Official website: https://www.samba.org/

Command flow:

cd /source/
wget https://download.samba.org/pub/samba/samba-latest.tar.gz
tar -zxvf samba-latest.tar.gz
cd samba-latest

【Configuration】

The download here is the asp.net core I generated with vs2017, for demonstration only!

mkdir /web/www
cd /web/www
wget https://files.cnblogs.com/files/project/webapp.tar.gz
tar -zxf webapp.tar.gz

Supervisor

【Install】

Official website: http://www.supervisord.org/

Command flow:

yum install -y supervisor

【Configuration】

1. Copy files

mkdir /web/supervisor
cp /etc/supervisord.conf /web/supervisor

2. Open supervisord.conf

vim /web/supervisor/supervisord.conf

3. Add as follows

[program:webapp]
command=dotnet webapp.dll ;Command to be executeddirectory=/web/www/ ;Directory where the command is executedautostart=true ;Whether to start automaticallyautorestart=true ;Whether to restart automaticallystderr_logfile=/var/log/webapp.err.log ;Standard error logstdout_logfile=/var/log/webapp.out.log ;Standard output log

【run】

supervisord -c /web/supervisor/supervisord.conf

4. Nginx

【Install】

Official website: http://nginx.org/

Command flow:

rpm -Uvh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
yum install -y nginx

【Configuration】

1. Copy files

mkdir /web/nginx
cp /etc/nginx/nginx.conf /web/nginx
cp /etc/nginx/mime.types /web/nginx

2. Open nginx.conf

vim /web/nginx/nginx.conf

3. Modifications as follows

worker_processes 1;

events {
  worker_connections 1024;
}


http {
  include mime.types;
  default_type application/octet-stream;

  sendfile on;

  keepalive_timeout 65;

  gzip on;

  server {
    listen 80;
    server_name localhost;

    location / {
      proxy_pass http://127.0.0.1:5000;
      proxy_http_version 1.1;
      proxy_set_header Upgrade $http_upgrade;
      proxy_set_header Connection keep-alive;
      proxy_set_header Host $host;
      proxy_set_header X-Real-IP $remote_addr;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_cache_bypass $http_upgrade;
    }
  }
}

【run】

nginx -c /web/nginx/nginx.conf

5. Effect Preview

Appendix: Commonly used commands

nginx

# nginx //Start nginx
# nginx -s reload //Restart nginx
# nginx -s stop //Shut down nginx

supervisor

supervisord
supervisorctl status //View all task status supervisorctl shutdown //Close all tasks supervisorctl start|stop|restart all //Control all processes supervisorctl start|stop|restart program_name //Control target process

The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM.

You may also be interested in:
  • Windows Server 2019 Install (Graphical Tutorial)
  • Install Windows Server 2019 on VMware Workstation (Graphic Tutorial)
  • Windowsserver 2019 system installation tutorial with pictures and text
  • How to set up Windows Server 2019 (with pictures and text)

<<:  Detailed explanation of the definition and usage of MySQL stored functions (custom functions)

>>:  Detailed explanation of TS object spread operator and rest operator

Recommend

Detailed analysis and usage of tcpdump command under Linux

Introduction To put it simply, tcpdump is a packe...

How to create WeChat games with CocosCreator

Table of contents 1. Download WeChat developer to...

About converting textarea text to html, that is, carriage return and line break

Description: Change the carriage return in the tex...

vue+el-upload realizes dynamic upload of multiple files

vue+el-upload multiple files dynamic upload, for ...

Docker completely deletes private library images

First, let’s take a look at the general practices...

Vue implements page caching function

This article example shares the specific code of ...

Can Docker become the next "Linux"?

The Linux operating system has revolutionized the...

Discussion on the problem of iframe node initialization

Today I suddenly thought of reviewing the producti...

CSS3 achieves cool sliced ​​image carousel effect

Today we will learn how to use CSS to create a co...

How to use axios request in Vue project

Table of contents 1. Installation 2. There is no ...

How to limit the number of concurrent connection requests in nginx

Introduction The module that limits the number of...

Implementation of mounting NFS shared directory in Docker container

Previously, https://www.jb51.net/article/205922.h...

HTML meta viewport attribute description

What is a Viewport Mobile browsers place web page...