Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

239
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!