Apache发送HTML没有评论

我的Apache Webserver有问题,我有两个环境:开发和生产。 两者都具有相同的configuration,但第一个发送的HTML完全按照他们已经创build,第二个不发送完全相同的文件。 他们省略了空格,注释和其他字符,对于浏览器不关心,但是如果我的应用程序从这个文件生成哈希值,而且Apache会更改文件,哈希将不会相同。

我一直在寻找差异,但我什么也没有出现。 任何build议?

我的apache2configuration

<VirtualHost *:80> ServerName XXX ServerAlias XXX XX.XX.XX.XX DocumentRoot /var/www/ <Directory /> Options FollowSymLinks AllowOverride None </Directory> <Directory /var/www/> Options Indexes FollowSymLinks MultiViews AllowOverride all Order allow,deny allow from all </Directory> ErrorLog /var/log/apache2/api-error.log # Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. LogLevel info CustomLog /var/log/apache2/api-access.log "%h %t %T %D %m %X %U" # Timestamp | bytes Downloaded | bytes Uploaded | PlayerID | IP | URL CustomLog /var/log/apache2/traffic-access.log "%{%s}t|%O|%I|%{Referer}i|%a|%U" ServerSignature On Alias /img/screenshots /dev/shm/screenshots #Alias /videos /mnt/STORAGE/videos Alias /awstats-icon/ /usr/share/awstats/icon/ ScriptAlias /aw-api-stats/ /usr/lib/cgi-bin/ <Location /server-status> SetHandler server-status Allow from all </Location> </VirtualHost> ExtendedStatus On 

这是我的生产configuration文件,启用的模块具有以下默认值:

alias.conf authz_groupfile.load cgi.load env.load php5.conf setenvif.conf alias.load authz_host.load deflate.conf mime.conf php5.load setenvif.load auth_basic.load authz_user.load deflate.load mime.load reqtimeout。 conf status.conf authn_file.load autoindex.conf dir.conf negotiation.conf reqtimeout.load status.load authz_default.load autoindex.load dir.load negotiation.load rewrite.load

谢谢

不知道您的configuration不能具体,但您的生产环境设置为使用HTML minifier。 您需要深入了解您的configuration,以便将不希望Apache缩小的页面添加到exception中。 检查您的Web服务器上安装了哪些模块。