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

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

This widget could not be displayed.

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
Community showcase
Posted Sep 17, 2018 in Confluence

Why start from scratch? Introducing four new templates for Confluence Cloud

Hi my Community friends!  For those who don't know me, I'm a product marketer on the Confluence Cloud team - nice to meet you! For those of you who do, you know that I've been all up in your Co...

554 views 7 6
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you