Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] Trouble with CGI

I have discovered a further problem with my solution -- the non-cgi content is a bit too liberal

  <Call name="addServlet">
    <Arg>
      <New class="org.eclipse.jetty.servlet.ServletHolder">
        <Arg>default</Arg>
        <Arg>
          <Call name="forName" class="java.lang.Class">
            <Arg>org.eclipse.jetty.servlet.DefaultServlet</Arg>
          </Call>
        </Arg>
        <Call name="setInitParameter">
          <Arg>dirAllowed</Arg>
          <Arg>false</Arg>
        </Call>
      </New>
    </Arg>
    <Arg>/</Arg>
  </Call>

This servers everything in the bugzilla directory -- Now Apache deals with this via an ".htaccess" file but really I need to figure out how to tell DefaultServlet:

(a) what files it cannot serve "*.pm, *.pl, *.tmpl, localconfig
(b) either don't recurse into subdirectories or what ones are allowed (or restricted)

Does anyone have a pointer to how this is done in Jetty 9, or a simple example (in XML like above).

Thanks,
Tim

On Fri, Apr 10, 2015 at 11:21 AM, Tim Halloran <hallorant@xxxxxxxxx> wrote:


On Thu, Apr 9, 2015 at 7:07 PM, Joakim Erdfelt <joakim@xxxxxxxxxxx> wrote:
On Thu, Apr 9, 2015 at 6:14 PM, Tim Halloran <hallorant@xxxxxxxxx> wrote:
On Thu, Apr 9, 2015 at 3:20 PM, Simone Bordet <sbordet@xxxxxxxxxxx> wrote:
The modules can be confusing, there is little to motivate one over the other (I find myself trying to take ones out to see if I really need them). It might be nice to determine what module "enables" a class (notionally 'java -jar ../jetty.home/start.jar --list-module-with-class=org.eclipse.jetty.servlets.CGI' which would answer 'servlets' -- to help figure this out, I used jar tvf in the lib directory then --list-modules -- so it can be done).

Interesting idea, added an enhancement request at https://bugs.eclipse.org/bugs/show_bug.cgi?id=464342

Note however, that the module name can often be guessed properly from the package name pattern org.eclipse.jetty.<module>
So you could have just looked at the FQCN of org.eclipse.jetty.servlets.CGI and saw that it was servlets that you needed.

 - Joakim

Thanks, will do -- I do not think your note is in the documentation (it is useful to know) -- I'll go ahead and file an enhancement.


 

_______________________________________________
jetty-users mailing list
jetty-users@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-users



Back to the top