Sunday, 16 January 2011

Adding mime types to a Linux server

There are two ways to add a mime type to a Linux server. You can either add the mime type to the server mime type listing or you can specify a mime type via an .htaccess file in a individual hosting account. This article will explain how to do both.

Method 1.

  1. Log into the Linux server via SSH.

  2. Open the “/etc/mime.types” file using a text editor.

  3. Add the new mime type into the end of the “/etc/mime.types” file and save it.

  4. Restart Apache by typing either of the following commands;


“service httpd restart”

“/etc/init.d/httpd restart”

Method 2.

  1. Loging the Linux server via SSH.

  2. Navigate to the account that you wish to add the mime type. You will need to be in the web accessible portion of the account.

  3. Either create or modify the existing “.htaccess” file and add the mime type entry and save the file.

  4. Restart Apache by typing either of the following commands;


“service httpd restart”

“/etc/init.d/httpd restart”

No comments:

Post a Comment