hvordan kan jeg udføre .sh cscript fra en browser??
ja har fundet ud af...
at jeg bare skal lave en .htaccess fil med:
Kode: Vælg alt
Options ExecCGI
AddHandler cgi-script .sh
men vi jeg vil udføre komandoer i .sh filen som fx:
Kode: Vælg alt
#!/bin/bash
mv /var/www/counter/on/on.php /var/www/counter/
cd /counter
./srcds_run -console -game cstrike +ip 192.168.1.36 +map surf_10x_reloaded +maxplayers 16 -autoupdate
uden at få denne besked bankede i hoved:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, sup-port@live.dk and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
Apache/2.2.11 (Ubuntu) PHP/5.2.6-3ubuntu4.5 with Suhosin-Patch Server at 91.100.21.16 Port 80
hvordan kan jeg fortælle den at den gerne på køre disse .sh filer??
ps den kan sagtens køre .sh filer med indholdet:
Kode: Vælg alt
#!/bin/bash
DATE="$(date)"
echo "Content-type: text/html"
echo ""
echo "<html><head><title>Test</title></head><body>"
echo "Today is $DATE <br>"