序言


此教程安装的都是最新版本的。由于是当NAS让它非常稳定的运行,所以能不安装的软件尽量不要安装。

一、准备工作


【更新系统

没啥,就他喵想用个最新的。

右键点击开始键->设置->更新与安全

二、Smaba


【安装】

官方网站:https://www.samba.org/

命令流程:

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

【配置】

此处下载的是我用vs2017生成的asp.net core,仅供演示!

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

三、Supervisor


【安装

官方网站:http://www.supervisord.org/

命令流程:

yum install -y supervisor

【配置】

1、复制文件

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

2、打开supervisord.conf

vim /web/supervisor/supervisord.conf

3、追加如下

[program:webapp]
command=dotnet webapp.dll ;要执行的命令
directory=/web/www/ ;命令执行的目录
autostart=true ;是否自动启动
autorestart=true ;是否自动重启
stderr_logfile=/var/log/webapp.err.log ;标准错误日志
stdout_logfile=/var/log/webapp.out.log ;标准输出日志

【运行】

supervisord -c /web/supervisor/supervisord.conf

四、Nginx


【安装】

官方网站:http://nginx.org/

命令流程:

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

【配置】

1、复制文件

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

2、打开nginx.conf

vim /web/nginx/nginx.conf

3、修改如下

worker_processes  ;

events {
worker_connections ;
} http {
include mime.types;
default_type application/octet-stream; sendfile on; keepalive_timeout ; gzip on; server {
listen ;
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;
}
}
}

【运行】

nginx -c /web/nginx/nginx.conf

五、效果预览


、常用命令


 nginx

# nginx             //启动nginx
# nginx -s reload //重启nginx
# nginx -s stop //关闭nginx

supervisor

supervisord
supervisorctl status //查看所有任务状态
supervisorctl shutdown //关闭所有任务
supervisorctl start|stop|restart all //控制所有进程
supervisorctl start|stop|restart program_name //控制目标进程

[原创]在Windows Server 2019上配置NAS的更多相关文章

  1. 手把手教您在 Windows Server 2019 上使用 Docker

    配置 Windows 功能 要运行容器,您还需要启用容器功能 Install-WindowsFeature -Name Containers 在 Window Server 2019 上安装 Dock ...

  2. 在Windows Server 2019上安装edge浏览器

    在Windows 2016和2019的正式版本中是不带Edge浏览器的.有些工具.网站也不支持IE浏览器了.对于偶尔需要在服务器上访问这些站点的管理员来说有些不方便.不过可以通过安装三方浏览器或者Ed ...

  3. Windows Server 2016 上配置 APACHE+SSL+PHP+perl

    Windows Server 2016 上配置 APACHE+SSL+PHP+perl 安装环境 谷歌云实例 Windows Server 2016 Apache Apache/2.4.25 (win ...

  4. MySQL 8.0.18 在 Windows Server 2019 上的安装(ZIP)公开

    AskScuti MySQL : Windows Server 2019 安装 MySQL 8.0 温馨提示:为了展现我最“魅力”的一面,请用谷歌浏览器撩我. 一切就绪,点我开撩

  5. MySQL 8.0.18 在 Windows Server 2019 上的安装(MSI)公开

    AskScuti MySQL : Windows Server 2019 安装 MySQL 8.0 温馨提示:为了展现我最“魅力”的一面,请用谷歌浏览器撩我.那个 IE 啊,我很无奈. 一切就绪,点我 ...

  6. 如何在windows server 2008上配置NLB群集

    参考:http://zlwdouhao.blog.51cto.com/731028/781828 前些天写了一篇关于NLB群集模式多播和单播的简单介绍.那么下面我们一起来探讨一下,如何在windows ...

  7. 在Windows Server 2019中配置多元密码策略

    长久以来,微软活动目录中的账户只能配置同一个密码策略.上到管理员账户,下到普通用户的密码策略都是一样的.而且密码策略只能在域级别配置生效.OU级别的密码策略只会对该OU中计算机的本地账户生效.通常认为 ...

  8. Windows Server 2019 容器化探索-Docker安装

    Docker on Windows Server 2019 微软自Windows Server 2016开始支持Docker,今天我们将介绍在Windows Server 2019上安装并使用Dock ...

  9. 1级搭建类111-Oracle 19c SI FS(Windows Server 2019)公开

    Oracle 19c 单实例文件系统在Windows Server 2019上的安装 在线查看

随机推荐

  1. 数据结构1:数据结构与算法C语言版分析概述

    本节开始将带领大家系统地学习数据结构,作为一门计算机专业大二学生的必修课程,该课程面对的目标人群为初步具备基本编程能力和编程思想的程序员(大一接触了 C 语言或者 C++).通过系统地学习数据结构,可 ...

  2. MySQL中join的用法

    近期用phpcms v9做项目,初期没有问题,后期随着数据量的增大,phpcms v9后台出现的栏目更新不动的情况,初期我以为是程序的问题,进行了程序排查,没有发现任何问题,登录上centos服务器后 ...

  3. zabbix+telegram的API接口(告警)

    首先在telegram里创建一个有API接口的用户,创建是在   @BotFather 选择/start——————/newbot 输入机器人的用户名,根据提示操作.获得bot的API接口和群ID 通 ...

  4. 【转】Automated Testing Detail Test Plan

    Automated Testing Detail Test PlanAutomated Testing DTP Overview This Automated Testing Detail Test ...

  5. 华东交通大学2015年ACM“双基”程序设计竞赛1001

    Problem A Time Limit : 3000/1000ms (Java/Other)   Memory Limit : 65535/32768K (Java/Other) Total Sub ...

  6. sqlserver 数据库阻塞和死锁

    参考原文:http://blog.csdn.net/ha196200/article/details/44985597 (1) 数据库阻塞: 假设第一个连接T1占有且没有释放资源,第二个连接T2请求同 ...

  7. How to Setup MySQL (Master-Slave) Replication in CentOS

    The following tutorial aims to provide you a simple step-by-step guide for setting up MySQL (Master- ...

  8. mysql 中decimal中去掉后面多余的0

    #去除Decimal后面多余的0 #处理前SELECT '0.12000','1.203010','-0.20' #处理后SELECT 0+CAST('0.12000' AS CHAR),0+CAST ...

  9. 页面中使用多个element-ui upload上传组件时绑定对应元素

    elemet-ui里提供的upload文件上传组件,功能很强大,能满足单独使用的需求,但是有时候会存在多次复用上传组件的需求,如下图的样子,这时候就出现了问题,页面上有多个上传组件时,要怎么操作呢? ...

  10. python文件引用其他文件中的变量

    问题: 然后再另一个文件中引用该变量 报错:Cannot find reference 'User_Agent' in '__init__.py' less... (Ctrl+F1) 正确写法: fr ...