I'm running a web server on a Pi3B+, using Apache. This is for an in-house library project, and the machine runs on its own AdHoc network. It will never have network contact with the outside world, so I'm not worried about security. Through a cgi script, I need to trigger a cp command, but that command is getting ignored. Here's a very simple bash script that isn't working:
echo "Content-type: text/html" echo "" echo '<html>' echo '<head><title>Blah blah blah</title></head>' echo 'Script is running' echo '<body>' /bin/cp /home/pi/query.sh /home/pi/newfile.sh echo '</body></html>’
Similarly, I can't mount an attached drive, echo text to a file, or do anything else that manipulates files or volumes. I understand opening things up this way is a big security hole, but again, security is not an issue in this case. What can I do to allow this kind of access?
EDIT: The script is executing – it's properly echoing text back to the client browser.