nginx

用树莓派构建一台服务器,永久运行网站

亡梦爱人 提交于 2021-01-04 12:22:04
Python实战社群 Java实战社群 长按识别下方二维码, 按需求添加 扫码关注添加客服 进Python社群▲ 扫码关注添加客服 进Java社群 ▲ 作者丨彭小呆 来源丨SegmentFault 社区 https://segmentfault.com/a/1190000021143144 No.1 前言 由于本人在这段时候,看到了一个叫做树莓派的东东,初步了解之后觉得很有意思,于是想把整个过程记录下来。 No.2 树莓派是什么? Raspberry Pi(中文名为树莓派,简写为 RPi,(或者 RasPi / RPI) 是为学习计算机编程教育而设计),只有信用卡大小的微型电脑,其系统基于 Linux。随着 Windows 10 IoT 的发布,我们也将可以用上运行 Windows 的树莓派。 自问世以来,受众多计算机发烧友和创客的追捧,曾经一“派”难求。别看其外表“娇小”,内“心”却很强大,视频、音频等功能通通皆有,可谓是麻雀虽小,五脏俱全。 1. 用我的话理解 用我的话理解就是树莓派就是一台主机,你可以外接显示器,键盘鼠标,u盘等等外设,因为它体积很小,而且又有很多串口和外接的口,可以直接调用很多底层硬件。 2. 市面上的型号 市面上大多是 3 代 B+ 型,淘宝一搜树莓派一大堆都是,价钱纯主板(不要任何外设)在 230+ 左右,有点小贵,超过我的预算,所以我继续寻找廉价的

Webgl Cross Origin Images don't work

依然范特西╮ 提交于 2021-01-04 09:06:23
问题 I've got some problem with cross-origin image and I hope you can help. Here the beahviour. I've got 2 domains, in example: - domain1.com - domain2.com On domain1 I put many html5 games. This domain is only a repository of games. Domain2 is the real website (wordpress website) where users can play games hosted on domain1. To doing this I made a curl request for every game. In domain1 nginx configuration file I put these lines of code for enabling Cross Origin Resource Sharing: location ~* \.

Why is the opcache not flushed?

感情迁移 提交于 2021-01-04 07:33:42
问题 I use the guzzlehttp/guzzle package in Laravel 8 . After upgrading to PHP 8 , I get: Symfony\Component\ErrorHandler\Error\FatalError: Invalid opcode 117/2/0. in file ../vendor/defuse/php-encryption/src/Core.php on line 412 nginx config: server { listen 80; root /var/www/finex_production/public/; index index.php; server_name ff.loc; location / { try_files $uri $uri/ /index.php?$query_string; } location ~ \.php$ { include snippets/fastcgi-php.conf; fastcgi_pass unix:/var/run/php/php8.0-fpm.sock

Why is the opcache not flushed?

对着背影说爱祢 提交于 2021-01-04 07:33:19
问题 I use the guzzlehttp/guzzle package in Laravel 8 . After upgrading to PHP 8 , I get: Symfony\Component\ErrorHandler\Error\FatalError: Invalid opcode 117/2/0. in file ../vendor/defuse/php-encryption/src/Core.php on line 412 nginx config: server { listen 80; root /var/www/finex_production/public/; index index.php; server_name ff.loc; location / { try_files $uri $uri/ /index.php?$query_string; } location ~ \.php$ { include snippets/fastcgi-php.conf; fastcgi_pass unix:/var/run/php/php8.0-fpm.sock

Install resty.http with already installed openresty

若如初见. 提交于 2021-01-04 07:27:54
问题 I installed openresty-1.13.6.1 but it lacks 'resty.http' module. My openresty is installed in /usr/local/openresty and i need to integrate resty.http module with it. How to do it? 回答1: Just copy both files (https://github.com/pintsized/lua-resty-http/tree/master/lib/resty) into /usr/local/openresty/lualib folder. Update: Resulted file structure should be: /usr/local/openresty/lualib/resty/http.lua /usr/local/openresty/lualib/resty/http_headers.lua 来源: https://stackoverflow.com/questions

Install resty.http with already installed openresty

一笑奈何 提交于 2021-01-04 07:27:08
问题 I installed openresty-1.13.6.1 but it lacks 'resty.http' module. My openresty is installed in /usr/local/openresty and i need to integrate resty.http module with it. How to do it? 回答1: Just copy both files (https://github.com/pintsized/lua-resty-http/tree/master/lib/resty) into /usr/local/openresty/lualib folder. Update: Resulted file structure should be: /usr/local/openresty/lualib/resty/http.lua /usr/local/openresty/lualib/resty/http_headers.lua 来源: https://stackoverflow.com/questions

RTMP推流组件EasyRTMP在弱网环境下推流稳定吗?会不会有推流失败的问题?

浪尽此生 提交于 2021-01-03 16:32:09
EasyRTMP推流组件是一套调用简单、功能完善、运行高效稳定的RTMP专用推流组件,能够应用于各种行业的直播需求,手机直播、桌面直播、摄像机直播、课堂直播等方面。 TSINGSEE青犀视频有用户使用libeasyrtmp在弱网环境下推流,经常会有推流失败或者断开的问题。对于这种问题,开发人员通过网络抓包进行查看。 推流断开是由libeasyrtmp客户端主动断开的。而其他的推流工具,同样的网络环境下并没有断开。 从抓包看,由于网络环境差,存在很多超时重传,同样的对于libeasyrtmp中的超时,直接断开连接了。查看代码,libeasyrtmp对于socket超时设置的2s,所以对于超时超过2s就会断开连接。 我们可以重新设置超时时间,设置为10s. int timeout = 10000; if (setsockopt(r->m_sb.sb_socket, SOL_SOCKET, SO_SNDTIMEO, (char*)&timeout, sizeof(timeout)) == -1) { RTMP_Log(RTMP_LOGERROR, "%s, Setting socket timeout to %ds failed!", `ls_function` , timeout); } else { RTMP_Log(RTMP_LOGDEBUG, "%s, Setting

Docker入门二

情到浓时终转凉″ 提交于 2021-01-03 15:48:01
容器管理 1.docker create创建一个容器,但容器并没启动,就和我们创建虚拟机一样,创建了虚拟机后没启动 [root@centos-02 ~]# docker create -it centos6 bash WARNING: IPv4 forwarding is disabled. Networking will not work. 558e31f7b0fb941ca4ee8c1c2b42553b06ac79c0613984b7ad8b9b4ba97f61fd [root@centos-02 ~]# docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 558e31f7b0fb centos6 "bash" 9 seconds ago Created hopeful_murdock 94b9eab05296 centos6 "bash" About an hour ago Up About an hour elegant_minsky 815adfd9da61 centos "/bin/bash" 3 days ago Up 3 days distracted_mahavira [root@centos-02 ~]# 2.启动容器 [root@centos-02 ~]# docker

“12306”是如何支撑百万QPS的?

陌路散爱 提交于 2021-01-03 15:42:42
点击 上方“ 程序猿技术大咖 ”,选择“ 关注公众号 ”, 一起共进步! 每到节假日期间,一二线城市返乡、外出游玩的人们几乎都面临着一个问题:抢火车票! 来源:http://rrd.me/eE8ty 12306 抢票,极限并发带来的思考 虽然现在大多数情况下都能订到票,但是放票瞬间即无票的场景,相信大家都深有体会。 尤其是春节期间,大家不仅使用 12306,还会考虑“智行”和其他的抢票软件,全国上下几亿人在这段时间都在抢票。 “12306 服务”承受着这个世界上任何秒杀系统都无法超越的 QPS,上百万的并发再正常不过了! 笔者专门研究了一下“12306”的服务端架构,学习到了其系统设计上很多亮点,在这里和大家分享一下并模拟一个例子:如何在 100 万人同时抢 1 万张火车票时,系统提供正常、稳定的服务。 Github代码地址: https: //github.com/GuoZhaoran/spikeSystem 大型高并发系统架构 高并发的系统架构都会采用分布式集群部署,服务上层有着层层负载均衡,并提供各种容灾手段(双火机房、节点容错、服务器灾备等 ) 保证系统的高可用,流量也会根据不同的负载能力和配置策略均衡到不同的服务器上。 下边是一个简单的示意图: 负载均衡简介 上图中描述了用户请求到服务器经历了三层的负载均衡,下边分别简单介绍一下这三种负载均衡。 ①OSPF

delete后加 limit是个好习惯么 !

十年热恋 提交于 2021-01-03 11:37:34
作者: _陈哈哈 blog.csdn.net/qq_39390545/article/details/107519747 在业务场景要求高的数据库中,对于单条删除和更新操作,在 delete 和 update 后面加 limit 1 绝对是个好习惯。比如,在删除执行中,第一条就命中了删除行,如果 SQL 中有 limit 1;这时就 return 了,否则还会执行完全表扫描才 return。效率不言而喻。 那么,在日常执行 delete 时,我们是否需要养成加 limit 的习惯呢?是不是一个好习惯呢? 在日常的 SQL 编写中,你写 delete 语句时是否用到过以下 SQL? delete from t where sex = 1 limit 100; 你或许没有用过,在一般场景下,我们对 delete 后是否需要加 limit 的问题很陌生,也不知有多大区别,今天带你来了解一下,记得 mark! “ 写在前面,如果是清空表数据建议直接用 truncate,效率上 truncate 远高于 delete,应为 truncate 不走事务,不会锁表,也不会生产大量日志写入日志文件;truncate table table_name 后立刻释放磁盘空间,并重置 auto_increment 的值。delete 删除不释放磁盘空间,但后续 insert 会覆盖在之前删除的数据上