Skip to main content

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

On Thu, Apr 9, 2015 at 3:20 PM, Simone Bordet <sbordet@xxxxxxxxxxx> wrote:
Hi,

On Thu, Apr 9, 2015 at 9:15 PM, Tim Halloran <hallorant@xxxxxxxxx> wrote:
> Hi,
>
> I'm trying to get Bugzilla running in Jetty via a "bugzilla.xml" file in the
> webapp directory. Below lists my attempt:

Please don't use the CGI servlet, but rather the FastCGI integration
that we have.
https://www.eclipse.org/jetty/documentation/current/fastcgi.html

Let us know if you succeed.

Thanks Simone this helped at bit. I've had some success -- I've gotten it working under CGI for now. Setting up php-fpm is a bit of a long term project for me.

The key "ahh ha" for me was that the module "servlets" is required in my server configuration

   java -jar ../jetty.home/start.jar --add-to-startd=servlets

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

Then I was able to use the following to make Bugzilla work property at /bugzilla with the listing below in webapps/bugzilla.xml -- which is an edit of the example you linked me to.

<?xml version="1.0"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_0.dtd">
<Configure class="org.eclipse.jetty.servlet.ServletContextHandler">

  <New id="root" class="java.lang.String">
    <Arg>/home/surelogic/git/bugzilla/html</Arg>
  </New>

  <Set name="contextPath">/bugzilla</Set>
  <Set name="resourceBase">
    <Ref refid="root" />
  </Set>
  <Set name="welcomeFiles">
    <Array type="string">
      <Item>index.cgi</Item>
    </Array>
  </Set>

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

  <Call name="addServlet">
    <Arg>org.eclipse.jetty.servlets.CGI</Arg>
    <Arg>*.cgi</Arg>
    <Call name="setInitParameter">
      <Arg>Path</Arg>
      <Arg>/usr/local/bin:/bin:/usr/bin</Arg>
    </Call>
  </Call>

</Configure>

Thanks much for the help!

Tim

--
Simone Bordet
----
http://cometd.org
http://webtide.com
http://intalio.com
Developer advice, training, services and support
from the Jetty & CometD experts.
Intalio, the modern way to build business applications.
_______________________________________________
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