[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Treate .sh and .bash the same way Apache2



john doe wrote: 
> On 10/22/2019 4:20 PM, Dan Ritter wrote:
> > john doe wrote:
> >>
> >> Hi,
> >>
> >> I'm using Apache2 on Debian (Stretch 9) and trying to have the .bash
> >> extension treated like the .sh extension:
> >>
> >> For now, I have modified the file
> >> /etc/apache2/mods-availables/autoindex.conf byt adding .bash to the
> >> following line:
> >>
> >>         AddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tcl .bash
> >>
> >>
> >> The file with the .bash extension is not treated like it is for .sh
> >> (everything is working fine for the .sh), what am I missing?
> >>
> >>
> >> In other words, how should Apache2 be configured to make no difference
> >> between .sh and .bash extension.
> >
> > You say "treated like" but the config you have is just for what
> > icons are shown in file listings.
> >
> > Is that what's going wrong?
> >
> 
> Yes, along with that if I click on a .sh file I get prompted to
> download/open the file but if I click on a .bash file I can read the
> file in the browser.

Right, that's a completely separate thing.

The config you want is something like:

/etc/mime.types:
application/x-shellscript       .sh .shar .bash

and then run
 a2enmod mime

And if you haven't enabled autoindex.conf,

 a2enmod autoindex


-dsr-


Reply to: