Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

242
Vistas
Run shell command from Apache cgi-bin not working

It's a very basic question. There is an API server which accepts json file to create tickets.

I want to create a button on HTML (Apache) - so when click, runs a CURL command to submit a request to API server so as result ticket will be created.

I have created a BASH file - executable (a+x) I have Apache running and button is even working! but apparently the CURL command is not sending the request properly! There is no error at all. I have no idea how to troubleshoot this:

HTML code:

<form action="../cgi-bin/cgi.sh" method="post">
    <input type="submit" value="Call my Shell Script">
</form> 

BASH file: #!/bin/sh

OUTPUT="$curl -sS --negotiate --location-trusted -u: -c ~/.cookie -b ~/cookie https://API-Server.com/ticket -H 'Content-Type: application/json' --data-binary '{"descriptionContentType":"text/markdown","extensions":{"tt":{"Reason":[],"category":"Ticket","type":"New","item":"UserPC"}},"description":"Test","title":"TitleTest"}'"
# outputting data to the web browser from shell
# script
echo "Content-type: text/html"
echo ""
echo "<html><head><title>Demo</title></head><body>"
echo "Done. $OUTPUT <br>"
echo "</body></html>"

http.conf

LoadModule cgid_module modules/mod_cgid.so

ScriptAlias "/cgi-bin/" "/var/www/cgi-bin/"

<Directory "/var/www/cgi-bin">
    AllowOverride None
    # Options None
    Options +ExecCGI
    Require all granted
</Directory>
over 4 years ago · Santiago Trujillo
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda