思绪的空中生活 发布的文章

notepad++批量删除某些形式一致的内容。
整理直播源的时候,由于vjms的源需要软解,但是用软解的话,在电视上的效果都要哭了,所以决定把vjms的源全部删掉。直播源的格式:
vjms://122.155.180.8:8500/live/cid=三位数字
前面都是一样的,只有=后面是不通的三位数字,所以选择正则替换,三位数字的表示方法:
[0-9][0-9][0-9]
于是,完整的替换格式出来了:
notepad++巧用正则替换实现删除

换域名了,重新提交sitemap,google自然是没有问题。
百度站长工具,前段时间验证的时候直接提交https是不能通过验证的,然后只能被迫提交的http。
换了新的域名后,今天提交https的网址居然通过验证了,但是提交sitemap显示抓取不成功。抓取诊断又是正常的,这就有点纠结了。
想来想去,直接提交了http形式的连接,没想到成功了。好吧,这样的话就看之后的效果了。
百度sitemap https

准备工作

配置服务器用到的软件
Xshell 5 下载链接: https://pan.baidu.com/s/1skJ6fet 密码: t5st
相关内容win10 下 Xshell 缺少 mfc110.dll msvcr110.dll解决办法

在管理中心查看自己的公网ip https://console.qcloud.com/cvm
在xshell里输入地址,用户名,密码连接
升级服务里的软件到最新版

yum update -y

xshell连接

安装OneinStack

OneinStack 是一个一键安装程序,可以方便的安装 Nginx、MySQL、PHP 这些程序,有这些才能让Wordpress正常运行
在终端逐步录入执行以下命令

yum -y install wget screen curl python   #for CentOS/Redhat
wget http://mirrors.linuxeye.com/oneinstack-full.tar.gz    #包含源码,国内外均可下载
tar xzf oneinstack-full.tar.gz    #解压
cd oneinstack    #如果需要修改目录(安装、数据存储、Nginx日志),请修改options.conf文件
screen -S oneinstack    #如果网路出现中断,可以执行命令`screen -r oneinstack`重新连接安装窗口
./install.sh     #注:请勿sh install.sh或者bash install.sh这样执行

oneinstack安装
安装的时间稍微有点长,耐心等待。

注意:请记录好你的数据库密码,后面会用到!!!
安装完成之后需要重启,重启之后在浏览器里面输入你的公网地址会出现OneinStack 安装成功的页面
OneinStack 安装成功

申请了腾讯云的SSL证书 在配置oneinstack时,./vhost.sh ssl选择y,以下是我配置时填写的内容:

  • 配置记录

Do you want to setup SSL under Nginx? [y/n]: y
Please input domain(example: www.example.com): sixu.life
Please input the directory for the domain:sixu.life :
(Default directory: /data/wwwroot/sixu.life):
Virtual Host Directory=/data/wwwroot/sixu.life
Create Virtul Host directory......
set permissions of Virtual Host directory......
domain=sixu.life
Do you want to add more domain name? [y/n]: y
Type domainname or IP(example: example.com other.example.com): www.sixu.life
domain list=www.sixu.life
Do you want to redirect from www.sixu.life to sixu.life? [y/n]: y
Do you want to redirect all HTTP requests to HTTPS? [y/n]: y
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
Country Name (2 letter code) [CN]: cn
State or Province Name (full name) [Shanghai]: SiChuan
Locality Name (eg, city) [Shanghai]: Sichuan
Organization Name (eg, company) [Example Inc.]: Sixu Inc
Organizational Unit Name (eg, section) [IT Dept.]: IT Dept
Do you want to add hotlink protection? [y/n]: n
Allow Rewrite rule? [y/n]: y
Please input the rewrite of programme :
wordpress,opencart,magento2,drupal,joomla,laravel,thinkphp,discuz,typecho,ecshop rewrite was exist.
(Default rewrite: other): typecho
You choose rewrite=typecho
Allow Nginx/Tengine/OpenResty access_log? [y/n]: y
You access log file=/data/wwwlogs/sixu.life_nginx.log
nginx: [warn] "ssl_stapling" ignored, issuer certificate not found
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
Reload Nginx......
nginx: [warn] "ssl_stapling" ignored, issuer certificate not found
Your domain: sixu.life
Virtualhost conf: /usr/local/nginx/conf/vhost/sixu.life.conf
Directory of: /data/wwwroot/sixu.life
Rewrite rule: /usr/local/nginx/conf/rewrite/typecho.conf
Self-signed SSL Certificate: /usr/local/nginx/conf/ssl/sixu.life.crt
SSL Private Key: /usr/local/nginx/conf/ssl/sixu.life.key
SSL CSR File: /usr/local/nginx/conf/ssl/sixu.life.csr

配置完成后可以看到证书存放的路径,这样的话,把申请到的证书通过winscp上传到此路径,然后重命名覆盖就行了,方便省事。
winscp下载链接: https://pan.baidu.com/s/1qY4MVKw 密码: fmgx
winscp

千万记得要重启nginx

nginx -s reload

重启nginx

申请地址:https://console.qcloud.com/ssl
选择免费版:

免费版DVSSL证书 DV SSL证书(Domain Validation SSL),只验证域名所有权,快速颁发,保证了网站的机密信息从用户浏览器到服务器之间的传输是高强度加密传输的,保证信息不会被非法窃取和非法篡改。
有效期1年

速度很快,从申请到颁发10分钟左右就完成了。
qcloud free ssl
不能直接填写根域名
选择手动dns验证
在域名管理后台添加一条cname记录即可,
添加cname记录
然后等待ca扫描,我等了10分钟左右就颁发了。