I have a problem with my Apache Webserver, I got 2 environments: Development and Production. Both have the same configuration, but the first one sends the HTMLs exactly as they've been created, the second one doesn't send exactly the same file. They omit whitespaces, comments, and other chars that for a browser doesn't care, but if my app generate hash from this files and the apache changes the file, the hash won't be the same.

I've been looking for the differences but I nothing appears. Any suggestion?

My apache2 config

<VirtualHost *:80>
ServerName XXX
ServerAlias XXX XX.XX.XX.XX
DocumentRoot /var/www/
<Directory />
        Options FollowSymLinks
        AllowOverride None
<Directory /var/www/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride all
        Order allow,deny
        allow from all
        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 
ExtendedStatus On

This is my production config file and the modules enabled are the following with default values:

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



can't be specific without knowing your configuration, but your production environment is set up to use a HTML minifier. You'll need to dig through your configuration to put exceptions to the pages that you don't want Apache to minify. Check what installed modules you have on your web server.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.