BaseX with Apache
With apologies for the not-strictly-BaseX question--but I'm running BaseX through a reverse proxy with Apache (and Let's Encrypt), and I can't figure out how to disable directory listing for the BaseX webapp/static directory. I've tried editing the apache2 conf files in the standard ways. Hoping someone here has a quick solution to share.
Thanks in advance, Tim
Hi Tim -
What about modifying the BaseX web.xml in $basex/webapp/WEB-INF? That was you'd be disabling in Jetty instead of Apache. To be honest I have no idea if this will work, but:
<servlet>
<servlet-name>default</servlet-name>
<servlet-class>org.eclipse.jetty.servlet.DefaultServlet</servlet-class>
<init-param>
<param-name>dirAllowed</param-name>
<param-value>false</param-value>
</init-param>
</servlet>
or some variation thereof? I cribbed this from stackoverflow, naturally
(and here's where I found it: [1])Hope that's helpful, apologies if it's only noise. Best, Bridger
Quoted text · Tim Thompson · 16 lines
On Thu, May 27, 2021 at 9:48 AM Tim Thompson <timathom at gmail.com> wrote: > With apologies for the not-strictly-BaseX question--but I'm running BaseX > through a reverse proxy with Apache (and Let's Encrypt), and I can't figure > out how to disable directory listing for the BaseX webapp/static directory. > I've tried editing the apache2 conf files in the standard ways. Hoping > someone here has a quick solution to share. > > Thanks in advance, > Tim > > -- > Tim A. Thompson > Metadata Librarian > Yale University Library > >
Thanks, Bridger! Adding that param seemed to do the trick!
Best, Tim
Quoted text · Bridger Dyson-Smith · 43 lines
On Thu, May 27, 2021 at 9:59 AM Bridger Dyson-Smith <bdysonsmith at gmail.com> wrote: > Hi Tim - > > What about modifying the BaseX web.xml in $basex/webapp/WEB-INF? That was > you'd be disabling in Jetty instead of Apache. To be honest I have no idea > if this will work, but: > > <servlet> > <servlet-name>default</servlet-name> > <servlet-class>org.eclipse.jetty.servlet.DefaultServlet</servlet-class> > <init-param> > <param-name>dirAllowed</param-name> > <param-value>false</param-value> > </init-param> > </servlet> > or some variation thereof? I cribbed this from stackoverflow, naturally > (and here's where I found it: [1]) > > Hope that's helpful, apologies if it's only noise. > Best, > Bridger > > [1] > https://stackoverflow.com/questions/7217969/how-to-disable-directory-listing-for-jettys-webappcontext > > On Thu, May 27, 2021 at 9:48 AM Tim Thompson <timathom at gmail.com> wrote: > >> With apologies for the not-strictly-BaseX question--but I'm running BaseX >> through a reverse proxy with Apache (and Let's Encrypt), and I can't figure >> out how to disable directory listing for the BaseX webapp/static directory. >> I've tried editing the apache2 conf files in the standard ways. Hoping >> someone here has a quick solution to share. >> >> Thanks in advance, >> Tim >> >> -- >> Tim A. Thompson >> Metadata Librarian >> Yale University Library >> >>
Quoted text · Tim Thompson · 4 lines
On Thu, 2021-05-27 at 09:47 -0400, Tim Thompson wrote: > I can't figure > out how to disable directory listing for the BaseX webapp/static > directory.
Try putting an empty index.html file in it?
Written for BaseX 9.5. BaseX may have changed since: please check the current documentation.