If you uploaded some Microsoft Office 2007 files onto your Apache server, you will notice that the files will open up as a zip file from your browser. To fix this, you will need to add the new file extensions to the Apache configuration file so that it will know how to set the correct file type. At first, I tried editing the /etc/mime.types file, but that did not work for me. So, I added the file types into the Apache configuration file and voila — it worked.
In Apache, edit the httpd.conf file. Or, in Apache2 edit the apache2.conf file. Search for the section with the AddType keywords. Make sure you backup the configuration file before making any changes. Add the following lines:
# MIME type fix
AddType application/vnd.openxmlformats-officedocument.spreadsheetml.sheet .xlsx
AddType application/vnd.openxmlformats-officedocument.wordprocessingml.document .docx
AddType application/vnd.openxmlformats-officedocument.presentationml.slideshow .pptx
Make sure to test the syntax of the configuration file using apache2ctl configtest or apachectl configtest. Then restart the Apache service via apache2ctl restart or apachectl restart.
If you need to support all Microsoft Office 2007 file extensions, please check out this webmasterworld post.