iOS Push Notification 之 Background RemoteNotification

Background RemoteNotification 最近在调查iOS Push Notification, 发现Background RemoteNotification这个功能还挺有意思的,做一下记录: 版本需求: iOS 7以上 使用方法:指定 aps 字段 "content-available" : 1 功能:在收到通知时,唤醒后台应用并执行自定义处理逻辑,可以用于从网络获取数据 准备条件 APNs 证书

read more »

Nginx+Node.js配置

试了Apache后感觉还是Nginx好用, 毕竟也是异步非阻塞的, 更适合配合Node.js. (虽然实际上据说性能相差不是很大) 配置文件: 主要做的是把所有www开头和非www开头的非加密请求, 全部301重定向到了https的非www开头域名上, 并且设置好了相应的 header. 跑了下 benchmark 感觉并发数和处理时间提升了5%左右, 还不错.

read more »

Ghost https 重定向 to many redirects 问题

在配置Ghost博客的http时出现了"to many redirects"的错误. 参考这个issue , 大意是Ghost本身会根据 X-Forwarded-Proto 判断是否用https, 而如果反向代理没有正确设置 ( 回想了一下应该是之前的配置的反向代理用的http访问node.js) , Ghost也会Redirect到https地址. 解决方案: 修改Apache的配置, 添加 RequestHeader set X-Forwarded-Proto "https" 到最终和Node.js通讯的VirtualHost配置中,

read more »

Centos7 配置 Apache + Node.js with SSL

之前一直用的是LNMP,配合Wordpress效果还不错。最近自己也写了不少Javascript,想了想尝试换成Node.JS加Ghost博客。考虑到Node本身的局限,以及之后有可能架设多个网站,用Apache做反向代理(当然Nginx也可以)。 在Centos下安装Apache yum -y update yum -y install httpd systemctl enable httpd 可以用 apachectl -V 命令看到当前安装的版本。这里安装的是Apache/2.

read more »

Shadowsocks systemd 配置

更新了下服务器,第一件事当然是配Shadowsocks了,这次换上了新的Centos 7,刚好可以用systemd管理服务,于是顺手配置了nobody自启动的Shadowsocks服务,配置文件如下: /usr/lib/systemd/system/shadowsocks.service [Unit] Description=Shadowsocks Server After=network.target [Service] PermissionsStartOnly=true ExecStartPre=/bin/mkdir

read more »