图解机器学习 github_使用Github和Cloudflare建立网站的图解指南

图解机器学习 github

by Karan Thakkar

由Karan Thakkar

使用GitHub和Cloudflare建立网站的插图指南 (An illustrated guide to setting up your website using GitHub and Cloudflare)

You should read this if…

如果...,您应该阅读此内容

  1. You want to setup custom redirects or other server configuration for free

    您想免费设置自定义重定向或其他服务器配置

  2. You want to get your site on HTTPS but don’t know where to start

    您想在HTTPS上获取您的网站,但不知道从哪里开始
  3. You’re overwhelmed with the amount of choices out there (like Netlify, Surge, BitBalloon, Now)

    您不知所措,那里的选择太多了(如Netlify , Surge , BitBalloon , Now )

为什么选择Github? (Why Github?)

  1. Easy to setup and get started with Github Pages

    易于设置并开始使用Github Pages
  2. Instant deploys on pushing new code

    即时部署以推送新代码

为什么选择Cloudflare? (Why Cloudflare?)

  1. It’s free

    免费
  2. It comes with out-of-the-box support for SSL (HTTPS). (Here’s why HTTPS matters.)

    它具有对SSL(HTTPS)的开箱即用的支持。 ( 这就是HTTPS很重要的原因 。)

  3. Super simple DNS management

    超级简单的DNS管理
  4. Ability to set browser cache expiration for assets

    可以设置资产的浏览器缓存到期时间

  5. Auto minify your static assets

    自动缩小您的静态资产
  6. Custom page rules for setting up redirects, always HTTPS, etc.

    用于设置重定向(始终为HTTPS等)的自定义页面规则。
  7. HTTP2/SPDY for supported browsers

    适用于支持的浏览器的HTTP2 / SPDY

  8. Allows for setting up HSTS (HTTP Strict Transport Security)

    允许设置HSTS (HTTP严格传输安全性)

在我们开始之前,您需要做一些事情: (Before we get started you will need a few things:)

  1. A Github account

    一个Github帐户

  2. A Cloudflare account

    Cloudflare帐户

  3. Access to a custom domain. You can buy it from any Domain Name Registrar like: Namecheap, GoDaddy, BigRock, etc.

    访问自定义域。 您可以从任何域名注册商处购买它,例如: Namecheap , GoDaddy , BigRock等。

If all this piqued your interest, then let’s get started!

如果这一切引起了您的兴趣,那就开始吧!

第1步 :使用您的代码创建Github存储库 (Step 1: Create Github repo with your code)

  • Go to https://pages.github.com

    转到https://pages.github.com

  • Select the option Project Site to find the instructions on how to create a basic page from scratch or a custom theme

    选择选项“ 项目站点”以查找有关如何从头开始或自定义主题创建基本页面的说明。

步骤2.为存储库设置Github Pages (Step 2. Setup Github Pages for the repository)

Go to Settings for your repository. In the Github Pages section, choose the master branch to serve your website from. Once you’ve done that, you can go to https://<yourgithubusername>.github.io/repository to see your website in action as shown below.

转到存储库的设置 。 在Github Pages部分中,选择master分支来服务您的网站。 完成此操作后,您可以转到https:// <yourgithubuserna me> .gith u b.io/repo 的理论来查看您的网站的运行情况,如下所示。

步骤3.添加自定义域 (Step 3. Add custom domain)

Add the custom domain that you have bought and save it. Your website is now ready with your own custom domain ? WOOT! ✨

添加您购买的自定义域并保存。 您的网站现在可以使用您自己的自定义域了吗? 哇! ✨

So, we have everything setup on Github. We’ll start with setting up Cloudflare to jazz up your website with all the powerful features I mentioned at the beginning of this post.

因此,我们在Github上进行了所有设置。 我们将从设置Cloudflare开始,用我在本文开头提到的所有强大功能来增强您的网站。

步骤4:在Cloudflare上设置您的域 (Step 4: Setup your domain on Cloudflare)

Login to Cloudflare. If you are using it for the first time, you should see a screen like the image shown above. If you have used it before, you can click on the Add Site option in the navigation bar on the top right to add a new domain. Enter the domain you want to manage and click on Begin Scan.

登录到Cloudflare 。 如果是第一次使用它,应该会看到如上图所示的屏幕。 如果您以前使用过它,则可以单击右上角导航栏中的“ 添加站点”选项来添加新域。 输入您要管理的域,然后单击开始扫描

步骤5:为您的域设置DNS记录 (Step 5: Setup DNS Records for your domain)

In this step, we inform Cloudflare to point our domain to the Github Pages server using two A Record DNS entries: 1. 192.30.252.1532. 192.30.252.154

在这一步中,我们通知Cloudflare使用两个A Record DNS条目将我们的域指向Github Pages服务器 :1. 192.30.252.1532。 192.30.252.154

Once you have set this up, all requests to your custom domain i.e. yourcustomdomain.com will be routed to your website on Github on Step 3.

设置完成后,到您的自定义域(即yourcustomdomain.com)的所有请求都将在第3步被路由到Github上的您的网站。

There’s one more step involved before we move on to the next stage. Oftentimes, you would want to use a subdomain like www for your website, i.e. www.yourcustomdomain.com For this, you will need to add a CNAME record DNS entry which will point your subdomain(www) to your apex domain(@).

在我们进入下一个阶段之前,还需要再走一步。 通常,您可能希望使用像www这样的子域作为您的网站,即www.yourcustomdomain.com 。为此,您需要添加一个CNAME记录 DNS条目,它将您的子域(www)指向顶点域(@)。

Once you have set this up, all requests to your custom subdomain i.e. www.yourcustomdomain.com will be routed to your website on Github on Step 3.

设置完成后,所有对您的自定义子域(例如www)的请求。 yourcustomdomain.com将在第3步被路由到您在Github上的网站。

NOTE: Don’t try to go access your custom domain right away. It won’t work. We have only done the Cloudflare to Github setup. We still have to do the DNS Registrar -> Cloudflare setup. This will come up in Step 7.

注意:不要尝试立即访问您的自定义域。 它不会工作。 我们仅完成了Cloudflare至Github的设置。 我们仍然必须进行DNS注册器-> Cloudflare设置。 这将在第 7 页中提出

Click Continue to go to the next step.

单击继续转到下一步。

第6步:选择免费Cloudflare计划 (Step 6: Choose the Free Cloudflare plan)

The Free plan for Cloudflare provides a lot of sophisticated options as discussed in the Why Cloudflare? section at the beginning.

Cloudflare的免费计划提供了许多复杂的选项,如为何选择Cloudflare? 开头部分。

Click Continue to go to the next step.

单击继续转到下一步。

步骤7:在DNS注册器上更新名称服务器 (Step 7: Update Nameservers on your DNS Registrar)

Once you’re on this page, keep it open in one tab and open your DNS Registrar’s (the place from where your bought your domain) site in another. If you’re using one of the following registrar’s then the links to understand how to change Nameserver are:

进入此页面后,在一个选项卡中将其保持打开状态,然后在另一个选项卡中打开DNS注册器(您购买域名的地方)站点。 如果您使用以下注册商之一,则可以了解如何更改名称服务器的链接是:

  1. Bigrock

    巨岩

  2. Namecheap

    便宜货

  3. GoDaddy

    去吧爸爸

You need to replace the existing Nameservers in your Domain settings with the one’s on the Cloudflare page that is open in the other tab.

您需要将“域”设置中的现有名称服务器替换为在另一个标签中打开的Cloudflare页面上的名称服务器。

YASSS! You’ve successfully setup your custom domain to use Cloudflare as a DNS provider. You can go to the Overview option on the top and you will find that it is still waiting for your Nameserver change to be processed.

YASSS! 您已经成功设置了自定义域,以将Cloudflare用作DNS提供程序。 您可以转到顶部的Overview选项,您会发现它仍在等待名称服务器更改被处理。

Once the Overview tab says Status: Active, you can now try to visit your site using your custom domain, AND IT SHOULD JUST WORK! ??

一旦“ 概述”标签显示“ 状态:有效” 您现在可以尝试使用您的自定义域访问您的网站, 并且应该可以正常使用! ??

步骤8:配置缩小 (Step 8: Configure Minification)

In the Speed setttings, in the Auto Minify section, choose the option to auto-minify everything: Javascript, CSS, HTML. This will be done by Cloudflare on-the-fly once and then cached. Whenever any of your assets change, Cloudflare will do this again for you.

在“ 速度设置”的“ 自动缩小”部分中,选择用于自动缩小所有内容的选项:Javascript,CSS,HTML。 这将由Cloudflare即时完成,然后进行缓存。 每当您的资产发生任何变化时,Cloudflare都会为您再次执行此操作。

The advantage of minification is that the size of the file delivered to your browser is a lot less since it strips off unwanted spaces and comments.

最小化的优点是,传递到浏览器的文件的大小要小得多,因为它会去除不必要的空格和注释。

步骤9:配置浏览器缓存过期 (Step 9: Configure Browser Cache Expiration)

If you scroll down on the same page as Auto Minify, you will find the Browser Cache Expiration section. It should be set to 30 days/1 month, ideally, for WebpageTest to not give you a warning. What this time indicates is that, once your site is loaded in any browser, then the browser will not request any assets for a second time until the Browser Cache time period expires for those assets.

如果您在与Auto Minify相同的页面上向下滚动,则会找到Browser Cache Expiration部分。 最好将其设置为30天/ 1个月,以使WebpageTest不向您发出警告。 这一次的意思是,一旦您的网站加载到任何浏览器中,然后浏览器将不会再次请求任何资产,直到这些资产的浏览器缓存时间段到期为止。

Before we move on to the next step, please check the Crypto settings on Cloudflare. It should say Active Certificate in the SSL section. (Note: Try reloading the page. Sometimes it doesn’t update). In the next two steps, we are going to make your site serve via HTTPS always. For that to work without any problems, it is important that you have an active certificate on Cloudflare.

在继续进行下一步之前,请检查Cloudflare上的Crypto设置。 它应该在SSL部分显示Active Certificate 。 ( 注意:尝试重新加载页面。有时它不会更新 )。 在接下来的两个步骤中,我们将使您的网站始终通过HTTPS服务 为了使它正常工作,在Cloudflare上拥有有效的证书很重要。

步骤10:配置页面规则 (Step 10: Configure Page Rules)

In this step, we are going to do two things:

在这一步中,我们将做两件事:

  1. Redirect all requests for www.yourcustomdomain.com to yourcustomdomain.com

    将对 www.yourcustomdomain.com的所有请求重定向到yourcustomdomain.com

  2. Redirect all requests for http://yourcustomdomain.com to https://yourcustomdomain.com

    将对http://yourcustomdomain.com的所有请求重定向到https://yourcustomdomain.com

Go to the Page Rules setting and click on Create Page Rule.

转到页面规则设置,然后单击创建页面规则。

For handling the www.yourcustomdomain.com to yourcustomdomain.com redirect, replace tweetify.io with yourcustomdomain.com name. Click Save and Deploy.

要处理www.yourcustomdomain.comyourcustomdomain.com重定向,请将tweetify.io替换为yourcustomdomain.com名称。 单击保存并部署

For handling the http://yourcustomdomain.com to https://yourcustomdomain.com redirect, replace tweetify.io with yourcustomdomain.com name. Click Save and Deploy.

要处理从http://yourcustomdomain.comhttps://yourcustomdomain.com重定向,请将tweetify.io替换为yourcustomdomain.com名称。 单击保存并部署

步骤11:配置HSTS (Step 11: Configure HSTS)

Go to the Crypto settings and scroll down to the HTTP Strict Transport Security (HSTS) section. Click on Enable HSTS. This will ask you to acknowledge that you know what you are doing. Before you select I understand, let me tell you why we need to enable this setting:

转到“ 加密设置”,然后向下滚动到“ HTTP严格传输安全性(HSTS)”部分。 单击启用HSTS 。 这将要求您确认您知道自己在做什么。 在选择我理解之前,让我告诉您为什么我们需要启用此设置:

If a user has opened your website in the past, from then onwards whenever the user tries to access your website, they will always be taken to the HTTPS version of your site. This makes your site load a little faster on subsequent visits because the HTTP to HTTPS redirect happens on the client and not via the Cloudflare Page Rule that we added in Step 10.

如果用户过去曾经打开过您的网站,从此以后,只要该用户尝试访问您的网站,他们将始终被带到您网站的HTTPS版本。 这使您的站点在后续访问中的加载速度更快,因为HTTP到HTTPS重定向是在客户端而不是通过我们在步骤10中添加的Cloudflare页面规则进行的。

Once you go to the next step, you should enable all the settings as shown below. You can read more details about these options here and here

转到下一步后,应启用所有设置,如下所示。 您可以在此处和此处阅读有关这些选项的更多详细信息

That’s it. You’re all set to show off your website to the world! ?? If you found this useful, please ❤️ it and share it.

而已。 你们都准备向全世界展示您的网站! ?? 如果您发现此功能有用,请❤️并分享。

Karan Thakkar is the Frontend Lead at Crowdfire - Your super-smart marketing sidekick. His article has been previously featured on The Huffington Post. He likes trying out new technologies in his spare time and has built Tweetify (using React Native) and Show My PR’s (using Golang).

Karan Thakkar是Crowdfire的前端主管- 您的超级智能营销伙伴 。 他的文章以前曾在《赫芬顿邮报 》上发表过 。 他喜欢在业余时间尝试新技术,并建立了Tweetify (使用React Native)和Show My PR (使用Golang)。

Other articles written by him:

他写的其他文章:

How I grew from 300 to 5k followers in just 3 weeks#GrowthHacking my Twitter account for @Crowdfire Twitter Premier Leagueblog.markgrowth.comUsing the Let’s Encrypt Certbot to get HTTPS on your Amazon EC2 NGINX boxLet’s Encrypt is a new Certificate Authority which provides free SSL certificates (up to a certain limit per week). It…medium.freecodecamp.com

我从300如何成长为5K的追随者在短短三周内, #GrowthHacking我的Twitter账户@Crowdfire Twitter的英超 blog.markgrowth.com 使用让我们加密Certbot以获得HTTPS在您的Amazon EC2 NGINX盒 让我们加密是一个新的证书颁发机构,其提供免费的SSL证书(每周最多有一定限制)。 它… medium.freecodecamp.com

翻译自: https://www.freecodecamp.org/news/an-illustrated-guide-for-setting-up-your-website-using-github-cloudflare-5a7a11ca9465/

图解机器学习 github

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/395898.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

ajax拼接显示不同样式,Ajax重点整理

Ajax工作流程Ajax:在不刷新页面的情况下向服务器请求数据1.创建XMLHttpRequest对象(俗称小黄人)var xhr new XMLHttpRequest();XMLHttpRequest &#xff1a; http请求对象&#xff0c;负责实现ajax技术2.设置请求xhr.open(get, url);url:服务器地址3.发送请求xhr.send();4.注册…

java与mysql的交互_java与数据库交互常用到的一些方法

下面我整理了一下java中常用的几个与数据库交互的常用方法&#xff0c;仅供参考&#xff1a;1.执行SQL(dao层的实现类中)(1)SQL查询&#xff1a;//import org.hibernate.Query;//import org.hibernate.Session;/*** 通过名称查找id*parampsname*returnid*/OverridepublicString…

xbmc电脑版本和手机版本学习教程

XBMC改名为Kodi了&#xff0c;IOS系统&#xff0c;Cydia源地址也同样发生了变化&#xff0c;新的源是&#xff1a;http://mirrors.kodi.tv/apt/ios/先了解一下几点知识&#xff1a; 教程中的各项操作&#xff0c;默认起始点都是“主界面”或“各分类菜单&#xff08;视频、音乐…

线程管理(七)守护线程的创建和运行

声明&#xff1a;本文是《 Java 7 Concurrency Cookbook 》的第一章&#xff0c; 作者&#xff1a; Javier Fernndez Gonzlez 译者&#xff1a;郑玉婷 校对&#xff1a;方腾飞 守护线程的创建和运行 Java有一种特别的线程叫做守护线程。这种线程的优先级非常低&#xff0c;通常…

vue2中的keep-alive使用总结及注意事项

问题总结;最近在写vue移动端的项目的时候,当我切换菜单,再切换换回去的时候,发现页面出现闪动的效果,其原因是因为切换回去之后,页面重新渲染了;为了解决这一问题:查阅资料,只需要在 入口文件 App.vue 的router-view外层包裹一个keep-active标签,表示该组件被保存在内存中,不需…

grove 套件_如何通过使用Andy Grove的High Leverage Activities加快发展?

grove 套件by Guido Schmitz由Guido Schmitz 如何通过使用Andy Grove的High Leverage Activities加快发展&#xff1f; (How to speed up your development by using Andy Grove’s High Leverage Activities ?) Youre constantly building on new features, fixing new bugs…

ajax php 观察者模式,JavaScript观察者模式定义和dom事件实例详解

观察者模式(发布-订阅模式)&#xff1a;其定义对象间一种一对多的依赖关系&#xff0c;当一个对象的状态发生改变时&#xff0c;所有依赖于它的对象都将得到通知。在JavaScript中&#xff0c;一般使用事件模型来替代传统的观察者模式。好处&#xff1a;(1)可广泛应用于异步编程…

python中代码段的标志是什么车_请问这段Python代码是什么意思?

ord(p) - ord(a)这个意思是以 a 为序号0&#xff0c;计算字符p的序号。在ASCII字符集中&#xff0c;小写字母a-z是连续排列的&#xff0c;因此如果a是0的话&#xff0c;那么b就是1&#xff0c;c就是2……以此类推。ord(p) - ord(a) 3前面一段我们解释过了&#xff0c;那么这一…

servlet和jsp页面过滤器Filter的作用及配置

刚刚有个朋友问我&#xff0c;Servlet的过滤器有什么作用&#xff1f; 现在发个帖子说明一下&#xff0c; 过滤器是一个对象&#xff0c;可以传输请求或修改响应。它可以在请求到达Servlet/JSP之前对其进行预处理&#xff0c;而且能够在响应离开Servlet /JSP之后对其…

tar命令速查

tar -c: 建立压缩档案-x&#xff1a;解压-t&#xff1a;查看内容-r&#xff1a;向压缩归档文件末尾追加文件-u&#xff1a;更新原压缩包中的文件 这五个是独立的命令&#xff0c;压缩解压都要用到其中一个&#xff0c;可以和别的命令连用但只能用其中一个。下面的参数是根据需要…

附005.Docker Compose文件详解

一 Docker Compose文件简介 compose文件使用yml格式&#xff0c;主要分为了四个区域&#xff1a;version&#xff1a;用于指定当前docker-compose.yml语法遵循哪个版本services&#xff1a;服务&#xff0c;在它下面可以定义应用需要的一些服务&#xff0c;每个服务都有自己的名…

如何使用TensorFlow构建简单的图像识别系统(第2部分)

by Wolfgang Beyer沃尔夫冈拜尔(Wolfgang Beyer) 如何使用TensorFlow构建简单的图像识别系统(第2部分) (How to Build a Simple Image Recognition System with TensorFlow (Part 2)) This is the second part of my introduction to building an image recognition system wi…

网站 服务器 用sqlite,sqlite服务器数据库

sqlite服务器数据库 内容精选换一换简要介绍SQLite是一款轻量级的关系型数据库&#xff0c;它的运算速度非常快&#xff0c;占用资源很少&#xff0c;不仅支持标准的SQL语法&#xff0c;还遵循了数据库的ACID事务。编写语言&#xff1a;C一句话概述&#xff1a;轻量级的关系型数…

type-c接口图片_TypeC接口除了充电还能干吗?这些功能都不知道,简直是在浪费...

Type C手机接口相信每个使用智能手机的朋友都很熟悉&#xff0c;目前已经广泛使用在智能手机领域&#xff0c;并且得到用户一致好评。但是对于Type C接口真正的用处很少有人知道&#xff0c;大部分用户只了解正反面都可充电&#xff0c;其他方面一概不知&#xff0c;对于这一点…

Zookeeper的api的简单使用(转载)

转载自: http://www.cnblogs.com/sunddenly/p/4031881.html 1.API 2.API 示例 ZooKeeper中的组成员关系 理解ZooKeeper的一种方法就是将其看作一个具有高可用性的文件系统。但这个文件系统中没有文件和目录&#xff0c;而是统一使用“节点”(node)的概念&#xff0c;称为znode…

必须使用301重定向的运用场景

必须使用301重定向的运用场景

1.1好素数

题目 题意&#xff1a;一个好素数的定义是&#xff0c;他是一个素数&#xff0c;然后他的左右两边10区间内存在素数&#xff0c;那么他就是好素数&#xff0c;现在让你输入一个数字&#xff0c;这个数字以内的好素数的数量。 解题方法&#xff1a;先把每一个数字是不是素数判断…

jquery.vue.js_一个Vue.js简介,面向只了解jQuery的人

jquery.vue.jsby Matt Rothenberg马特罗森伯格(Matt Rothenberg) 一个Vue.js简介&#xff0c;面向只了解jQuery的人 (A Vue.js introduction for people who know just enough jQuery to get by) I’ve had a love-hate relationship with JavaScript for years.我与JavaScrip…

python 矩阵获取行数_4个最佳项目创意的代码片段和示例,旨在为Python和机器学习构建出色的简历!...

点击上方“小白学视觉”&#xff0c;选择加"星标"或“置顶”重磅干货&#xff0c;第一时间送达一篇文章带你了解4个最佳项目创意的代码片段和示例Python是一种特殊的编程语言&#xff0c;适用于从初学者到中级用户。由于它的灵活性&#xff0c;它正逐渐成为一种非常流…

Android 多状态加载布局的开发 Tips

2019独角兽企业重金招聘Python工程师标准>>> 什么是多状态 Layout 对于大多数 App 而言&#xff0c;项目中都有多状态加载 View 这种需求&#xff0c;如下图所示。 对应到开发中&#xff0c;我们通常会开发一个对应的自定义 layout 用于根据页面不同的状态来显示不同…