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

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
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Tuesday in Confluence

We want to see the templates you've created in Confluence!

Hi Community, Jessica here from the Confluence Product Marketing team!  July’s community challenge is all about sharing pictures  — and as an extension of our first post on what ...

425 views 18 9
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