Today, I suddenly found that my website could not be accessed. I went to the server to check whether Apache was in the starting status. After restarting, I could access the website normally.
Check Apache error logs and find many of the following error messages:
The specified network name is no longer available
[Error] An unknown filter was not added: deflate
This error occurs because deflate is used in the VM configuration file, but the mod_deflate module is not used in Apache.
For example, the VM configuration includes:
<Location/>
Addoutputfilterbytype deflate text/HTML text/XML text/plain
</Location>
OK. After finding the cause, we can solve the problem. Let Apache load the mod_deflate module.
We recommend that you use mod_deflate to compress apache2. mod_gzip is suitable for apache1.x.
1. Search for the deflate Module
Finding/home/test/httpd-2.0.50-name mod_deflate.c
2. Install mod_deflate
CD/home/test/httpd-2.0.50/modules/Filters
/Usr/local/apache2/bin/apxs-I-c-A/home/test/httpd-2.0.50/modules/filters/mod_deflate.c
Apxs command parameters:
-I this option indicates that you need to install one or more dynamic shared objects to the modules directory of the server.
-A this option automatically adds a loadmodule row to the httpd. conf file to activate this module. Or, if this row already exists, it is enabled.
-C this option indicates that the compilation operation is required. It will first compile the C source program (. c) files is the target code file (. o), and then connect the target code and other target code files in files (. O and. a) To generate a dynamic shared object dsofile. If the-O option is not specified, the output file name is inferred from the first file name in files, that is, the default file name is mod_name.so.
To install Apache, add -- enable-headers -- enable-deflate.