Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

241
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda