Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How I can create a cgi-bin folder in the confluence root??

liljoint March 11, 2013

Hi, I need to create a cgi-bin from transbank's webpay in confluence;

I can't create it...

I use this tutorial and doesn't work ( http://mischorradas.nishilua.com/2007/11/que-hacer-para-que-en-tomcat-6-funcionen-cgis-de-ficheros-ejecutables-en-linux/ )

please help.

1 answer

0 votes
MatthewC
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 12, 2013

You have to modify 2 files on the server install.

  • The CONF_INSTALL/confluence/WEB-INF/web.xml - to define the cgi servlet and mapping it to a URL
  • The CONF_INSTALL/conf/server.xml - to allow Confluence webapp to use the container servlets & avoid a security violation

In server.xml, modify the context line & add the privileged=true parameter

<Context path="" docBase="../confluence" debug="0" reloadable="false" useHttpOnly="true" privileged="true">

in web.xml, you need to add two sections, one a servlet definition, the other a servlet mapping.

Add to the start of the servlet mappings

<!-- CGI -->
<servlet>
<servlet-name>cgi</servlet-name>
<servlet-class>org.apache.catalina.servlets.CGIServlet</servlet-class>
<init-param>
<param-name>debug</param-name>
<param-value>0</param-value>
</init-param>
<init-param>
<param-name>cgiPathPrefix</param-name>
<param-value>WEB-INF/cgi</param-value>
</init-param>
<load-on-startup>5</load-on-startup>
</servlet>
<!-- CGI -->

and to the start of the servlet-mappings

<!-- CGI -->
<servlet-mapping>
<servlet-name>cgi</servlet-name>
<url-pattern>/cgi-bin/*</url-pattern>
</servlet-mapping>
<!-- CGI -->

You then create the directory: CONF_INSTALL/confluence/WEB-INF/cgi This is where you store your scripts. By default the servlet will try & invoke perl on the server to run the script. You can change this by reading the configuration on the how to.

http://tomcat.apache.org/tomcat-6.0-doc/cgi-howto.html

One warning.... using a java application container to run cgi scripts is EVIL. Don't do it. It will also open up all sorts of security holes which is you are working for a bank on a payment system is a BAD idea. I think you may want to go & look at how you are solving the problem

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events