LearnGitBranching的本地部署

LearnGitBranching的本地部署

前提条件

  • 安装好Git
  • 安装好了NodeJS
  • 具有npm,并且安装了yarn工具
  • 安装了gulp

下载代码进行修改

获取项目

git clone https://github.com/pcottle/learnGitBranching

进入项目目录

cd learnGitBranching

根据自己需求修改内容,但是版权等内容应该尊重知识产权

打包部署

本地安装依赖打包:

yarn install
yarn gulp fastBuild
yarn gulp build

将这些文件拷贝到服务器的目录上,配置Nginx:

image-20220322172251240

我这里使用的是宝塔面板配置的:

image-20220322172900575

server
{
    listen 80;
	listen 443 ssl http2;
	# 网站的域名
    server_name xxxxx.com;
    index index.php index.html index.htm default.php default.htm default.html;
    root /www/wwwroot/learn-git;
    
    #SSL-START SSL相关配置,请勿删除或修改下一行带注释的404规则
    #error_page 404/404.html;
    #HTTP_TO_HTTPS_START
    if ($server_port !~ 443){
        rewrite ^(/.*)$ https://$host$1 permanent;
    }
    
    #禁止访问的文件或目录
    location ~ ^/(\.user.ini|\.htaccess|\.git|\.svn|\.project|LICENSE|README.md)
    {
        return 404;
    }
 
    location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
    {
        expires      30d;
        error_log /dev/null;
        access_log /dev/null;
    }
    
    location ~ .*\.(js|css)?$
    {
        expires      12h;
        error_log /dev/null;
        access_log /dev/null; 
    }
    access_log  /www/wwwlogs/learn-git.log;
    error_log  /www/wwwlogs/learn-git.log;
}
posted @ 2022-03-22 17:29  崔安兵  阅读(145)  评论(0编辑  收藏  举报