简体   繁体   English

如何在Windows 7上配置Jetty 9 CGI?

[英]How to configure Jetty 9 CGI on Windows 7?

readI'm trying to configure CGI (for perl scripts) on Jetty 9.1.5.v20140505, Windows 7. When trying solutions from the inet always getting errors that those functions/methods wouldn't be exist. 我正在尝试在Windows 7的Jetty 9.1.5.v20140505上配置CGI(用于perl脚本),从inet尝试解决方案时,总是会得到那些功能/方法不存在的错误。

Example: http://67-23-9-112.static.slicehost.net/faq?s=900-Content&t=CGI Adding what they are telling me, getting: 示例: http : //67-23-9-112.static.slicehost.net/faq?s=900-Content&t=CGI添加他们告诉我的内容,然后得到:

2014-05-22 13:08:09.137:WARN:oejx.XmlConfiguration:main: Config error at <Call name="addContext"><Ar
g>C:\jetty\webapps\app1\cgi-bin\*</Arg><Set name="ResourceBase">C:\jetty\webapps\app1</Set><Set name
="ServingDynamicServlets">TRUE</Set><Call name="addServlet"><Arg>Common Gateway Interface</Arg><Arg>
/</Arg><Arg>com.mortbay.Servlet.CGI</Arg><Put name="Path">/usr/local/bin:/usr/ucb:/bin:/usr/bin</Put
></Call></Call> java.lang.IllegalStateException: No Method: <Call name="addContext"><Arg>C:\jetty\we
bapps\app1\cgi-bin\*</Arg><Set name="ResourceBase">C:\jetty\webapps\app1</Set><Set name="ServingDyna
micServlets">TRUE</Set><Call name="addServlet"><Arg>Common Gateway Interface</Arg><Arg>/</Arg><Arg>c
om.mortbay.Servlet.CGI</Arg><Put name="Path">/usr/local/bin:/usr/ucb:/bin:/usr/bin</Put></Call></Cal
l> on class org.eclipse.jetty.server.Server in file:/C:/jetty/etc/jetty.x

I read an article where a guy said this would be the way for jetty 5 but not for 9. I'm researching for 9 and even in the documentation of jetty 9 I cant find anything about it. 我读过一篇文章,其中有人说这将是5号码头的方式,而不是9号码头的方式。我正在研究9号码头,甚至在9号码头的文档中我也找不到任何东西。 http://www.eclipse.org/jetty/documentation/9.1.5.v20140505/cgi-servlet.html doesnt tell me how to configure this jetty ... http://www.eclipse.org/jetty/documentation/9.1.5.v20140505/cgi-servlet.html并未告诉我如何配置此码头...

Can you guys please help me out :( Thanks in advice 你们能帮我吗:(谢谢你的建议

I able to run Perl scripts like: 我可以运行Perl脚本,例如:

print "Content-type: text/html\n\n";
foreach $key (keys %ENV) {
print "$key --> $ENV{$key}<br>";
} 

with this perl.xml in my webapps folder: 在我的webapps文件夹中包含以下perl.xml

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://www.eclipse.org/jetty/configure_9_0.dtd">
<Configure class="org.eclipse.jetty.servlet.ServletContextHandler">
<Set name="contextPath">/perl</Set>
<Set name="resourceBase">F:\perl_scripts</Set>

<Call name="addServlet">
    <Arg>org.eclipse.jetty.servlets.CGI</Arg>
    <Arg>*.pl</Arg>

     <Call name="setInitParameter">
        <Arg>commandPrefix</Arg>
        <Arg>C:\Perl64\bin\perl.exe</Arg>
    </Call>
    <Call name="setInitParameter">
        <Arg>Path</Arg>
        <Arg>F:\perl_scripts</Arg>
    </Call>


</Call>

</Configure>

Hope this helps. 希望这可以帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM