首页 文章 精选 留言 我的

精选列表

搜索[去水印],共10000篇文章
优秀的个人博客,低调大师

如何最接近rpm的安装方式去编译安装最新的php-fpm

1 前言 笔者非常不喜欢某些人编译安装的软件,维护起来非常缺乏rpm安装的那种规范感觉,于是笔者参阅官方的编译安装教程以及对比分析rpm安装的目录布置结构,完成以下安装。 2 安装PHP-FPM 2.1 环境配置 2.1.1 安装解压工具 yuminstall-ybzip2 2.1.2 配置编译环境 yum-yinstallgccgcc-c++makeexpat-devel 2.1.3 下载php二进制安装包 cd~ wgethttp://cn2.php.net/distributions/php-7.1.12.tar.bz2 注:具体的下载页面请参阅 http://sg2.php.net/downloads.php 2.1.4 创建运行用户 groupadd-g48apache useradd-u48-g48-d/usr/share/httpd-s/sbin/nologinapache 2.1.5 预建目录 mkdir/var/log/php-fpm/ mkdir/run/php-fpm/ 2.1.6 配置防火墙 firewall-cmd --permanent --add-port 9000/tcp firewall-cmd --reload firewall-cmd --list-all 2.2 编译安装 2.2.1 解压安装包 tar-xfphp-7.1.12.tar.bz2 2.2.2 安装前构建 cdphp-7.1.12 ./configure--bindir=/usr/sbin/\ --sbindir=/usr/sbin/\ --sysconfdir=/etc/\ --libdir=/usr/lib64/\ --mandir=/usr/share/man/\ --includedir=/usr/include/\ --with-fpm-user=apache\ --with-fpm-group=apache\ --enable-fpm\ --with-mysqli 根据提示解决安装的依赖关系 yuminstall-ylibxml2-devel 2.2.3 编译并安装 make makeinstall|teeinstall.log 2.3 配置FPM 2.3.1 配置php.ini cpphp.ini-development/etc/php.ini 2.3.2 防止空文件递给PHP-FPM后端 vim/etc/php.ini 修改以下参数: cgi.fix_pathinfo=0 注:可防任意脚本注入 2.3.3 创建配置 vim/etc/php-fpm.conf 加入如下配置: ;;;;;;;;;;;;;;;;;;;;; ;FPMConfiguration; ;;;;;;;;;;;;;;;;;;;;; ;AllrelativepathsinthisconfigurationfilearerelativetoPHP'sinstall ;prefix. ;Includeoneormorefiles.Ifglob(3)exists,itisusedtoincludeabunchof ;filesfromaglob(3)pattern.Thisdirectivecanbeusedeverywhereinthe ;file. include=/etc/php-fpm.d/*.conf ;;;;;;;;;;;;;;;;;; ;GlobalOptions; ;;;;;;;;;;;;;;;;;; [global] ;Pidfile ;DefaultValue:none pid=/run/php-fpm/php-fpm.pid ;Errorlogfile ;DefaultValue:/var/log/php-fpm.log error_log=/var/log/php-fpm/error.log ;Loglevel ;PossibleValues:alert,error,warning,notice,debug ;DefaultValue:notice ;log_level=notice ;IfthisnumberofchildprocessesexitwithSIGSEGVorSIGBUSwithinthetime ;intervalsetbyemergency_restart_intervalthenFPMwillrestart.Avalue ;of'0'means'Off'. ;DefaultValue:0 ;emergency_restart_threshold=0 ;Intervaloftimeusedbyemergency_restart_intervaltodeterminewhen ;agracefulrestartwillbeinitiated.Thiscanbeusefultoworkaround ;accidentalcorruptionsinanaccelerator'ssharedmemory. ;AvailableUnits:s(econds),m(inutes),h(ours),ord(ays) ;DefaultUnit:seconds ;DefaultValue:0 ;emergency_restart_interval=0 ;Timelimitforchildprocessestowaitforareactiononsignalsfrommaster. ;Availableunits:s(econds),m(inutes),h(ours),ord(ays) ;DefaultUnit:seconds ;DefaultValue:0 ;process_control_timeout=0 ;SendFPMtobackground.Setto'no'tokeepFPMinforegroundfordebugging. ;DefaultValue:yes daemonize=no ;;;;;;;;;;;;;;;;;;;; ;PoolDefinitions; ;;;;;;;;;;;;;;;;;;;; ;See/etc/php-fpm.d/*.conf 创建以下配置文件: mkdir/etc/php-fpm.d/ vim/etc/php-fpm.d/www.conf 加入如下配置: ;Startanewpoolnamed'www'. [www] ;TheaddressonwhichtoacceptFastCGIrequests. ;Validsyntaxesare: ;'ip.add.re.ss:port'-tolistenonaTCPsockettoaspecificaddresson ;aspecificport; ;'port'-tolistenonaTCPsockettoalladdressesona ;specificport; ;'/path/to/unix/socket'-tolistenonaunixsocket. ;Note:Thisvalueismandatory. listen=127.0.0.1:9000 ;Setlisten(2)backlog.Avalueof'-1'meansunlimited. ;DefaultValue:-1 ;listen.backlog=-1 ;Listofipv4addressesofFastCGIclientswhichareallowedtoconnect. ;EquivalenttotheFCGI_WEB_SERVER_ADDRSenvironmentvariableintheoriginal ;PHPFCGI(5.2.2+).Makessenseonlywithatcplisteningsocket.Eachaddress ;mustbeseparatedbyacomma.Ifthisvalueisleftblank,connectionswillbe ;acceptedfromanyipaddress. ;DefaultValue:any listen.allowed_clients=127.0.0.1 ;Setpermissionsforunixsocket,ifoneisused.InLinux,read/write ;permissionsmustbesetinordertoallowconnectionsfromawebserver.Many ;BSD-derivedsystemsallowconnectionsregardlessofpermissions. ;DefaultValues:userandgrouparesetastherunninguser ;modeissetto0666 ;listen.owner=nobody ;listen.group=nobody ;listen.mode=0666 ;Unixuser/groupofprocesses ;Note:Theuserismandatory.Ifthegroupisnotset,thedefaultuser'sgroup ;willbeused. ;RPM:apacheChoosedtobeabletoaccesssomedirashttpd user=apache ;RPM:Keepagroupallowedtowriteinlogdir. group=apache ;Choosehowtheprocessmanagerwillcontrolthenumberofchildprocesses. ;PossibleValues: ;static-afixednumber(pm.max_children)ofchildprocesses; ;dynamic-thenumberofchildprocessesaresetdynamicallybasedonthe ;followingdirectives: ;pm.max_children-themaximumnumberofchildrenthatcan ;bealiveatthesametime. ;pm.start_servers-thenumberofchildrencreatedonstartup. ;pm.min_spare_servers-theminimumnumberofchildrenin'idle' ;state(waitingtoprocess).Ifthenumber ;of'idle'processesislessthanthis ;numberthensomechildrenwillbecreated. ;pm.max_spare_servers-themaximumnumberofchildrenin'idle' ;state(waitingtoprocess).Ifthenumber ;of'idle'processesisgreaterthanthis ;numberthensomechildrenwillbekilled. ;Note:Thisvalueismandatory. pm=dynamic ;Thenumberofchildprocessestobecreatedwhenpmissetto'static'andthe ;maximumnumberofchildprocessestobecreatedwhenpmissetto'dynamic'. ;Thisvaluesetsthelimitonthenumberofsimultaneousrequeststhatwillbe ;served.EquivalenttotheApacheMaxClientsdirectivewithmpm_prefork. ;EquivalenttothePHP_FCGI_CHILDRENenvironmentvariableintheoriginalPHP ;CGI. ;Note:Usedwhenpmissettoeither'static'or'dynamic' ;Note:Thisvalueismandatory. pm.max_children=50 ;Thenumberofchildprocessescreatedonstartup. ;Note:Usedonlywhenpmissetto'dynamic' ;DefaultValue:min_spare_servers+(max_spare_servers-min_spare_servers)/2 pm.start_servers=5 ;Thedesiredminimumnumberofidleserverprocesses. ;Note:Usedonlywhenpmissetto'dynamic' ;Note:Mandatorywhenpmissetto'dynamic' pm.min_spare_servers=5 ;Thedesiredmaximumnumberofidleserverprocesses. ;Note:Usedonlywhenpmissetto'dynamic' ;Note:Mandatorywhenpmissetto'dynamic' pm.max_spare_servers=35 ;Thenumberofrequestseachchildprocessshouldexecutebeforerespawning. ;Thiscanbeusefultoworkaroundmemoryleaksin3rdpartylibraries.For ;endlessrequestprocessingspecify'0'.EquivalenttoPHP_FCGI_MAX_REQUESTS. ;DefaultValue:0 ;pm.max_requests=500 ;TheURItoviewtheFPMstatuspage.Ifthisvalueisnotset,noURIwillbe ;recognizedasastatuspage.Bydefault,thestatuspageshowsthefollowing ;information: ;acceptedconn-thenumberofrequestacceptedbythepool; ;pool-thenameofthepool; ;processmanager-staticordynamic; ;idleprocesses-thenumberofidleprocesses; ;activeprocesses-thenumberofactiveprocesses; ;totalprocesses-thenumberofidle+activeprocesses. ;Thevaluesof'idleprocesses','activeprocesses'and'totalprocesses'are ;updatedeachsecond.Thevalueof'acceptedconn'isupdatedinrealtime. ;Exampleoutput: ;acceptedconn:12073 ;pool:www ;processmanager:static ;idleprocesses:35 ;activeprocesses:65 ;totalprocesses:100 ;Bydefaultthestatuspageoutputisformattedastext/plain.Passingeither ;'html'or'json'asaquerystringwillreturnthecorrespondingoutput ;syntax.Example: ;http://www.foo.bar/status ;http://www.foo.bar/status?json ;http://www.foo.bar/status?html ;Note:Thevaluemuststartwithaleadingslash(/).Thevaluecanbe ;anything,butitmaynotbeagoodideatousethe.phpextensionorit ;mayconflictwitharealPHPfile. ;DefaultValue:notset ;pm.status_path=/status ;ThepingURItocallthemonitoringpageofFPM.Ifthisvalueisnotset,no ;URIwillberecognizedasapingpage.Thiscouldbeusedtotestfromoutside ;thatFPMisaliveandresponding,orto ;-createagraphofFPMavailability(rrdorsuch); ;-removeaserverfromagroupifitisnotresponding(loadbalancing); ;-triggeralertsfortheoperatingteam(24/7). ;Note:Thevaluemuststartwithaleadingslash(/).Thevaluecanbe ;anything,butitmaynotbeagoodideatousethe.phpextensionorit ;mayconflictwitharealPHPfile. ;DefaultValue:notset ;ping.path=/ping ;Thisdirectivemaybeusedtocustomizetheresponseofapingrequest.The ;responseisformattedastext/plainwitha200responsecode. ;DefaultValue:pong ;ping.response=pong ;Thetimeoutforservingasinglerequestafterwhichtheworkerprocesswill ;bekilled.Thisoptionshouldbeusedwhenthe'max_execution_time'inioption ;doesnotstopscriptexecutionforsomereason.Avalueof'0'means'off'. ;Availableunits:s(econds)(default),m(inutes),h(ours),ord(ays) ;DefaultValue:0 ;request_terminate_timeout=0 ;ThetimeoutforservingasinglerequestafterwhichaPHPbacktracewillbe ;dumpedtothe'slowlog'file.Avalueof'0s'means'off'. ;Availableunits:s(econds)(default),m(inutes),h(ours),ord(ays) ;DefaultValue:0 ;request_slowlog_timeout=0 ;Thelogfileforslowrequests ;DefaultValue:notset ;Note:slowlogismandatoryifrequest_slowlog_timeoutisset slowlog=/var/log/php-fpm/www-slow.log ;Setopenfiledescriptorrlimit. ;DefaultValue:systemdefinedvalue ;rlimit_files=1024 ;Setmaxcoresizerlimit. ;PossibleValues:'unlimited'oranintegergreaterorequalto0 ;DefaultValue:systemdefinedvalue ;rlimit_core=0 ;Chroottothisdirectoryatthestart.Thisvaluemustbedefinedasan ;absolutepath.Whenthisvalueisnotset,chrootisnotused. ;Note:chrootingisagreatsecurityfeatureandshouldbeusedwhenever ;possible.However,allPHPpathswillberelativetothechroot ;(error_log,sessions.save_path,...). ;DefaultValue:notset ;chroot= ;Chdirtothisdirectoryatthestart.Thisvaluemustbeanabsolutepath. ;DefaultValue:currentdirectoryor/whenchroot ;chdir=/var/www ;Redirectworkerstdoutandstderrintomainerrorlog.Ifnotset,stdoutand ;stderrwillberedirectedto/dev/nullaccordingtoFastCGIspecs. ;DefaultValue:no ;catch_workers_output=yes ;LimitstheextensionsofthemainscriptFPMwillallowtoparse.Thiscan ;preventconfigurationmistakesonthewebserverside.Youshouldonlylimit ;FPMto.phpextensionstopreventmalicioususerstouseotherextensionsto ;exectutephpcode. ;Note:setanemptyvaluetoallowallextensions. ;DefaultValue:.php ;security.limit_extensions=.php.php3.php4.php5 ;PassenvironmentvariableslikeLD_LIBRARY_PATH.All$VARIABLEsaretakenfrom ;thecurrentenvironment. ;DefaultValue:cleanenv ;env[HOSTNAME]=$HOSTNAME ;env[PATH]=/usr/local/bin:/usr/bin:/bin ;env[TMP]=/tmp ;env[TMPDIR]=/tmp ;env[TEMP]=/tmp ;Additionalphp.inidefines,specifictothispoolofworkers.Thesesettings ;overwritethevaluespreviouslydefinedinthephp.ini.Thedirectivesarethe ;sameasthePHPSAPI: ;php_value/php_flag-youcansetclassicinidefineswhichcan ;beoverwrittenfromPHPcall'ini_set'. ;php_admin_value/php_admin_flag-thesedirectiveswon'tbeoverwrittenby ;PHPcall'ini_set' ;Forphp_*flag,validvaluesareon,off,1,0,true,false,yesorno. ;Defining'extension'willloadthecorrespondingsharedextensionfrom ;extension_dir.Defining'disable_functions'or'disable_classes'willnot ;overwritepreviouslydefinedphp.inivalues,butwillappendthenewvalue ;instead. ;DefaultValue:nothingisdefinedbydefaultexceptthevaluesinphp.iniand ;specifiedatstartupwiththe-dargument ;php_admin_value[sendmail_path]=/usr/sbin/sendmail-t-i-fwww@my.domain.com ;php_flag[display_errors]=off php_admin_value[error_log]=/var/log/php-fpm/www-error.log php_admin_flag[log_errors]=on ;php_admin_value[memory_limit]=128M ;Setsessionpathtoadirectoryownedbyprocessuser php_value[session.save_handler]=files php_value[session.save_path]=/var/lib/php/session 2.3.4 测试fpm启动 /usr/sbin/php-fpm& 2.3.5 查询服务状态 ps-aux|grepphp-fpm netstat-antp|grepphp-fpm 2.3.6 手动关闭服务 kill-s15`pgrep-urootphp-fpm` 2.4 配置服务启动 2.4.1 配置启动脚本 vim/usr/lib/systemd/system/php-fpm.service 加入如下配置: [Unit] Description=ThePHPFastCGIProcessManager After=syslog.targetnetwork.target [Service] Type=simple PIDFile=/run/php-fpm/php-fpm.pid EnvironmentFile=/etc/sysconfig/php-fpm ExecStart=/usr/sbin/php-fpm--nodaemonize ExecReload=/bin/kill-USR2$MAINPID PrivateTmp=true [Install] WantedBy=multi-user.target 配置环境文件: echo'#Additionalenvironmentfileforphp-fpm'>/etc/sysconfig/php-fpm 重载控制脚本 systemctldaemon-reload 2.4.2 启动服务并配置默认启动 systemctlstartphp-fpm systemctlenablephp-fpm 2.4.3 服务其他控制命令 systemctlstartphp-fpm systemctlrestartphp-fpm systemctlstopphp-fpm 2.5 测试 由于nginx不是本章的重点,所以如需测试请根据以下文章配置nginx, https://blog.51cto.com/cmdschool/1962061 最后你可以看到如下页面, 参阅文档: ============================================== http://sg2.php.net/manual/en/install.unix.nginx.php

优秀的个人博客,低调大师

BlackHat & DEFCON现场秀:阿里安全专家演示“视频水印叠加”和“一分钟越狱iOS 11.4”

美国当地时间8月8日,两大世界顶级信息安全会议BlackHat和DEFCON将在美国拉斯维加斯正式揭幕。来自全球的数万名白帽黑客、安全厂商、高校学者、政府机构等安全从业人员齐聚,高度关注这两场盛会将来带来怎样的前沿技术饕餮盛宴,阿里安全八大实验室多名安全专家受邀参会,带来的三大议题和两项演示备受瞩目。 据悉,BlackHat和DEFCON由传奇人物Jeff Moss分别于1997年和1993年创办,不过从2014年开始才有中国白帽受邀演讲的身影。阿里安全自2015年至今已数次参加两大顶会,曾有议题被大会主席誉为“印象最深刻的演讲”。 2018年更是阿里安全大爆发之年,BlackHat的亚洲和欧洲会议已有多名安全专家议题入选,此次共有六名安全专家受邀参会,“议题演讲+现场演示”的数量占到中国互联网公司整体参会数量的五分之一,以自身能力向

优秀的个人博客,低调大师

Stack Overflow 拿我的代码去训练 AI 大模型,还封了我的账号​

省流总结: 全球编程问答平台 Stack Overflow 本周与 OpenAI 达成了交易,将用户免费生成的内容货币化。 反对这一交易的社区用户试图通过删除其发表的答案和问题进行抗议,但他们发现高赞的答案和问题无法删除,因为 Stack Overflow 认为这会删除集体知识。 于是有用户修改了答案内容,将其转变为抗议信息。结果是 Mod 在一小时内恢复了原答案,将用户的账号冻结了 7 天。 Stack Overflow 和 OpenAI 近日达成了新的合作伙伴关系,以支持各自的产品。 具体来说,OpenAI 将利用 Stack Overflow 的 OverflowAPI,并与 Stack Overflow 合作,为使用其产品的开发人员提高模型性能。OpenAI 表示 ChatGPT 会在从该平台获取答案时注明出处。 Stack Overflow 则将利用 OpenAI 模型进一步开发 OverflowAI,并与 OpenAI 合作,利用内部测试的见解来最大限度地提高 OpenAI 模型的性能。 由此可见,新协议允许 OpenAI 访问 Stack Overflow API 作为数据源,然而这让那些发布有关编程问题帖子的用户感到愤怒。 一位名为本(Ben)的程序员在社交媒体发布动态称,他试图删除自己的帖子以抗议Stack Overflow 和OpenAI 的交易,但遇到了平台的阻力。 Stack Overflow 撤回了他的操作——恢复了 Ben 主动删除的帖子,并对 Ben 的账号进行了临时封禁。 平台管理员回复称,Stack Overflow 上的帖子一旦发布就属于“集体创作”,只有在“非常特殊的情况下”才能被删除。Ben 的账号随后被封号一周,管理员表示这样做是为了“避免进一步的误解”。 Ben 最终更新了自己的帖子内容表达无奈:"此举窃取了所有为 Stack Overflow 做出贡献的人的劳动成果。" Stack Overflow 没有立即回应对此事的评论请求。 Reference https://m.benui.ca/@ben/112396505994216742https://www.solidot.org/story?sid=78114

优秀的个人博客,低调大师

黑客组织DarkSide自称被迫解散业内人士担忧其只是去“换个马甲”

周五据媒体援引网络安全研究公司FireEye信源报道,造成过去一周美国东部输油管道陷入混乱的勒索软件开发团队DarkSide已经宣布解散。 据悉,由DarkSide运营的网站从本周四开始已经无法登陆。FireEye表示,DarkSide已经告知员工,受到执法机构和美国的压力,目前已经无法访问其用于运营的基础设施,该组织后续也将关闭。 根据周四媒体报道,在Colonial Pipeline上周五受到加密攻击后,公司当天就向黑客转账了500万美元的加密货币。不过由于黑客给的解密工具运行实在太慢,不得已采用备份继续重启系统。 针对周五的进展,网络完全专家也表示,对于像DarkSide这样的勒索团队而言解散是非常普遍的操作,只不过是未来再换个名字重出江湖罢了。而对于该组织声称的“受到美国压力”,美国司法部和FBI均未对外作出回应。 美国总统拜登在周四的新闻发布会上表示,白宫一直在与莫斯科沟通,要求该国对勒索网络软件采取果断行动,同时采取措施破坏这类软件的运行能力。据信,DarkSide的据点在俄罗斯或东欧国家。在管道网络攻击“一战成名”后,DarkSide也曾表示团队的目的只是为了钱,不参与地缘政治矛盾。 非常凑巧的是,就在“忙着解散”的同时,还不断有新的受害者浮出水面。根据日本媒体报道,周五凌晨DarkSide发表声明称入侵了东芝法国公司的系统,并窃取了740GB的数据。

优秀的个人博客,低调大师

AI=机器学习²,我们在去往²的路上 | 普林斯顿范剑青教授

在9月18日“2018世界人工智能大会”智能金融主题论坛上,中国互联网金融协会会长李东荣,加州大学伯克利分校迈克尔·欧文·乔丹(Michael I. Jordan)教授,复旦大学大数据学院院长、普林斯顿大学教授范剑青、汇付天下董事长兼CEO周晔带来了主题演讲。 其中,范剑青教授分享了《数据智能与金融创新》。他主要介绍了人工智能的兴起,以及数据智能如何增强市场效率,加速产业发展的,以及引领高科技的发展的。“人工智能的目的与价值,就是把大数据加工成智慧数据,为经济发展提供新能源,为科技创新提供新依据,为管理决策提供新信息。” “大数据与人工智能为健康医疗、科学发现、技术创新、商业管理、政府决策等带来由信息海啸驱动的又一次工业革命,同时方方面面影响着人类的工作、生活和通讯方式。各行各业创新所产生的大量数据又增加了对海量数据处理和分析的强烈需

优秀的个人博客,低调大师

西门子、Hackrod利用3D打印 让用户去构思概念车

据悉,西门子与Hackrod携手展开汽车研制,试图将复合式制造、人工智能(AI)与虚拟现实(VR)纳入汽车制造技术的领域,制造概念车“La Bandita ”,其理念是透过让客户主导构思,寻求颠覆传统汽车制造。 据报道,Hackrod透过西门子的开放式物联网(IoT)云端平台MindSphere,做为汽车制造程序的基础;进一步整合西门子的软体NX、云端软体Solid Edge Portal、控制软体Sinumerik CNC与LMS Testing Solutions。来源:https://3dprint.ofweek.com/ La Bandita主要由3D打印与CNC加工设备进行制造,使用球磨机、各式切割机等。 La Bandita将是全球首个以3D打印、CNC、VR等方式制造的跑车。

资源下载

更多资源
Mario

Mario

马里奥是站在游戏界顶峰的超人气多面角色。马里奥靠吃蘑菇成长,特征是大鼻子、头戴帽子、身穿背带裤,还留着胡子。与他的双胞胎兄弟路易基一起,长年担任任天堂的招牌角色。

腾讯云软件源

腾讯云软件源

为解决软件依赖安装时官方源访问速度慢的问题,腾讯云为一些软件搭建了缓存服务。您可以通过使用腾讯云软件源站来提升依赖包的安装速度。为了方便用户自由搭建服务架构,目前腾讯云软件源站支持公网访问和内网访问。

Spring

Spring

Spring框架(Spring Framework)是由Rod Johnson于2002年提出的开源Java企业级应用框架,旨在通过使用JavaBean替代传统EJB实现方式降低企业级编程开发的复杂性。该框架基于简单性、可测试性和松耦合性设计理念,提供核心容器、应用上下文、数据访问集成等模块,支持整合Hibernate、Struts等第三方框架,其适用范围不仅限于服务器端开发,绝大多数Java应用均可从中受益。

Sublime Text

Sublime Text

Sublime Text具有漂亮的用户界面和强大的功能,例如代码缩略图,Python的插件,代码段等。还可自定义键绑定,菜单和工具栏。Sublime Text 的主要功能包括:拼写检查,书签,完整的 Python API , Goto 功能,即时项目切换,多选择,多窗口等等。Sublime Text 是一个跨平台的编辑器,同时支持Windows、Linux、Mac OS X等操作系统。

用户登录
用户注册