
Over the next couple of articles, we’ll be optimizing our server to serve pages/files to our visitors faster. By making a few simple changes, we’ll be able to reduce waiting time for our visitors, which is always a good thing. We’ll accomplish this by enabling gzip and setting more appropriate cache response headers.
However, before we can start on this, we need to add a couple of modules to Apache. We’ll be adding mod_headers and mod_expires, which will allow us to serve custom response headers.
If you didn’t delete the Apache download from before, cd into that directory (if you did delete it, redownload it, extract and cd into it). Now, run the following commands:
./configure --enable-so --enable-rewrite --enable-deflate --enable-headers=shared --enable-expires=shared
make
make install
Once those are finished, we need to edit our httpd.conf file to load our new modules.
nano /usr/local/apache2/conf/httpd.conf
Add the following lines after the line where we load the libphp5.so module:
LoadModule headers_module modules/mod_headers.so
LoadModule expires_module modules/mod_expires.so
Save and close the file. Then restart Apache:
apachectl -k restart
Now that you have recompiled Apache with these new modules, you’re all set for next week’s article.





VPS
June 6, 2009 7:55 am
I was looking an apache application like that. Thanks for your nice article.