configure: error: mod_deflate has been requested but can not be built due to prerequisite failures

源码编译httpd-2.2.22时报错:

checking whether to enable mod_deflate… configure: error: mod_deflate has been requested but can not be built due to prerequisite failures

原因是没有安装zlib开发包,yum install -y zlib-devel 即可。

PS:

为什么编译时候的报错信息那么模糊,根本想不到是zlib-devel的问题··· 如果没有强大的Google,怎么办?···

ssh登陆输入密码后验证密码慢

       ssh登陆内网centos,在输入密码以后,密码验证的时间比较久(大约5秒左右),一般情况下应该是瞬间完成,最后确定是需要把ssh服务中的dns反解关闭。
       当ssh到服务器ip时,系统会试图通过DNS反查相对应的域名,如果DNS中没有这个IP的域名解析,则会等到DNS查询超时才会进行下一步,所以浪费了时间,解决如下:

vi  /etc/ssh/sshd_config

注释掉:UseDNS no    //默认为yes改为no

重启ssh服务。
还有个方法就是在服务器中不指定dns服务器。
vi /etc/resolv.conf         //注释掉所有配置行

另一种情况如下,我没遇到过,这个原因好像在ubuntu上容易出现(可能是个bug):

vi  /etc/ssh/sshd_config

修改GSSAPIAuthentication参数为 no,默认是yes

GSSAPIAuthentication
             Specifies whether user authentication based on GSSAPI is allowed.
             The default is”no”.  Note that this option applies to protocol
             version 2 only.

重启ssh服务。

ssh –vvv root@172.17.1.8         //-vvv的参数可以查看ssh登录的过程。

      在远程访问某些服务很慢的情况下,不妨去掉服务器dns试试。

安装redhat格式化文件系统慢

      在一台组装台式机安装rhel-server-5.5-x64时,格式化320G的硬盘特别慢,基本停留在 正在格式化/文件系统,最后Google查是硬盘模式的问题,需要把硬盘工作模式改为SATA。

解决方法:

       进BIOS改硬盘模式,SATA硬盘模式修改为AHCI,如果是Award BIOS,则修改On-Chip SATA Mode 修改为增强模式(Enhanced)。

自定义apache错误提示页面信息

假设你试着访问一个不存在或Apacha无法找到的页面时会反馈回404错误而且显示一个相当单调的提示错误的页面(通常还显示出网络管理员的电子邮件帐号)。

Apache所显示的的这些信息被储存在配置文件httpd.conf中。可以创建你自己的错误提示信息页面。

创建的的错误文件可以是一般的HTML,PHP或任何其他能被Apache所支持的网页文档格式。比如为404错误创建你的站点的提示页面,语法:
ErrorDocument 404 /404. php
你可以整体地使用它或在VirtualHost节单独设定。

当然,你必须提供这个文件; 在上述例子中,设定的是404.php,位于https://www.rootop.org/404.php。这一个文件应该包含错误信息和任何你想要说明的内容。

其他的错误信息也可以这么做。此外,你可以不创建单独页面就能显示你的个性化提示信息。举个例子:
ErrorDocument 500 “服务器出问题啦。请送花。”

Customize Apache’s default error pages

When Apache encounters an error, it displays a designated error message that’s prebuilt into the server. For example, let’s say that you try to load a page that Apache can’t find or that doesn’t exist. Apache returns a 404 (page not found) error and provides a rather drab Web page that indicates the error (and often the e-mail address of the Webmaster).

Apache draws this information from the data stored in the httpd.conf configuration file. However, you can spice things up by creating your own error documents.

Your error documents can be regular HTML, PHP, or any other Web document that the server supports. For instance, to create a new error message for a 404 error that better fits your site, use something like the following:

ErrorDocument 404 /404.php

You can use this globally or inside a VirtualHost stanza to affect one particular domain.

Of course, you must supply the file; in this example, it’s 404.php, located at http://www.yoursite.com/404.php. This file should contain the error message and anything else you want to specify.

You can also do this for any other error message type. In addition, you can present custom error messages without creating a whole page. Here’s an example:

ErrorDocument 500 “The server has encountered a problem. Please send flowers.”