ubuntu,debian,redhat,fedora,centos

ApacheBench with mod_gip, mod_deflate

分类:ApacheApacheBench is one of the most common programs used to benchmark web servers.
By default apachebench will run using HTTP/1.0 requests and without compression enabled even if the tested server supports that.

For example:

ab -n 1 -v 4 "http://www.linuxany.com/"

继续阅读 »

Apache Logs: how long does it take to serve a request?

分类:ApacheApache is one complex piece of software, that contains many features most people are normally not using. You can do so many things with apache outside of the default configurations, and I am not going to discuss today about an external module, but about the plain old mod_log_config.

Normally most people will use for apache logging the combined LogFormat, and will not even think there will be other possible additions to that. This normally looks like:

LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined

and it contains most of the information we would like to see in the logs. Still there are many other information we can include here… just see below for the full list.

继续阅读 »

Apache:Disable the HTTP TRACE method

分类:ApacheDescription: How to disable the HTTP TRACE method on recent apache versions.

Most vulnerability scanners (like the popular nessus, but commercial ones also) will complain (normally as a low thread or warning level) about TRACE method being enabled on the web server tested.

Normally you will have this enabled by default, but if you want to test if it is really enabled on your server you just have to telnet on the port your web server is running and request for “TRACE / HTTP/1.0” if you get a positive reply it means TRACE is enabled on your system. The output of a server with TRACE enabled will look like:

继续阅读 »

Apache调试重写规则(mod_rewrite)

分类:ApacheApache服务器是最流行的开源服务器,它有一个功能就是基于正则的URL重写功能。但有时我们开启重写规则后,由于正则的复杂性导致一些重写没有生效,这时就需要有一个调试方法来测试重写是否达到我们期望的结果。开启调试可以在Apache的配置文件中的rewrite规则后增加相应两条指令:

RewriteEngine on
RewriteRule ^/yesno/(.+\.php)$ /yesno/App/$1
RewriteLogLevel 3
RewriteLog “/www/linuxany/debug_rewrite.log”

通过以上设置,我们可以在/www/linuxany/debug_rewrite.log中找到相关的重写调试信息。

apache CGI程序的简单配置与使用

分类:Apache添加虚拟主机

<virtualhost 127.0.0.1:50001>
</virtualhost>

这里新添加了50001端口来进行监听,所以还需要添加监听端口号

Listen 50001要让程序能正常运行,还得通过配置ScriptAlias来允许服务器在指定的情况下,以CGI方式运行。

<virtualhost 127.0.0.1:50001>
ScriptAlias /cgi-bin/ /usr/local/apache/cgi-bin/
</virtualhost>

所以上述的配置会告诉apache,所以以/cgi-bin/开头的资源都会被映射到/usr/local/apache/cgi-bin/目录下,并被认为是cgi程序。然后重启服务器

继续阅读 »

返回顶部