diff --git a/sources/tech/20171127 Protecting Your Website From Application Layer DOS Attacks With mod.md b/sources/tech/20171127 Protecting Your Website From Application Layer DOS Attacks With mod.md deleted file mode 100644 index c640d776c1..0000000000 --- a/sources/tech/20171127 Protecting Your Website From Application Layer DOS Attacks With mod.md +++ /dev/null @@ -1,223 +0,0 @@ -Translating by jessie-pang - -Protecting Your Website From Application Layer DOS Attacks With mod -====== -There exist many ways of maliciously taking a website offline. The more complicated methods involve technical knowledge of databases and programming. A far simpler method is known as a "Denial Of Service", or "DOS" attack. This attack derives its name from its goal which is to deny your regular clients or site visitors normal website service. - -There are, generally speaking, two forms of DOS attack; - - 1. Layer 3,4 or Network-Layer attacks. - 2. Layer 7 or Application-Layer attacks. - - - -The first type of DOS attack, network-layer, is when a huge quantity of junk traffic is directed at the web server. When the quantity of junk traffic exceeds the capacity of the network infrastructure the website is taken offline. - -The second type of DOS attack, application-layer, is where instead of junk traffic legitimate looking page requests are made. When the number of page requests exceeds the capacity of the web server to serve pages legitimate visitors will not be able to use the site. - -This guide will look at mitigating application-layer attacks. This is because mitigating networking-layer attacks requires huge quantities of available bandwidth and the co-operation of upstream providers. This is usually not something that can be protected against through configuration of the web server. - -An application-layer attack, at least a modest one, can be protected against through the configuration of a normal web server. Protecting against this form of attack is important because [Cloudflare][1] have [recently reported][2] that the number of network-layer attacks is diminishing while the number of application-layer attacks is increasing. - -This guide will explain using the Apache2 module [mod_evasive][3] by [zdziarski][4]. - -In addition, mod_evasive will stop an attacker trying to guess a username/password combination by attempting hundreds of combinations i.e. a brute force attack. - -Mod_evasive works by keeping a record of the number of requests arriving from each IP address. When this number exceeds one of the several thresholds that IP is served an error page. Error pages require far fewer resources than a site page keeping the site online for legitimate visitors. - -### Installing mod_evasive on Ubuntu 16.04 - -Mod_evasive is contained in the default Ubuntu 16.04 repositories with the package name "libapache2-mod-evasive". A simple `apt-get` will get it installed: -``` -apt-get update -apt-get upgrade -apt-get install libapache2-mod-evasive - -``` - -We now need to configure mod_evasive. - -It's configuration file is located at `/etc/apache2/mods-available/evasive.conf`. By default, all the modules settings are commented after installation. Therefore, the module won't interfere with site traffic until the configuration file has been edited. -``` - - #DOSHashTableSize 3097 - #DOSPageCount 2 - #DOSSiteCount 50 - #DOSPageInterval 1 - #DOSSiteInterval 1 - #DOSBlockingPeriod 10 - - #DOSEmailNotify you@yourdomain.com - #DOSSystemCommand "su - someuser -c '/sbin/... %s ...'" - #DOSLogDir "/var/log/mod_evasive" - - -``` - -The first block of directives mean as follows: - - * **DOSHashTableSize** - The current list of accessing IP's and their request count. - * **DOSPageCount** - The threshold number of page requests per DOSPageInterval. - * **DOSPageInterval** - The amount of time in which mod_evasive counts up the page requests. - * **DOSSiteCount** - The same as the DOSPageCount but counts requests from the same IP for any page on the site. - * **DOSSiteInterval** - The amount of time that mod_evasive counts up the site requests. - * **DOSBlockingPeriod** - The amount of time in seconds that an IP is blocked for. - - - -If the default configuration shown above is used then an IP will be blocked if it: - - * Requests a single page more than twice a second. - * Requests more than 50 pages different pages per second. - - - -If an IP exceeds these thresholds it is blocked for 10 seconds. - -This may not seem like a lot, however, mod_evasive will continue monitoring the page requests even for blocked IP's and reset their block period. As long as an IP is attempting to DOS the site it will remain blocked. - -The remaining directives are: - - * **DOSEmailNotify** - An email address to receive notification of DOS attacks and IP's being blocked. - * **DOSSystemCommand** - A command to run in the event of a DOS. - * **DOSLogDir** - The directory where mod_evasive keeps some temporary files. - - - -### Configuring mod_evasive - -The default configuration is a good place to start as it should not block any legitimate users. The configuration file with all directives (apart from DOSSystemCommand) uncommented looks like the following: -``` - - DOSHashTableSize 3097 - DOSPageCount 2 - DOSSiteCount 50 - DOSPageInterval 1 - DOSSiteInterval 1 - DOSBlockingPeriod 10 - - DOSEmailNotify JohnW@example.com - #DOSSystemCommand "su - someuser -c '/sbin/... %s ...'" - DOSLogDir "/var/log/mod_evasive" - - -``` - -The log directory must be created and given the same owner as the apache process. Here it is created at `/var/log/mod_evasive` and given the owner and group of the Apache web server on Ubuntu `www-data`: -``` -mkdir /var/log/mod_evasive -chown www-data:www-data /var/log/mod_evasive - -``` - -After editing Apache's configuration, especially on a live website, it is always a good idea to check the syntax of the edits before restarting or reloading. This is because a syntax error will stop Apache from re-starting and taking your site offline. - -Apache comes packaged with a helper command that has a configuration syntax checker. Simply run the following command to check your edits: -``` -apachectl configtest - -``` - -If your configuration is correct you will get the response: -``` -Syntax OK - -``` - -However, if there is a problem you will be told where it occurred and what it was, e.g.: -``` -AH00526: Syntax error on line 6 of /etc/apache2/mods-enabled/evasive.conf: -DOSSiteInterval takes one argument, Set site interval -Action 'configtest' failed. -The Apache error log may have more information. - -``` - -If your configuration passes the configtest then the module can be safely enabled and Apache reloaded: -``` -a2enmod evasive -systemctl reload apache2.service - -``` - -Mod_evasive is now configured and running. - -### Testing - -In order to test mod_evasive, we simply need to make enough web requests to the server that we exceed the threshold and record the response codes from Apache. - -A normal, successful page request will receive the response: -``` -HTTP/1.1 200 OK - -``` - -However, one that has been denied by mod_evasive will return the following: -``` -HTTP/1.1 403 Forbidden - -``` - -The following script will make HTTP requests to `127.0.0.1:80`, that is localhost on port 80, as rapidly as possible and print out the response code of every request. - -All you need to do is to copy the following bash script into a file e.g. `mod_evasive_test.sh`: -``` -#!/bin/bash -set -e - -for i in {1..50}; do - curl -s -I 127.0.0.1 | head -n 1 -done - -``` - -The parts of this script mean as follows: - - * curl - This is a command to make web requests. - * -s - Hide the progress meter. - * -I - Only display the response header information. - * head - Print the first part of a file. - * -n 1 - Only display the first line. - - - -Then make it executable: -``` -chmod 755 mod_evasive_test.sh - -``` - -When the script is run **before** mod_evasive is enabled you will see 50 lines of `HTTP/1.1 200 OK` returned. - -However, after mod_evasive is enabled you will see the following: -``` -HTTP/1.1 200 OK -HTTP/1.1 200 OK -HTTP/1.1 403 Forbidden -HTTP/1.1 403 Forbidden -HTTP/1.1 403 Forbidden -HTTP/1.1 403 Forbidden -HTTP/1.1 403 Forbidden -... - -``` - -The first two requests were allowed, but then once a third in the same second was made mod_evasive denied any further requests. You will also receive an email letting you know that a DOS attempt was detected to the address you set with the `DOSEmailNotify` option. - -Mod_evasive is now protecting your site! - --------------------------------------------------------------------------------- - -via: https://bash-prompt.net/guides/mod_proxy/ - -作者:[Elliot Cooper][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://bash-prompt.net/about/ -[1]:https://www.cloudflare.com -[2]:https://blog.cloudflare.com/the-new-ddos-landscape/ -[3]:https://github.com/jzdziarski/mod_evasive -[4]:https://www.zdziarski.com/blog/ diff --git a/sources/tech/20180110 Best Linux Screenshot and Screencasting Tools.md b/sources/tech/20180110 Best Linux Screenshot and Screencasting Tools.md deleted file mode 100644 index 90ab5189f9..0000000000 --- a/sources/tech/20180110 Best Linux Screenshot and Screencasting Tools.md +++ /dev/null @@ -1,149 +0,0 @@ -translated by cyleft. - -Best Linux Screenshot and Screencasting Tools -====== -![](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/best-linux-screenshot-and-screencasting-tools_orig.jpg) - -There comes a time you want to capture an error on your screen and send it to the developers or want help from _Stack Overflow,_ you need the right tools to take that screenshot and save it or send it. There are tools in the form of programs and others as shell extensions for GNOME. Not to worry, here are the best Linux Screenshot taking tools that you can use to take those screenshots or make a screencast. - -## Best Linux Screenshot Or Screencasting Tools - -### 1\. Shutter - - [![shutter linux screenshot taking tools](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/shutter-linux-screenshot-taking-tools_orig.jpg)][2] - -[Shutter][3] is one of the best Linux screenshot taking tools. It has the advantage of taking different screenshots depending on what you want to take on your screen. After you take the screenshot, it allows you to see the screenshot before saving it after you take the screenshot. It also includes an extension menu that shows up on your top panel for GNOME. That makes accessing the app much easier and much convenient for anyone to use. - -​You can take screenshots of a selection, a window, desktop, window under cursor, section, menu, tooltip or web. Shutter allows you to upload the screenshots directly to the cloud using the preferred cloud services provider. This Linux tool also allows you to edit your screenshots before you save them. It also comes with plugins that you can add or remove. - -To install it, you will have to type the following in the terminal: - -``` -sudo add-apt-repository -y ppa:shutter/ppa -sudo apt-get update && sudo apt-get install shutter -``` - -### 2. Vokoscreen - - [![vokoscreen screencasting tool for linux](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/vokoscreen-screencasting-tool-for-linux_orig.jpg)][4] - - -[Vokoscreen][5] is an app that allows you to record your screen as you show around and narrate what you are doing on the screen. It is easy to use, has a simple interface and includes a top panel menu for easy access when you are recording your screen. - -​ - -You can choose to record the whole screen, a window or just a selection of an area. Customizing the recording is easy to get the type of screen recording you want to achieve. Vokoscreen even allows you to create a gif as a screen recording. You can also record yourself using the webcam in case you were narrating as tutorials so that you can engage the learners. Once you are done, you can playback the recording right from the application so that you don’t have to keep navigating to find the recording. - - [![vokoscreen preferences](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/vokoscreen-preferences_orig.jpg)][6] - -You can install Vocoscreen from your distro repository. Or download the package from [pkgs.org][7] , select the Linux distro you are using. - -``` -sudo dpkg -i vokoscreen_2.5.0-1_amd64.deb -``` - -### 3. OBS - - [![obs linux screencasting tool](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/obs-linux-screencasting-tool_orig.jpg)][8] - -[OBS][9] can be used to record your screen as well as record streams from the internet. It allows you to see whatever you are recording as you stream or as you narrate your screen recording. It allows you to choose the quality of your recording according to your preferences. It also allows you to choose the type of file you want your recording to save to. In addition to the feature of recording, you can switch to Studio mode allowing you to edit your recording to make a complete video without having to use any other external editing software. To install OBS in your Linux distribution, you must have FFmpeg installed on your machine. To install FFmpeg type the following in the terminal for ubuntu 14.04 and earlier: - -``` -sudo add-apt-repository ppa:kirillshkrogalev/ffmpeg-next - -sudo apt-get update && sudo apt-get install ffmpeg -``` - -​For ubuntu 15.04 and later you can just type the following in the terminal to install FFmpeg: - -``` -sudo apt-get install ffmpeg -``` - -​If you have already installed FFmpeg, type the following in the terminal to install OBS: - -``` -sudo add-apt-repository ppa:obsproject/obs-studio - -sudo apt-get update - -sudo apt-get install obs-studio -``` - -### 4. Green Recorder - - [![green recording linux tool](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/green-recording-linux-tool_orig.jpg)][10] - -[Green recorder][11] is a simple interface based program that allows you to record the screen. You can choose what to record including video or just audio and allow you to show the mouse pointer and even follow it as you record your screen. You can record a window or just a selected area on your screen so that only what you want to record shows up in your recording. You can customize the number of frames to record in your final video. In case you want to start recording after a delay, you have the option to configure the delay you wish to set. You have the option to run a command after the recording is done that will run on your machine immediately after you stop recording. - -​ - -To install green recorder, type the following in the terminal: - -``` -sudo add-apt-repository ppa:fossproject/ppa - -sudo apt update && sudo apt install green-recorder -``` - -### 5. Kazam - - [![kazam screencasting tool for linux](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/kazam-screencasting-tool-for-linux_orig.jpg)][12] - -[Kazam][13] Linux screenshot tool is very popular amongst Linux users. It is an intuitive simple to use app that allows you to take a screencast or a screenshot allowing you to customise the delay before taking a screencast or screenshot. It allows you to select the area, window or fullscreen you want to capture. Kazam’s interface is well laid out and not as complicated as other apps. Its features will leave you happy about taking your screenshots. Kazam also includes a system tray icon and menu that allows you to take the screenshot without going to the application itself. - -​​ - -To install Kazam, type the following in the terminal: - -``` -sudo apt-get install kazam -``` - -​If the PPA is not found, you can install it manually using the following commands: - -``` -sudo add-apt-repository ppa:kazam-team/stable-series - -sudo apt-get update && sudo apt-get install kazam -``` - -### 6. Screenshot tool GNOME extension - - [![gnome screenshot extension](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/gnome-screenshot-extension-compressed_orig.jpg)][1] - -There is a GNOME extension just named screenshot tool that always shows up on the system panel until you disable it. It is convenient since it just sits on the system panel until you will trigger it to take a screenshot. The main advantage of this tool is that it is the quickest to access since it is always in your system panel unless you deactivate it in the tweak utility tool. The tool also has a preferences window allowing you to tweak it to your preferences. To install it on your GNOME desktop, head to extensions.gnome.org and search for “_Screenshot Tool”._ - -You must have the gnome extensions chrome extension installed as well as GNOME tweaks tool installed to use the tool. - - [![gnome screenshot extension preferences](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/gnome-screenshot-extension-preferences_orig.jpg)][14] - -The **Linux screenshot tools** are quite helpful especially when you don’t know what to do when you come across a problem and want to share the error with [the Linux community][15] or the developers of a program that you are using. Learning developers or programmers or anyone else need it will find these tools useful to share your screenshots. Youtubers and tutorial makers will find the screencasting tools even more useful when they use them to record their tutorials and post them.​ - - --------------------------------------------------------------------------------- - -via: http://www.linuxandubuntu.com/home/best-linux-screenshot-screencasting-tools - -作者:[linuxandubuntu][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.linuxandubuntu.com -[1]:http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/gnome-screenshot-extension-compressed_orig.jpg -[2]:http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/shutter-linux-screenshot-taking-tools_orig.jpg -[3]:http://shutter-project.org/ -[4]:http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/vokoscreen-screencasting-tool-for-linux_orig.jpg -[5]:https://github.com/vkohaupt/vokoscreen -[6]:http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/vokoscreen-preferences_orig.jpg -[7]:https://pkgs.org/download/vokoscreen -[8]:http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/obs-linux-screencasting-tool_orig.jpg -[9]:https://obsproject.com/ -[10]:http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/green-recording-linux-tool_orig.jpg -[11]:https://github.com/foss-project/green-recorder -[12]:http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/kazam-screencasting-tool-for-linux_orig.jpg -[13]:https://launchpad.net/kazam -[14]:http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/gnome-screenshot-extension-preferences_orig.jpg -[15]:http://www.linuxandubuntu.com/home/top-10-communities-to-help-you-learn-linux diff --git a/sources/tech/20180117 How To Manage Vim Plugins Using Vundle On Linux.md b/sources/tech/20180117 How To Manage Vim Plugins Using Vundle On Linux.md index 4d4d388ed7..40f6c926f1 100644 --- a/sources/tech/20180117 How To Manage Vim Plugins Using Vundle On Linux.md +++ b/sources/tech/20180117 How To Manage Vim Plugins Using Vundle On Linux.md @@ -1,3 +1,5 @@ +translated by cyleft + How To Manage Vim Plugins Using Vundle On Linux ====== ![](https://www.ostechnix.com/wp-content/uploads/2018/01/Vundle-4-720x340.png) diff --git a/sources/tech/20180117 Linux tee Command Explained for Beginners (6 Examples).md b/sources/tech/20180117 Linux tee Command Explained for Beginners (6 Examples).md index e1be9e3da2..4d6ad5442d 100644 --- a/sources/tech/20180117 Linux tee Command Explained for Beginners (6 Examples).md +++ b/sources/tech/20180117 Linux tee Command Explained for Beginners (6 Examples).md @@ -1,3 +1,5 @@ +translated by cyleft + Linux tee Command Explained for Beginners (6 Examples) ====== diff --git a/translated/tech/20171127 Protecting Your Website From Application Layer DOS Attacks With mod.md b/translated/tech/20171127 Protecting Your Website From Application Layer DOS Attacks With mod.md new file mode 100644 index 0000000000..7913acd02c --- /dev/null +++ b/translated/tech/20171127 Protecting Your Website From Application Layer DOS Attacks With mod.md @@ -0,0 +1,216 @@ +用 mod 保护您的网站免受应用层 DOS 攻击 +====== + +有多种恶意攻击网站的方法,比较复杂的方法要涉及数据库和编程方面的技术知识。一个更简单的方法被称为“拒绝服务”或“DOS”攻击。这个攻击方法的名字来源于它的意图:使普通客户或网站访问者的正常服务请求被拒绝。 + +一般来说,有两种形式的 DOS 攻击: + + 1. OSI 模型的三、四层,即网络层攻击 + 2. OSI 模型的七层,即应用层攻击 + +第一种类型的 DOS 攻击——网络层,发生于当大量的垃圾流量流向网页服务器时。当垃圾流量超过网络的处理能力时,网站就会宕机。 + +第二种类型的 DOS 攻击是在应用层,是利用合法的服务请求,而不是垃圾流量。当页面请求数量超过网页服务器能承受的容量时,即使是合法访问者也将无法使用该网站。 + +本文将着眼于缓解应用层攻击,因为减轻网络层攻击需要大量的可用带宽和上游提供商的合作,这通常不是通过配置网络服务器就可以做到的。 + +通过配置普通的网页服务器,可以保护网页免受应用层攻击,至少是适度的防护。防止这种形式的攻击是非常重要的,因为 [Cloudflare][1] 最近 [报道][2] 了网络层攻击的数量正在减少,而应用层攻击的数量则在增加。 + +本文将根据 [zdziarski 的博客][4] 来解释如何使用 Apache2 的模块 [mod_evasive][3]。 + +另外,mod_evasive 会阻止攻击者试图通过尝试数百个组合来猜测用户名和密码,即暴力攻击。 + +Mod_evasive 会记录来自每个 IP 地址的请求的数量。当这个数字超过相应 IP 地址的几个阈值之一时,会出现一个错误页面。错误页面所需的资源要比一个能够响应合法访问的在线网站少得多。 + +### 在 Ubuntu 16.04 上安装 mod_evasive + +Ubuntu 16.04 默认的软件库中包含了 mod_evasive,名称为“libapache2-mod-evasive”。您可以使用 `apt-get` 来完成安装: +``` +apt-get update +apt-get upgrade +apt-get install libapache2-mod-evasive + +``` + +现在我们需要配置 mod_evasive。 + +它的配置文件位于 `/etc/apache2/mods-available/evasive.conf`。默认情况下,所有模块的设置在安装后都会被注释掉。因此,在修改配置文件之前,模块不会干扰到网站流量。 +``` + + #DOSHashTableSize 3097 + #DOSPageCount 2 + #DOSSiteCount 50 + #DOSPageInterval 1 + #DOSSiteInterval 1 + #DOSBlockingPeriod 10 + + #DOSEmailNotify you@yourdomain.com + #DOSSystemCommand "su - someuser -c '/sbin/... %s ...'" + #DOSLogDir "/var/log/mod_evasive" + + +``` + +第一部分的参数的含义如下: + + * **DOSHashTableSize** - 正在访问网站的 IP 地址列表及其请求数。 + * **DOSPageCount** - 在一定的时间间隔内,每个的页面的请求次数。时间间隔由 DOSPageInterval 定义。 + * **DOSPageInterval** - mod_evasive 统计页面请求次数的时间间隔。 + * **DOSSiteCount** - 与 DOSPageCount 相同,但统计的是网站内任何页面的来自相同 IP 地址的请求数量。 + * **DOSSiteInterval** - mod_evasive 统计网站请求次数的时间间隔。 + * **DOSBlockingPeriod** - 某个 IP 地址被加入黑名单的时长(以秒为单位)。 + + +如果使用上面显示的默认配置,则在如下情况下,一个 IP 地址会被加入黑名单: + + * 每秒请求同一页面超过两次。 + * 每秒请求 50 个以上不同页面。 + + +如果某个 IP 地址超过了这些阈值,则被加入黑名单 10 秒钟。 + +这看起来可能不算久,但是,mod_evasive 将一直监视页面请求,包括在黑名单中的 IP 地址,并重置其加入黑名单的起始时间。只要一个 IP 地址一直尝试使用 DOS 攻击该网站,它将始终在黑名单中。 + +其余的参数是: + + * **DOSEmailNotify** - 用于接收 DOS 攻击信息和 IP 地址黑名单的电子邮件地址。 + * **DOSSystemCommand** - 检测到 DOS 攻击时运行的命令。 + * **DOSLogDir** - 用于存放 mod_evasive 的临时文件的目录。 + + +### 配置 mod_evasive + +默认的配置是一个很好的开始,因为它的黑名单里不该有任何合法的用户。取消配置文件中的所有参数(DOSSystemCommand 除外)的注释,如下所示: +``` + + DOSHashTableSize 3097 + DOSPageCount 2 + DOSSiteCount 50 + DOSPageInterval 1 + DOSSiteInterval 1 + DOSBlockingPeriod 10 + + DOSEmailNotify JohnW@example.com + #DOSSystemCommand "su - someuser -c '/sbin/... %s ...'" + DOSLogDir "/var/log/mod_evasive" + + +``` + +必须要创建日志目录并且要赋予其与 apache 进程相同的所有者。这里创建的目录是 `/var/log/mod_evasive` ,并且在 Ubuntu 上将该目录的所有者和组设置为 `www-data` ,与 Apache 服务器相同: +``` +mkdir /var/log/mod_evasive +chown www-data:www-data /var/log/mod_evasive + +``` + +在编辑了 Apache 的配置之后,特别是在正在运行的网站上,在重新启动或重新加载之前,最好检查一下语法,因为语法错误将影响 Apache 的启动从而使网站宕机。 + +Apache 包含一个辅助命令,是一个配置语法检查器。只需运行以下命令来检查您的语法: +``` +apachectl configtest + +``` + +如果您的配置是正确的,会得到如下结果: +``` +Syntax OK + +``` + +但是,如果出现问题,您会被告知在哪部分发生了什么错误,例如: +``` +AH00526: Syntax error on line 6 of /etc/apache2/mods-enabled/evasive.conf: +DOSSiteInterval takes one argument, Set site interval +Action 'configtest' failed. +The Apache error log may have more information. + +``` + +如果您的配置通过了 configtest 的测试,那么这个模块可以安全地被启用并且 Apache 可以重新加载: +``` +a2enmod evasive +systemctl reload apache2.service + +``` + +Mod_evasive 现在已配置好并正在运行了。 + +### 测试 + +为了测试 mod_evasive,我们只需要向服务器提出足够的网页访问请求,以使其超出阈值,并记录来自 Apache 的响应代码。 + +一个正常并成功的页面请求将收到如下响应: +``` +HTTP/1.1 200 OK + +``` + +但是,被 mod_evasive 拒绝的将返回以下内容: +``` +HTTP/1.1 403 Forbidden + +``` + +以下脚本会尽可能迅速地向本地主机(127.0.0.1,localhost)的 80 端口发送 HTTP 请求,并打印出每个请求的响应代码。 + +你所要做的就是把下面的 bash 脚本复制到一个文件中,例如 `mod_evasive_test.sh`: +``` +#!/bin/bash +set -e + +for i in {1..50}; do + curl -s -I 127.0.0.1 | head -n 1 +done + +``` + +这个脚本的部分含义如下: + + * curl - 这是一个发出网络请求的命令。 + * -s - 隐藏进度表。 + * -I - 仅显示响应头部信息。 + * head - 打印文件的第一部分。 + * -n 1 - 只显示第一行。 + +然后赋予其执行权限: +``` +chmod 755 mod_evasive_test.sh + +``` + +在启用 mod_evasive **之前**,脚本运行时,将会看到 50 行“HTTP / 1.1 200 OK”的返回值。 + +但是,启用 mod_evasive 后,您将看到以下内容: +``` +HTTP/1.1 200 OK +HTTP/1.1 200 OK +HTTP/1.1 403 Forbidden +HTTP/1.1 403 Forbidden +HTTP/1.1 403 Forbidden +HTTP/1.1 403 Forbidden +HTTP/1.1 403 Forbidden +... + +``` + +前两个请求被允许,但是在同一秒内第三个请求发出时,mod_evasive 拒绝了任何进一步的请求。您还将收到一封电子邮件(邮件地址在选项 `DOSEmailNotify` 中设置),通知您有 DOS 攻击被检测到。 + +Mod_evasive 现在已经在保护您的网站啦! + + +-------------------------------------------------------------------------------- + +via: https://bash-prompt.net/guides/mod_proxy/ + +作者:[Elliot Cooper][a] +译者:[jessie-pang](https://github.com/jessie-pang) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://bash-prompt.net/about/ +[1]:https://www.cloudflare.com +[2]:https://blog.cloudflare.com/the-new-ddos-landscape/ +[3]:https://github.com/jzdziarski/mod_evasive +[4]:https://www.zdziarski.com/blog/ \ No newline at end of file diff --git a/translated/tech/20180110 Best Linux Screenshot and Screencasting Tools.md b/translated/tech/20180110 Best Linux Screenshot and Screencasting Tools.md new file mode 100644 index 0000000000..277ded9f69 --- /dev/null +++ b/translated/tech/20180110 Best Linux Screenshot and Screencasting Tools.md @@ -0,0 +1,140 @@ +Linux 最好的图片截取和视频截录工具 +====== +![](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/best-linux-screenshot-and-screencasting-tools_orig.jpg) + +这里可能有一个困扰你多时的问题,当你想要获取一张屏幕截图向开发者反馈问题,或是在 _Stack Overflow_ 寻求帮助时,你可能缺乏一个可靠的屏幕截图工具去保存和发送集截图。GNOME 有一些形如程序和 shell 拓展的工具。不必担心,这里有 Linux 最好的屏幕截图工具,供你截取图片或截录视频。 + +## Linux 最好的图片截取和视频截录工具 + +### 1. Shutter + + [![shutter Linux 截图工具](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/shutter-linux-screenshot-taking-tools_orig.jpg)][2] + +[Shutter][3] 可以截取任意你想截取的屏幕,是 Linux 最好的截屏工具之一。得到截屏之后,它还可以在保存截屏之前预览图片。GNOME 面板顶部有一个 Shutter 拓展菜单,使得用户进入软件变得更人性化。 + +你可以选择性的截取窗口、桌面、光标下的面板、自由内容、菜单、提示框或网页。Shutter 允许用户直接上传屏幕截图到设置内首选的云服务器中。它同样允许用户在保存截图之前编辑器图片;同样提供可自由添加或移除的插件。 + +终端内键入下列命令安装此工具: + +``` +sudo add-apt-repository -y ppa:shutter/ppa +sudo apt-get update && sudo apt-get install shutter +``` + +### 2. Vokoscreen + + [![vokoscreen Linux 屏幕录制工具](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/vokoscreen-screencasting-tool-for-linux_orig.jpg)][4] + + +[Vokoscreen][5] 是一款允许记录和叙述屏幕活动的一款软件。它有一个简洁的界面,界面的顶端包含有一个简明的菜单栏,方便用户开始录制视频。 + +你可以选择记录整个屏幕,或是记录一个窗口,抑或是记录一个自由区域,并且自定义保存类型;你甚至可以将屏幕录制记录保存为 gif 文件。当然,你也可以使用网络摄像头记录自己的情况,将自己转换成学习者。一旦你这么做了,你就可以在应用程序中回放视频记录。 + + [![vokoscreen preferences](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/vokoscreen-preferences_orig.jpg)][6] + +你可以安装自己仓库的 Vocoscreen 发行版,或者你也可以在 [pkgs.org][7] 选择下载你需要的发行版。 + +``` +sudo dpkg -i vokoscreen_2.5.0-1_amd64.deb +``` + +### 3. OBS + + [![obs Linux 视频截录](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/obs-linux-screencasting-tool_orig.jpg)][8] + +[OBS][9] 可以用来录制自己的屏幕亦可用来录制互联网上的数据流。它允许你看到自己所录制的内容或者当你叙述时的屏幕录制。它允许你根据喜好选择录制视频的品质;它也允许你选择文件的保存类型。除了视频录制功能之外,你还可以切换到 Studio 模式,不借助其他软件编辑视频。要在你的 Linux 系统中安装 OBS,你必须确保你的电脑已安装 FFmpeg。ubuntu 14.04 或更早的版本安装 FFmpeg 可以使用如下命令: + +``` +sudo add-apt-repository ppa:kirillshkrogalev/ffmpeg-next + +sudo apt-get update && sudo apt-get install ffmpeg +``` + +ubuntu 15.04 以及之后的版本,你可以在终端中键入如下命令安装 FFmpeg: + +``` +sudo apt-get install ffmpeg +``` + +​如果 GGmpeg 安装完成,在终端中键入如下安装 OBS: + +``` +sudo add-apt-repository ppa:obsproject/obs-studio + +sudo apt-get update + +sudo apt-get install obs-studio +``` + +### 4. Green Recorder + + [![屏幕录制工具](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/green-recording-linux-tool_orig.jpg)][10] + +[Green recorder][11] 是一款基于接口的简单程序,它可以让你记录屏幕。你可以选择包括视频和单纯的音频在内的录制内容,也可以显示鼠标指针,甚至可以跟随鼠标录制视频。同样,你可以选择记录窗口或是自由区域,以便于在自己的记录中保留需要的内容;你还可以自定义保存视频的帧数。如果你想要延迟录制,它提供给你一个选项可以设置出你想要的延迟时间。它还提供一个录制结束的命令运行选项,这样,就可以在视频录制结束后立即运行。​ + +在终端中键入如下命令来安装 green recorder: + +``` +sudo add-apt-repository ppa:fossproject/ppa + +sudo apt update && sudo apt install green-recorder +``` + +### 5. Kazam + + [![kazam screencasting tool for linux](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/kazam-screencasting-tool-for-linux_orig.jpg)][12] + +[Kazam][13] 在几乎所有使用截图工具的 Linux 用户中,都十分流行。这是一款简单直观的软件,它可以让你做一个屏幕截图或是视频录制也同样允许在屏幕截图或屏幕录制之前设置延时。它可以让你选择录制区域,窗口或是你想要抓取的整个屏幕。Kazam 的界面接口部署的非常好,和其他软件相比毫无复杂感。它的特点,就是让你优雅的截图。Kazam 在系统托盘和菜单中都有图标,无需打开应用本身,你就可以开始屏幕截图。​​ + +终端中键入如下命令来安装 Kazam: + +``` +sudo apt-get install kazam +``` + +​如果没有找到 PPA,你需要使用下面的命令安装它: + +``` +sudo add-apt-repository ppa:kazam-team/stable-series + +sudo apt-get update && sudo apt-get install kazam +``` + +### 6. GNOME 拓展截屏工具 + + [![gnome screenshot extension](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/gnome-screenshot-extension-compressed_orig.jpg)][1] + +GNOME 的一个拓展软件就叫做 screenshot tool,它常驻系统面板,如果你没有设置禁用它。由于它是常驻系统面板的软件,所以它会一直等待你的调用,获取截图,方便和容易获取是它最主要的特点,除非你在系统工具禁用,否则它将一直在你的系统面板中。这个工具也有用来设置首选项的选项窗口。在 extensions.gnome.org 中搜索“_Screenshot Tool_”,在你的 GNOME 中安装它。 + +你需要安装 gnome 拓展,chrome 拓展和 GNOME 调整工具才能使用这个工具。 + + [![gnome screenshot 拓展选项](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/gnome-screenshot-extension-preferences_orig.jpg)][14] + +当你碰到一个问题,不知道怎么处理,想要在 [the Linux community][15] 或者其他开发社区分享、寻求帮助的的时候, **Linux 截图工具** 尤其合适。学习开发、程序或者其他任何事物都会发现这些工具在分享截图的时候真的很实用。Youtube 用户和教程制作爱好者会发现视频截录工具真的很适合录制可以发表的教程。 + +-------------------------------------------------------------------------------- + +via: http://www.linuxandubuntu.com/home/best-linux-screenshot-screencasting-tools + +作者:[linuxandubuntu][a] +译者:[CYLeft](https://github.com/CYLeft) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.linuxandubuntu.com +[1]:http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/gnome-screenshot-extension-compressed_orig.jpg +[2]:http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/shutter-linux-screenshot-taking-tools_orig.jpg +[3]:http://shutter-project.org/ +[4]:http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/vokoscreen-screencasting-tool-for-linux_orig.jpg +[5]:https://github.com/vkohaupt/vokoscreen +[6]:http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/vokoscreen-preferences_orig.jpg +[7]:https://pkgs.org/download/vokoscreen +[8]:http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/obs-linux-screencasting-tool_orig.jpg +[9]:https://obsproject.com/ +[10]:http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/green-recording-linux-tool_orig.jpg +[11]:https://github.com/foss-project/green-recorder +[12]:http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/kazam-screencasting-tool-for-linux_orig.jpg +[13]:https://launchpad.net/kazam +[14]:http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/gnome-screenshot-extension-preferences_orig.jpg +[15]:http://www.linuxandubuntu.com/home/top-10-communities-to-help-you-learn-linux