Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Server
User Name
Linux - Server This forum is for the discussion of Linux Software used in a server related context.


  Search this Thread
Old 03-04-2009, 08:04 AM   #1
Registered: May 2003
Location: Oslo, Norway
Distribution: Ubuntu, Red Hat Enterprise Linux
Posts: 655

Rep: Reputation: 40
Apache: Making sure text files remain "unknown"


I'm running Apache 2.2.3 and are using it to share files, i.e the users can browse my directories and files and view/download on demand. The files are plain linux text files. The files are prifexed with ".log".

For some reason some text files are recognized as text files and marked accordingly, but others are marked uknown. The latter is actually what I want. Is there a way to get Apache to treat all *.log files and unknown? I know that /etc/mime.types can be used to map it to some built in type, but I don't know how to make sure the files remain undefined/unmapped.

Old 03-04-2009, 10:02 AM   #2
LQ Newbie
Registered: Feb 2009
Posts: 2

Rep: Reputation: 0

Not entirely sure but i think that you can do it by defining the .log extention as being of type application/octet-stream like this:

AddType application/octet-stream .log

within your apache2.conf or other config file.

This should ensure that the client browser doesnt recognise (and automatically display) the text content but instead prompts the user to download it instead.

1st post here - sorry if it is inaccurate or not what you were looking for
Old 03-04-2009, 10:34 AM   #3
Registered: May 2003
Location: Oslo, Norway
Distribution: Ubuntu, Red Hat Enterprise Linux
Posts: 655

Original Poster
Rep: Reputation: 40
Thanks, I'll check it out!


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Socket Programming making use of "select()" and "writefds" johncsl82 Programming 10 11-13-2011 01:27 PM
Courious "unknown" entries in "netstat" output Sheridan Linux - Networking 5 09-01-2009 10:09 AM
"Unknown Partition Table Signature" error when making a grub boot floppy ? uncle-c Linux - General 2 02-02-2008 06:29 AM
shell scripting: "formatting" issue with text files eur0dad Programming 3 08-17-2006 11:50 AM
"X-MS" cant open because "x-Multimedia System" cant access files at "smb&qu ponchy5 Linux - Networking 0 03-30-2004 12:18 AM

All times are GMT -5. The time now is 03:39 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration