LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Apache: Making sure text files remain "unknown" (https://www.linuxquestions.org/questions/linux-server-73/apache-making-sure-text-files-remain-unknown-709092/)

kenneho 03-04-2009 07:04 AM

Apache: Making sure text files remain "unknown"
 
Hi.


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.


Regards,
kenneho

swiftbiggy 03-04-2009 09:02 AM

Hi,

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 :)

kenneho 03-04-2009 09:34 AM

Thanks, I'll check it out!


All times are GMT -5. The time now is 01:15 AM.