• PHP
  • Ruby on Rails
  • MySQL
  • Linux
    • SELINUX
    • Fedora
    • debian
  • Apache
  • nginx
  • AJAX
Albertech.net

Tag Archives: Apach2

Apache configuration for Microsoft Office 2007 files

November 13, 2008 2:33 pm / Albertech.net

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.

Share this:

  • Facebook
  • Google
  • Twitter
  • Print
  • Email
Posted in: Tech / Tagged: apach2, Apache, apache2.conf, docx, httpd.conf, MIME, office 2007, ppsx, xlsx

Categories

  • AJAX
  • Android
  • Apache
  • Canon Cameras
  • Cloud
  • CMS
  • Computer Mods
  • Conferences
  • Deals
  • debian
  • Fedora
  • Flash
  • Frameworks
  • git
  • Hardware
  • HTML
  • IDE
  • iPhone
  • iPhone App Review
  • jQuery
  • Linux
  • Mac OS X
  • MySQL
  • nginx
  • PHP
  • portfolio
  • Puppet
  • Ruby on Rails
  • Script Reviews
  • SELINUX
  • Software
  • Software Review
  • SQL Server
  • statistics
  • Tech
  • Tomcat
  • Uncategorized
  • VMWARE
  • VPS
  • Windows
  • wordpress
  • Zend Framework

Blogroll

  • DragonAl Flickr
  • Dropbox – Free 2GB Account
  • James' Blog
  • Javascript Compressor
  • PHP Builder Community
  • PHP-Princess.net
  • Rubular – Regular Expression Validator
  • The Scale-Out Blog
  • Tiny MCE

Tags

activation AJAX android antec Apache AWS awstats canon coda codeigniter debian enclosure external free G1 install vmware tools Internet Explorer iphone 5 jquery Linux mx-1 MySQL office 2007 OSX photoshop PHP plugin plugins portfolio redesigned website review rewrite script security SELinux ssh tinymce tutorial upgrade VMWARE vmware server wordpress wordpress mu XSS zend framework
© Copyright 2013 Albertech.net
Infinity Theme by DesignCoral / WordPress
loading Cancel
Post was not sent - check your email addresses!
Email check failed, please try again
Sorry, your blog cannot share posts by email.