shadowsocks与nginx

正向代理 平常通过shadowsocks使用谷歌。 反向代理 利用nginx实现负载均衡

Published
Categorized as web

申请 ssl 证书

教程都在这里:酷壳 如何免费的让网站启用HTTPS 原来用的证书是阿里云上申请的免费Symantec证书,结果发现chrome上提示警告,以后的版本不会再支持。 Google Chrome正式宣布将不再信任赛门铁克所有SSL证书 教程里使用的Let’s Encrypt 是一个于2015年三季度推出的数字证书认证机构,将通过旨在消除当前手动创建和安装证书的复杂过程的自动化流程,並推廣使萬維網服務器的加密連接無所不在,为安全网站提供免费的SSL/TLS证书。 安装cerbot-nginx,运行报错了 urlib3 ImportError: No module named ‘requests.packages.urllib3’ PyOpenssl raise ImportError(“‘pyOpenSSL’ module missing required functionality. ” ImportError: ‘pyOpenSSL’ module missing required functionality. Try upgrading to v0.14 or newer. 网上都是说镜像里的软件版本太低,影响了apache cerbot。 更新系统阿里云镜像为163镜像,再把软件都更新了一遍。 然后用pip又把软件所有软件package更新一遍。 yum remove certbot-nginx -y #更新为163源 cd /etc/yum.repos.d #backup mv CentOS-Base.repo CentOS-Base.repo.bak wget http://mirrors.163.com/.help/CentOS6-Base-163.repo mv CentOS6-Base-163.repo CentOS-Base.repo yum… Continue reading 申请 ssl 证书

Published
Categorized as web

自定义tagline为网易邮箱greetings

自定义tagline为网易邮箱greetings,api是从网上找的 修改wp-includes/option.php 最后加入获取问候语的函数(因为返回来是数组,做了个简单随机) /** * getrandom greetings form 163.com */ function tagline_from_mail() { $URL = ‘http://jy4-app.mail.163.com/jy4-app/xhr/mbox/greetings/get.do’; $data = file_get_contents($URL); if($data === false){ return ‘梦, I LOVE YOU’; } //print_r($data); $json = json_decode(trim($data), true); //print_r($json); $greet_contents = $json[‘data’][‘contents’]; //print_r($greet_contents); $index = rand(0, sizeof($greet_contents)-1); $greet_content = $greet_contents[$index]; if(stripos($greet_content, ‘姓名,’) !== FALSE){ return mb_substr($greet_content, 3, -1, “utf-8”); }… Continue reading 自定义tagline为网易邮箱greetings

Published
Categorized as web

自定义首页图片为bing每日美图

将workpress 自定义为bing搜索的背景图片的方法,我这里改的是twentyseventeen theme。 将站点下的wp-content/themes/twentyseventeen/inc/custom-header.php中 twentyseventeen_custom_header_setup函数修改为如下函数: function twentyseventeen_custom_header_setup() { //bing api $url = ‘http://www.bing.com/HPImageArchive.aspx?format=js&idx=0&n=1&mkt=’; $resolution = ‘1920×1080’; // language options $locale = array( “zh-CN”, “en-US”, “ja-JP”, “en-AU”, “en-UK”, “de-DE”, “en-NZ” ); // parameters foreach ($locale as $lang) { $URL = $url.$lang; //print_r($URL); $data = file_get_contents($URL); if( $data === FALSE){ continue; } $json = json_decode(trim($data), true); if… Continue reading 自定义首页图片为bing每日美图

Published
Categorized as web

搭建WordPress博客

环境: os: lsb_release -a LSB Version: :core-4.1-amd64:core-4.1-noarch Distributor ID: CentOS Description: CentOS Linux release 7.4.1708 (Core) Release: 7.4.1708 Codename: Core 查看是否安装有php yum list |grep php 查看php版本 php -v 卸载旧版php yum remove php yum remove php* 安装php7 安装相关rpm rpm -Uvh http://mirror.centos.org/centos/7/extras/x86_64/Packages/epel-release-7-9.noarch.rpm rpm -Uvh http://repo.webtatic.com/yum/el7/x86_64/RPMS/webtatic-release-7-3.noarch.rpm rpm -Uvh http://mirror.centos.org/centos/7/os/x86_64/Packages/centos-release-7-4.1708.el7.centos.x86_64.rpm (RPM 可以到 https://pkgs.org/ 查找) 我安装的模块: yum install php70w yum… Continue reading 搭建WordPress博客

Published
Categorized as web