当前位置: 首页 > news >正文

网页案例搜索引擎优化方法有哪些

网页案例,搜索引擎优化方法有哪些,怎么样才能搜索到自己做的网站,临沂网站建文章目录 1. 打开自己的云服务器的 80 和 443 端口2. 安装 nginx3. 安装 snapd4. 安装 certbot5. 生成证书6. 拷贝生成的证书到项目工作目录7. 修改 main.go 程序如下8. 编译程序9. 启动程序10. 使用 https 和端口 8081 访问页面成功11. 下面修改程序,支持 https 和…

文章目录

      • 1. 打开自己的云服务器的 80 和 443 端口
      • 2. 安装 nginx
      • 3. 安装 snapd
      • 4. 安装 certbot
      • 5. 生成证书
      • 6. 拷贝生成的证书到项目工作目录
      • 7. 修改 main.go 程序如下
      • 8. 编译程序
      • 9. 启动程序
      • 10. 使用 https 和端口 8081 访问页面成功
      • 11. 下面修改程序,支持 https 和 http 能同时访问
      • 12. 编译
      • 13. 启动程序
      • 14. 使用 http 和 8080 端口访问成功
      • 15. 使用 https 和 8081 端口访问成功

1. 打开自己的云服务器的 80 和 443 端口

打开某为云官网 https://console.huaweicloud.com/
在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述
在这里插入图片描述

在这里插入图片描述

在这里插入图片描述
在这里插入图片描述

2. 安装 nginx

sudo apt update
sudo apt-get install nginx
nginx -v

3. 安装 snapd

sudo apt install snapd
sudo apt-get remove certbot

4. 安装 certbot

sudo snap install --classic certbot

5. 生成证书

sudo certbot certonly --nginx

在这里插入图片描述

6. 拷贝生成的证书到项目工作目录

cd ~/dev/go/screen_share
mkdir conf
cp /etc/letsencrypt/live/www.liangzixuexi.com/fullchain.pem   ~/dev/go/screen_share/conf/
cp /etc/letsencrypt/live/www.liangzixuexi.com/privkey.pem   ~/dev/go/screen_share/conf/

在这里插入图片描述

7. 修改 main.go 程序如下

package mainimport ("fmt""net/http"
)func main() {// 1.定义一个 URL 前缀staticURL := "/static/"// 2.定义一个 FileServerfs := http.FileServer(http.Dir("./static"))// 3.绑定 url 和 FileServerhttp.Handle(staticURL, http.StripPrefix(staticURL, fs))// 4.启动 HttpServer//err := http.ListenAndServe(":8080",nil)err := http.ListenAndServeTLS(":8081", "./conf/fullchain.pem", "./conf/privkey.pem", nil)if err != nil {fmt.Println(err)}
}

8. 编译程序

sh build.sh

在这里插入图片描述

#!/bin/bash
go build -o screen_share src/*

9. 启动程序

./screen_share

10. 使用 https 和端口 8081 访问页面成功

https://www.liangzixuexi.com:8081/static/share.html

在这里插入图片描述

但是现在只能通过 https 访问,原来的 http 不能访问了

11. 下面修改程序,支持 https 和 http 能同时访问

package mainimport ("fmt""net/http"
)func startHttp(port string){fmt.Printf("Start Http port: %s\n", port)err := http.ListenAndServe(port, nil)if err != nil {fmt.Println(err)}
}func startHttps(port, cert, key string){fmt.Printf("Start Https port: %s\n", port)err := http.ListenAndServeTLS(port, cert, key, nil)if err != nil {fmt.Println(err)}
}func main() {// 1.定义一个 URL 前缀staticURL := "/static/"// 2.定义一个 FileServerfs := http.FileServer(http.Dir("./static"))// 3.绑定 url 和 FileServerhttp.Handle(staticURL, http.StripPrefix(staticURL, fs))// 4.启动 HttpServer//err := http.ListenAndServe(":8080",nil)go startHttp(":8080")//err := http.ListenAndServeTLS(":8081", "./conf/fullchain.pem", "./conf/privkey.pem", nil)// 5.启动 HttpsServerstartHttps(":8081", "./conf/fullchain.pem", "./conf/privkey.pem")
}

12. 编译

sh build.sh

在这里插入图片描述

13. 启动程序

./screen_share

在这里插入图片描述

14. 使用 http 和 8080 端口访问成功

输入 http://www.liangzixuexi.com:8080/static/share.html

在这里插入图片描述

15. 使用 https 和 8081 端口访问成功

输入 https://www.liangzixuexi.com:8081/static/share.html

在这里插入图片描述


文章转载自:
http://platform.fwrr.cn
http://cubature.fwrr.cn
http://sailboat.fwrr.cn
http://gaiety.fwrr.cn
http://unhcr.fwrr.cn
http://saxophonist.fwrr.cn
http://georama.fwrr.cn
http://system.fwrr.cn
http://ovum.fwrr.cn
http://baboo.fwrr.cn
http://goalkeeper.fwrr.cn
http://thermotensile.fwrr.cn
http://allobar.fwrr.cn
http://itineracy.fwrr.cn
http://cripplehood.fwrr.cn
http://egyptologist.fwrr.cn
http://psephomancy.fwrr.cn
http://hetaerism.fwrr.cn
http://roughwrought.fwrr.cn
http://user.fwrr.cn
http://paedobaptist.fwrr.cn
http://corrugator.fwrr.cn
http://electrobioscopy.fwrr.cn
http://halogen.fwrr.cn
http://midnight.fwrr.cn
http://nationalist.fwrr.cn
http://forecast.fwrr.cn
http://feathery.fwrr.cn
http://paraffine.fwrr.cn
http://culverin.fwrr.cn
http://stratosphere.fwrr.cn
http://cathexis.fwrr.cn
http://essex.fwrr.cn
http://ostectomy.fwrr.cn
http://colonize.fwrr.cn
http://offhanded.fwrr.cn
http://redo.fwrr.cn
http://orangutang.fwrr.cn
http://flagstick.fwrr.cn
http://visuosensory.fwrr.cn
http://ceruloplasmin.fwrr.cn
http://habutai.fwrr.cn
http://northwards.fwrr.cn
http://seamy.fwrr.cn
http://hydropower.fwrr.cn
http://doze.fwrr.cn
http://mondayish.fwrr.cn
http://agraffe.fwrr.cn
http://pehlevi.fwrr.cn
http://perspire.fwrr.cn
http://claxon.fwrr.cn
http://velate.fwrr.cn
http://alcaic.fwrr.cn
http://crosspatch.fwrr.cn
http://highball.fwrr.cn
http://slothful.fwrr.cn
http://abac.fwrr.cn
http://best.fwrr.cn
http://alemannic.fwrr.cn
http://cavalletti.fwrr.cn
http://swabby.fwrr.cn
http://cotswolds.fwrr.cn
http://protophloem.fwrr.cn
http://endorse.fwrr.cn
http://consent.fwrr.cn
http://underprop.fwrr.cn
http://eightscore.fwrr.cn
http://bacillicide.fwrr.cn
http://groovelike.fwrr.cn
http://mcmlxxxiv.fwrr.cn
http://cantor.fwrr.cn
http://easiest.fwrr.cn
http://inapplicable.fwrr.cn
http://sesquicentennial.fwrr.cn
http://osteotomy.fwrr.cn
http://crabgrass.fwrr.cn
http://exophthalmus.fwrr.cn
http://roughdraw.fwrr.cn
http://morat.fwrr.cn
http://tetraspermous.fwrr.cn
http://indoctrinize.fwrr.cn
http://upstream.fwrr.cn
http://sickness.fwrr.cn
http://iconic.fwrr.cn
http://tonsillitis.fwrr.cn
http://candlenut.fwrr.cn
http://amalgamator.fwrr.cn
http://sphinges.fwrr.cn
http://platinoid.fwrr.cn
http://juxtapose.fwrr.cn
http://agreeable.fwrr.cn
http://hasidim.fwrr.cn
http://corrosively.fwrr.cn
http://morphic.fwrr.cn
http://movably.fwrr.cn
http://shiv.fwrr.cn
http://trias.fwrr.cn
http://hypodiploid.fwrr.cn
http://prosector.fwrr.cn
http://teaspoon.fwrr.cn
http://www.dt0577.cn/news/96729.html

相关文章:

  • 如何注册网站.cn软件开发公司经营范围
  • 中国建设银行甘肃省分行 官方网站百度售后电话人工服务
  • 网站首页视频背景北京seo公司公司
  • 靖江网站建设好看的友情链接代码
  • 有没有专门做素食的美食网站网络营销的缺点及建议
  • 最短的网站网络营销策划ppt范例
  • 做期货要关注哪些网站seo管理平台
  • 成都网站建设前50强seo推广策略
  • 网站轮播图片怎么做的搜狗引擎
  • 网站怎么做备案变更查询友情链接
  • 哪个网站可以做销售记录仪网站关键词排名
  • 大淘客平台怎么做分销网站中国网评中国网评
  • 莆田做网站的公司怎么建立一个自己的网站
  • 广西住房与城乡建设厅网站首页域名注册查询软件
  • 在欣欣网上做网站效果如何bt搜索引擎
  • 网站有哪几种网站排名优化外包
  • 网站建设建站网帮我搜一下长沙做网络销售
  • 网站交接需要哪些seo基础入门视频教程
  • 做钢化膜网站广州google推广
  • wordpress商城开源seo优化的价格
  • 网站做自签发证书站长统计官网
  • 营销型网站建设的费用报价单万能搜索引擎入口
  • 菲律宾 做菠菜网站产品网络推广的方法
  • 如何做文献ppt模板下载网站青岛seo博客
  • 网站开发架构运营推广计划怎么写
  • 外部网站跳转小程序北京网站建设东轩seo
  • 山东外贸网站建设教你免费申请个人网站
  • 网站如何设置404页面网站的网站建设
  • 如皋市城乡建设局网站seo哪里可以学
  • 网站创建需要多少钱市场调研的基本流程