Khaled Ahmed Sobhy
Khaled Ahmed Sobhy

Reputation: 357

why apache downloads text file instead of displaying on browser

apache downloads text file instead of displaying on browser. This happens only if the owner of the file is not the apache user.

I'm trying to open the alis /log in apache:

Alias /log "/home/log/"
<Directory /home/log/>
        Options Indexes FollowSymLinks MultiViews
        Order allow,deny
        Allow from all  
        AllowOverride None
</Directory>

It could be worth mentioning that file extensions are .log example: filename.log

Upvotes: 2

Views: 3798

Answers (1)

Khaled Ahmed Sobhy
Khaled Ahmed Sobhy

Reputation: 357

needed to add this line in httpd.conf

AddType text/plain .js .sh .txt .log

I tackled this before but failed because I forgot to add the .log from this link: https://web.archive.org/web/20171224215131/https://marcel.zurreck.com/nginx-apache-force-the-browser-to-show-a-file-instead-of-downloading

Upvotes: 3

Related Questions