-
Notifications
You must be signed in to change notification settings - Fork 0
/
content.json
1 lines (1 loc) · 17.4 KB
/
content.json
1
{"meta":{"title":"Strive ~","subtitle":null,"description":null,"author":"Strive","url":"http://blog.biglx.cn"},"pages":[{"title":"","date":"2017-11-16T03:32:12.000Z","updated":"2018-12-24T05:54:39.443Z","comments":true,"path":"about/index.html","permalink":"http://blog.biglx.cn/about/index.html","excerpt":"","text":"关于我 个人信息 李理想/男/1995 工作年限:2年 个人博客:https://blog.biglx.cn Github:https://github.com/lilixiang99 微博:@木目心璇 联系方式 Tel/WeChat:15076290565 Email:[email protected] QQ:534529940 技能清单 Web开发:HTML5/PHP/nodeJs Web框架:ThinkPHP/Yii/laravel 前端框架:Bootstrap/AngularJS/Vue 二次开发:dedeCms/WordPress 数据库:Mysql/mongoDB/Redis 版本管理:Git 爬虫:Python 工作经验 北京盛哲科技有限公司(2016年6月至今)"},{"title":"分类","date":"2017-11-16T03:30:11.000Z","updated":"2017-11-16T03:37:48.787Z","comments":true,"path":"categories/index.html","permalink":"http://blog.biglx.cn/categories/index.html","excerpt":"","text":""},{"title":"标签云","date":"2017-11-16T03:29:55.000Z","updated":"2017-11-16T03:37:24.597Z","comments":true,"path":"tags/index.html","permalink":"http://blog.biglx.cn/tags/index.html","excerpt":"","text":""}],"posts":[{"title":"Nginx配置SSL实现HTTPS访问","slug":"Nginx配置SSL实现HTTPS访问","date":"2018-12-24T07:09:42.000Z","updated":"2018-12-25T02:25:57.106Z","comments":true,"path":"2018/12/24/Nginx配置SSL实现HTTPS访问/","link":"","permalink":"http://blog.biglx.cn/2018/12/24/Nginx配置SSL实现HTTPS访问/","excerpt":"","text":"Nginx配置SSL实现HTTPS访问 1. 申请证书因为最新搞小程序,接口必须要 HTTPS协议,所以来搞一下~ 腾讯云,阿里云,百度云等都可以申请SSL免费用一年。 大致如下,以腾讯云为例 控制台 -> SSL证书管理 -> 申请证书 -> 域名验证 -> 部署 申请证书啥的就不多说了,本文就直接从部署开始~~ 2. 开始部署2.1 下载申请好的证书,备用2.2 连接服务器,打开Nginx的目录(我的是/etc/nginx/)1cd /etc/nginx/ 2.3 在Nginx的目录里创建cert文件夹,用来存放证书和密匙1mkdir cert 2.4 把证书压缩包里Nginx的证书和密匙上传到创建好的文件夹里(windows推荐使用xftp工具,mac推荐使用FileZilla)2.5 打开nginx的配置文件(nginx.conf),在http服务里添加以下内容1234567891011121314151617181920212223server { listen 443; server_name www.XXXX.com; #填写绑定证书的域名 ssl on; ssl_certificate /etc/nginx/cert/1_www.XXXX.cn_bundle.crt;#域名证书的位置名称 ssl_certificate_key /etc/nginx/cert/2_www.XXXX.cn.key;#域名证书密匙的位置名称 ssl_session_timeout 5m; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; #按照这个协议配置 ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;#按照这个套件配置 ssl_prefer_server_ciphers on; location / { root /usr/share/nginx/html; #站点目录 index index.html index.htm; } //nginx对php-fpm的解析转发,如要是PHP环境的话需要到 /etx/nginx/conf.d/default.conf 里的转发设置复制过来 location ~ \\.php$ { root html; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /usr/share/nginx/html/$fastcgi_script_name; #解析站点目录 include fastcgi_params; }} 2.6 输入以下命令检测配置文件,重新加载配置文件123456789nginx -tnginx -s reload[root@VM_39_221_centos nginx]# nginx -tnginx: the configuration file /etc/nginx/nginx.conf syntax is oknginx: configuration file /etc/nginx/nginx.conf test is successful[root@VM_39_221_centos nginx]# nginx -s reload访问你的域名 https://www.XXXX.com 进行测试,如果能成功,就说明配置完成。 2.7 80端口重定向到443端口,强制开启https123456vi /etc/nginx/nginx.conf 输入以下内容和上边的代码是同级server { listen 80; server_name www.XXXX.cn; rewrite ^(.*) https://$host$1 permanent;} 3. 设置完成3.1 如果有不懂的地方可以加我的微信或者QQ联系我~","categories":[{"name":"服务器","slug":"服务器","permalink":"http://blog.biglx.cn/categories/服务器/"}],"tags":[{"name":"Nginx","slug":"Nginx","permalink":"http://blog.biglx.cn/tags/Nginx/"},{"name":"SSL","slug":"SSL","permalink":"http://blog.biglx.cn/tags/SSL/"},{"name":"HTTPS","slug":"HTTPS","permalink":"http://blog.biglx.cn/tags/HTTPS/"}]},{"title":"ThinkPHP5自定义跳转页面","slug":"ThinkPHP5自定义跳转页面","date":"2017-12-26T00:53:49.000Z","updated":"2018-12-24T05:53:08.067Z","comments":true,"path":"2017/12/26/ThinkPHP5自定义跳转页面/","link":"","permalink":"http://blog.biglx.cn/2017/12/26/ThinkPHP5自定义跳转页面/","excerpt":"ThinkPHP样式简约的页面跳转","text":"ThinkPHP样式简约的页面跳转 摘自TP官网,做了一点小的优化,方便以后的TP核心框架升级 先看效果图自带样式 修改后的样式 第一步 增加对移动设备的支持,在common.php 加入以下函数: 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657/** * 对移动端的支持 * @return bool */function isMobile(){ if (isset ($_SERVER['HTTP_X_WAP_PROFILE'])) { return true; } if (isset ($_SERVER['HTTP_VIA'])) { return stristr($_SERVER['HTTP_VIA'], "wap") ? true : false; } if (isset ($_SERVER['HTTP_USER_AGENT'])) { $clientkeywords = array('nokia', 'sony', 'ericsson', 'mot', 'samsung', 'htc', 'sgh', 'lg', 'sharp', 'sie-', 'philips', 'panasonic', 'alcatel', 'lenovo', 'iphone', 'ipod', 'blackberry', 'meizu', 'android', 'netfront', 'symbian', 'ucweb', 'windowsce', 'palm', 'operamini', 'operamobi', 'openwave', 'nexusone', 'cldc', 'midp', 'wap', 'mobile' ); if (preg_match("/(" . implode('|', $clientkeywords) . ")/i", strtolower($_SERVER['HTTP_USER_AGENT']))) { return true; } } if (isset ($_SERVER['HTTP_ACCEPT'])) { if ((strpos($_SERVER['HTTP_ACCEPT'], 'vnd.wap.wml') !== false) && (strpos($_SERVER['HTTP_ACCEPT'], 'text/html') === false || (strpos($_SERVER['HTTP_ACCEPT'], 'vnd.wap.wml') < strpos($_SERVER['HTTP_ACCEPT'], 'text/html')))) { return true; } } return false;} 第二步 打开config.php,找到以下代码,并修改配置,如果仅对后台起作用,请在后台模块的配置文件直接修改。 123456//原配置'dispatch_success_tmpl' => THINK_PATH . 'tpl' . DS . 'dispatch_jump.tpl', 'dispatch_error_tmpl' => THINK_PATH . 'tpl' . DS . 'dispatch_jump.tpl',//新配置 修改配置,提示模板的路径,可自己配置想要的目录。'dispatch_success_tmpl' => APP_PATH . 'admin'. DS . 'view' . DS .'include' . DS .'message.tpl' ,'dispatch_error_tmpl' => APP_PATH . 'admin'. DS . 'view' . DS .'include' . DS .'message.tpl', 在指定目录里的message.tpl中输入以下代码: 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172{__NOLAYOUT__}<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head> <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=0.5, maximum-scale=2.0, user-scalable=yes"/> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title>跳转提示</title> <?php if(isMobile()==true){?> <style type="text/css"> body, h1, h2, p,dl,dd,dt{margin: 0;padding: 0;font: 15px/1.5 微软雅黑,tahoma,arial;} body{background:#efefef;} h1, h2, h3, h4, h5, h6 {font-size: 100%;cursor:default;} ul, ol {list-style: none outside none;} a {text-decoration: none;color:#447BC4} a:hover {text-decoration: underline;} .ip-attack{width:100%; margin:200px auto 0;} .ip-attack dl{ background:#fff; padding:30px; border-radius:10px;border: 1px solid #CDCDCD;-webkit-box-shadow: 0 0 8px #CDCDCD;-moz-box-shadow: 0 0 8px #cdcdcd;box-shadow: 0 0 8px #CDCDCD;} .ip-attack dt{text-align:center;} .ip-attack dd{font-size:16px; color:#333; text-align:center;} .tips{text-align:center; font-size:14px; line-height:50px; color:#999;} </style> <?php }else{ ?> <style type="text/css"> body, h1, h2, p, dl, dd, dt{margin: 0;padding: 0;font: 15px/1.5 微软雅黑,tahoma,arial;} body{background:#efefef;} h1, h2, h3, h4, h5, h6 {font-size: 100%;cursor:default;} ul, ol {list-style: none outside none;} a {text-decoration: none;color:#447BC4} a:hover {text-decoration: underline;} .ip-attack{width:600px; margin:200px auto 0;} .ip-attack dl { background: #fff; padding: 30px; border-radius: 10px; border: 1px solid #CDCDCD; -webkit-box-shadow: 0 0 8px #CDCDCD; -moz-box-shadow: 0 0 8px #cdcdcd; box-shadow: 0 0 8px #CDCDCD; } .ip-attack dt{text-align:center;} .ip-attack dd{font-size:16px; color:#333; text-align:center;} .tips {text-align:center; font-size:14px; line-height:50px; color:#999;} </style> <?php }?></head><body><div class="ip-attack"> <dl> <?php switch ($code) {?> <?php case 1:?> <dt style="color: green"><?php echo(strip_tags($msg));?></dt> <?php break;?> <?php case 0:?> <dt style="color: red"><?php echo(strip_tags($msg));?></dt> <?php break;?> <?php } ?> <br> <dt> 页面自动 <a id="href" href="<?php echo($url);?>">跳转</a> 等待时间: <b id="wait"><?php echo($wait);?></b> </dt> </dl></div><script type="text/javascript"> (function () { var wait = document.getElementById('wait'), href = document.getElementById('href').href; var interval = setInterval(function () { var time = --wait.innerHTML; if (time <= 0) { location.href = href; clearInterval(interval); } ; }, 1000); })();</script></body></html> 结束 到此自定义跳转模板修改完成,除此以外大家有自己喜欢的模板也可以换上,操作是一样的~","categories":[{"name":"PHP","slug":"PHP","permalink":"http://blog.biglx.cn/categories/PHP/"}],"tags":[{"name":"ThinkPHP","slug":"ThinkPHP","permalink":"http://blog.biglx.cn/tags/ThinkPHP/"}]},{"title":"搭建lnmp(php7.1+nginx+mysql5.7)","slug":"搭建lnmp-php7-1-nginx-mysql5-7","date":"2017-11-30T08:17:32.000Z","updated":"2018-12-24T05:53:14.811Z","comments":true,"path":"2017/11/30/搭建lnmp-php7-1-nginx-mysql5-7/","link":"","permalink":"http://blog.biglx.cn/2017/11/30/搭建lnmp-php7-1-nginx-mysql5-7/","excerpt":"基于 centOS7.2 搭建LNMP服务器","text":"基于 centOS7.2 搭建LNMP服务器 检查更新yum首先用ssh登陆服务器,查看一下linux的版本信息,并执行yum update更新系统,当然如果你的服务器是按流量收费的话,可以不更新. 安装nginx使用yum安装nginx的最新源 1yum localinstall http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm 检查nginx源是否安装成功 1yum repolist enabled | grep "nginx*" 安装nginx 1yum -y install nginx 启动nginx 1service nginx start 设置nginx服务器开机自启动 1systemctl enable nginx.service 检查开机自动是否设置成功 1systemctl list-dependencies | grep nginx 在浏览器中输入服务器的公网ip,检查nginx服务器运行是否正常,出现以下界面算是安装成功 安装Mysql接下来安装5.7.x的mysql, 因为mysql5.7之后可以支持json操作。 安装5.7.x的mysql源 1yum -y localinstall http://dev.mysql.com/get/mysql57-community-release-el7-7.noarch.rpm 检查mysql源是否安装成功 1yum repolist enabled | grep "mysql.*-community.*" 源设置成功之后, 继续安装mysql 并启动, 加入开机自启动服务,并在命令行验证 安装Mysql 1yum -y install mysql-community-server install mysql-community-devel 启动mysql 1service mysqld start 检查mysql启动是否正常 1service mysqld status 或者 ps -ef | grep mysql 设置mysqld服务开机自启动 1systemctl enable mysqld.service 检查mysqld开机自启动是否设置成功 1systemctl list-dependencies | grep mysqld 查阅mysql的官方文档(文档在上面工具/原料里面有写),查询对应的随机密码, 这里说明一下mysql5.7以后的争强了安全机制, 所以使用yum安装,启动会系统会自动生成一个随机的密码. 查看mysql的随机密码 1grep 'temporary password' /var/log/mysqld.log 使用查询得到的随机密码在终端登录 1234mysql -u root -p 更改密码(mysql文档规定,密码必须包括大小写字母数字加特殊符号>8位)ALTER USER 'root'@'localhost' IDENTIFIED BY '你要设置的密码';退出mysql客户端,用刚才修改的密码登录确保密码修改成功mysql -uroot -pxxxxx 安装php以及扩展安装php71的源 12rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpmrpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm 检查源是否安装成功 1yum repolist enabled | grep "webtatic*" 安装php71和对应的扩展 1234yum -y install php71w php71w-fpmyum -y install php71w-mbstring php71w-common php71w-gd php71w-mcryptyum -y install php71w-mysql php71w-xml php71w-cli php71w-develyum -y install php71w-pecl-memcached php71w-pecl-redis php71w-opcache 验证php是否安装成功 1php -v 验证对应的扩展是否安装成功 1php -m 设置php-fpm并检测php-fpm的运行状态 启动php-fpm 1service php-fpm start 检查启动是否成功 1service php-fpm status 设置开机自启动 1systemctl enable php-fpm.service 检查开机自启动是否设置成功 1systemctl list-dependencies | grep php-fpm 修改default.conf文件Nginx对php进行转发切换并打开配置文件,把注释解开并修改,以下代码作为参考。1vi /etc/nginx/conf.d/default.conf 1234567891011121314151617181920212223242526272829303132333435363738394041424344server { listen 80; server_name localhost; #charset koi8-r; #access_log /var/log/nginx/host.access.log main; location / { root /usr/share/nginx/html; index index.html index.htm; } #error_page 404 /404.html; # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/html; } # proxy the PHP scripts to Apache listening on 127.0.0.1:80 # #location ~ \\.php$ { # proxy_pass http://127.0.0.1; #} # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # location ~ \\.php$ { root html; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /usr/share/nginx/html/$fastcgi_script_name; include fastcgi_params; } # deny access to .htaccess files, if Apache's document root # concurs with nginx's one # #location ~ /\\.ht { # deny all; #}} Mysql不能远程访问解决办法从任何主机上使用root用户,密码:youpassword(你的root密码)连接到mysql服务器: 12# mysql -u root -p mysql>GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'youpassword' WITH GRANT OPTION; 操作完后切记执行以下命令刷新权限 1FLUSH PRIVILEGES 测试是否安装成功切换目录,此目录相当于apache服务器里的WWW目录 1cd /usr/share/nginx/html/ 创建文件并输入以下代码 12<?php phpinfo(); 在浏览器输入 http://IP/index.php 出现PHP信息的页面就算安装成功。 注到此Lnmp服务器安装成功,有问题可以联系博主~Thanks!","categories":[{"name":"服务器","slug":"服务器","permalink":"http://blog.biglx.cn/categories/服务器/"}],"tags":[{"name":"服务器","slug":"服务器","permalink":"http://blog.biglx.cn/tags/服务器/"},{"name":"Nginx","slug":"Nginx","permalink":"http://blog.biglx.cn/tags/Nginx/"},{"name":"Lnmp","slug":"Lnmp","permalink":"http://blog.biglx.cn/tags/Lnmp/"}]},{"title":"第一篇博客","slug":"第一篇博客","date":"2017-11-16T01:14:06.000Z","updated":"2017-11-27T08:12:20.516Z","comments":true,"path":"2017/11/16/第一篇博客/","link":"","permalink":"http://blog.biglx.cn/2017/11/16/第一篇博客/","excerpt":"HelloWorld","text":"HelloWorld 本博客成立于2017年11月16日,使用 hexo+GitHub Pages 完成搭建本博客会不定时更新本人技术和生活上的文章和心情,感谢大家访问我的个人博客。","categories":[{"name":"HelloWorld","slug":"HelloWorld","permalink":"http://blog.biglx.cn/categories/HelloWorld/"}],"tags":[{"name":"博客","slug":"博客","permalink":"http://blog.biglx.cn/tags/博客/"}]}]}