apache

Kafka 使用Java实现数据的生产和消费demo

我的梦境 提交于 2021-02-20 07:37:27
前言 在 上一篇 中讲述如何搭建kafka集群,本篇则讲述如何简单的使用 kafka 。不过在使用kafka的时候,还是应该简单的了解下kafka。 Kafka的介绍 Kafka是一种高吞吐量的分布式发布订阅消息系统,它可以处理消费者规模的网站中的所有动作流数据。 Kafka 有如下特性: 以时间复杂度为O(1)的方式提供消息持久化能力,即使对TB级以上数据也能保证常数时间复杂度的访问性能。 高吞吐率。即使在非常廉价的商用机器上也能做到单机支持每秒100K条以上消息的传输。 支持Kafka Server间的消息分区,及分布式消费,同时保证每个Partition内的消息顺序传输。 同时支持离线数据处理和实时数据处理。 Scale out:支持在线水平扩展。 kafka的术语 Broker:Kafka集群包含一个或多个服务器,这种服务器被称为broker。 Topic:每条发布到Kafka集群的消息都有一个类别,这个类别被称为Topic。(物理上不同Topic的消息分开存储,逻辑上一个Topic的消息虽然保存于一个或多个broker上但用户只需指定消息的Topic即可生产或消费数据而不必关心数据存于何处) Partition:Partition是物理上的概念,每个Topic包含一个或多个Partition。 Producer:负责发布消息到Kafka broker。 Consumer

run python scripts on apache (linux and windows)

狂风中的少年 提交于 2021-02-20 04:12:21
问题 I need help with how to run scripts test.cgi for example in apache ? I created test script: #!/usr/bin/env python # -*- coding: UTF-8 -*- # enable debugging import cgitb cgitb.enable() print "Content-Type: text/plain;charset=utf-8" print print "Hello World! When I run localhost/cgi-bin/test.cgi It gives me error. Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, webmaster

run python scripts on apache (linux and windows)

孤街浪徒 提交于 2021-02-20 04:10:41
问题 I need help with how to run scripts test.cgi for example in apache ? I created test script: #!/usr/bin/env python # -*- coding: UTF-8 -*- # enable debugging import cgitb cgitb.enable() print "Content-Type: text/plain;charset=utf-8" print print "Hello World! When I run localhost/cgi-bin/test.cgi It gives me error. Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, webmaster

run python scripts on apache (linux and windows)

人走茶凉 提交于 2021-02-20 04:09:19
问题 I need help with how to run scripts test.cgi for example in apache ? I created test script: #!/usr/bin/env python # -*- coding: UTF-8 -*- # enable debugging import cgitb cgitb.enable() print "Content-Type: text/plain;charset=utf-8" print print "Hello World! When I run localhost/cgi-bin/test.cgi It gives me error. Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, webmaster

Codeigniter 4: Cannot access the page with apache mode_rewrite

家住魔仙堡 提交于 2021-02-20 03:40:53
问题 I installed Codeigniter 4.0.0.rc3 on my local computer using Wampserver and created a 'people' controller. I can access the page using this address: http://127.0.0.1/election/index.php/people But not without 'index.php': http://127.0.0.1/election/people And this is the error: The requested URL /Projects/Web/election/public/index.php/people was not found on this server. .htaccess is in the public directory and is working because the error shows index.php in the path. This is my htaccess: #

PHP Upload - Spaces in File Name

给你一囗甜甜゛ 提交于 2021-02-19 23:49:06
问题 When I use my upload script to upload a PHP file, I can't upload a file with spaces in it (I get a 500 error). Is there a way so my code automatically puts an underscore in the file name instead of the space? All help is greatly appreciated. :) 回答1: Simply use str_replace to replace all white spaces with another string: $fileName = str_replace(" ", "_", $fileName); Doc: php.net 回答2: Use this regular expression.suppose your filename look like my pic.jpg (one spaces) or my pic.jpg (three spaces

Redmine-4.1.1 使用Thin作为Web服务器(Ubuntu 20.04.2)

↘锁芯ラ 提交于 2021-02-19 17:00:52
准备工作 按 Redmine 官方文档 Installation Guide 安装好了Redmine 4.1.1. 具体的环境见最后“ 环境信息 ” 使用webrick可以运行redmine: bundle exec rails server webrick -e production 安装thin $ sudo apt install thin $ thin -v thin 1.7.2 codename Bachmanity 配置 Redmine4.1.1 的gemfile # samxiao @ rm411 in ~/redmine-4.1.1 [12:16:42] $ vi Gemfile.local # samxiao @ rm411 in ~/redmine-4.1.1 [12:17:12] $ cat Gemfile.local gem 'thin' 运行thin作为web服务的Redmine # samxiao @ rm411 in ~/redmine-4.1.1 [12:19:41] C:127 $ bundle exec rails server thin -e production => Booting Thin => Rails 5.2.4.2 application starting in production on http://0.0.0.0:3000

Apache2 + Mod_Evasive, only for one virtual host?

为君一笑 提交于 2021-02-19 16:15:58
问题 I am trying to utilize the mod_evasive for apache2 for one virtualhost only but it appears no matter what i do the module is loaded on the entirety of apache. I looked through the docs and i cannot find any switch to disable mod evasive in it's own configuration allowing me to enable it only for specific vhosts. I understand that i could simply do put the default config to ridiculous numbers making it never trigger/ban on the default and then do specific configurations for certain areas i

Apache2 + Mod_Evasive, only for one virtual host?

和自甴很熟 提交于 2021-02-19 16:14:13
问题 I am trying to utilize the mod_evasive for apache2 for one virtualhost only but it appears no matter what i do the module is loaded on the entirety of apache. I looked through the docs and i cannot find any switch to disable mod evasive in it's own configuration allowing me to enable it only for specific vhosts. I understand that i could simply do put the default config to ridiculous numbers making it never trigger/ban on the default and then do specific configurations for certain areas i

php跨域问题记录

岁酱吖の 提交于 2021-02-19 10:49:02
记录跨域问题 一、问题 在控制层加了如下代码: header('Access-Control-Allow-Origin: '.$_SERVER['HTTP_ORIGIN'] ); header('Access-Control-Allow-Credentials: true'); header('Access-Control-Allow-Headers: X-Requested-With,Content-Type,Accept'); 打开chrome的network里的response,没有这几个值~ 但是同样的代码我在本地另一个项目里是OK的,项目环境是Nginx做了层代理,实际用的是PHP当Apache模块的方式,就开始怀疑: 输出时框架限制了 Nginx/Apache限制了header(ps:我们项目是用Nginx当了反向代理,PHP当Apache模块) 灵魂拷问:PHP输出时这些header是怎么返回的? 二、解决 1.框架 用xdebug跟了下,没看到框架里有任何限制不能更改header 2.web服务器 看到response每次返回的都一样,以为是运维控制了返回的选项,不能随意添加,和运维同事沟通了下,发现确实是不能随意添加header头,窃喜以为找到了原因。然而另一个同事说加的跨域允许是OK的;Nginx的conf里加的proxy