Vanadium Vanadium

web design

WAMP Part 4 – other configuration

Leave a Comment

Part 4 continues from WAMP Part 3 – SSL and will conclude the WAMP series. It includes the remaining configuration changes necessary to help your development server match your production server and allow you to test all the features of your programs before putting them into production.

  • Rewrite module – This allows Apache to rewrite URLs and do interesting things with forwarding pages.
    • In Notepad (Run as administrator) open C:\Program Files\Apache\Apache 2.4\conf\httpd.conf.

And then there are other configuration changes that I make to help improve the Google PageSpeed scores on my websites.

  • Deflate module – This module allows your webserver to compress files before sending them, reducing website bandwidth.
    • In Notepad (Run as administrator) open C:\Program Files\Apache\Apache 2.4\conf\httpd.conf.
    • Add the following, anywhere in the file. I like to put it near the bottom, after the MIME directives.
      <IfModule deflate_module>
      AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/javascript application/x-javascript
      </IfModule>
    • Uncomment the line near the top to become LoadModule deflate_module modules/mod_deflate.so.
    • Uncomment another line near the top to become LoadModule filter_module modules/mod_filter.so.
    • Save the file, and open the Apache Monitor from the system tray, and restart Apache.
    • More information can be found at http://httpd.apache.org/docs/current/mod/mod_deflate.html.
  • Expiration module – This module allows your webserver to specify longer expiration times for specific resources so the browser can cache them longer and reduce the number of downloads.
    • In Notepad (Run as administrator) open C:\Program Files\Apache\Apache 2.4\conf\httpd.conf.
    • Add the following, anywhere in the file. I like to put it near the bottom, after the deflate_module directives added above.
      <IfModule expires_module>
      ExpiresActive On

      ExpiresByType image/png “access plus 1 week”
      ExpiresByType image/jpeg “access plus 1 week”
      ExpiresByType image/gif “access plus 1 week”
      ExpiresByType text/css “access plus 1 week”
      ExpiresByType text/javascript “access plus 1 week”
      ExpiresByType application/javascript “access plus 1 week”
      ExpiresByType application/x-javascript “access plus 1 week”
      </IfModule>
    • Uncomment the line near the top to become LoadModule expires_module modules/mod_expires.so.
    • Save the file, and open the Apache Monitor from the system tray, and restart Apache.
    • More information can be found at http://httpd.apache.org/docs/current/mod/mod_expires.html.

There is one additional configuration change that I needed to make on my computer. Requesting a page from the server via IE would frequently cause Apache to hang (and occasionally via Firefox, but never via Chrome), and I would have to restart Apache before it would work again. Adding the lines below to the httpd.conf file fixed the problem. It may be related to the fact that I’m running a virtual switch in Hyper-V manager in order to connect virtual machines on my computer, but I can’t really claim to understand the description. Thanks to Thomasz for posting the solution.

  • In Notepad (Run as administrator) open C:\Program Files\Apache\Apache 2.4\conf\httpd.conf.
  • Add the following, anywhere in the file. I located it it near the top, right after the Listen 80 line.
    AcceptFilter http none
    AcceptFilter https none
  • Save the file, and open the Apache Monitor from the system tray, and restart Apache.
  • More information can be found at http://httpd.apache.org/docs/2.4/mod/core.html. If you can understand any of it, then you’re doing better than I am.

I also install GraphViz  on my computer, which is optional, but recommended for phpDocumentor, if that is something that you use.

Your server is now ready to use. If you have other ideas for items that should be included, please include them in the comments below.

 

Leave a Reply

Your email address will not be published. Required fields are marked *