Portál AbcLinuxu, 10. května 2025 09:19
Directory "/usr/local/apache2/cgi-bin"> AllowOverride None Options ExecCGI Order allow,deny Allow from all /Directory> ScriptAlias /cgi-bin/ "/usr/local/apache2/cgi-bin/" AddHandler cgi-script .cgi .plkdyz pominu ze me nebezi ani ten nejobycejnejsi perl script (bash ano, ale omezene :( to omezeni se tyka nasledujici situace, v kavarne je pozadavek z jednoho "ridiciho pc" treba vypnout koncove stanice, jiste pres ssh -2 atd ... to jde, muzu si na to udelat script i treba s nabidkou, ale chtel bych to provadet pres www za pomoci prave cgi. v /cgi-bin/ jsou scripty spustitelne - chmod +x a kdyz je spustim normal (pres terminal), tak se dana aplikace opravdu spusti, ale zadanim http://123.456.789.123/cgi-bin/start_program.cgi se nypise toto :
!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> html>head> title>500 Internal Server Error/title> /head>body> h1>Internal Server Error/h1> p>The server encountered an internal error or misconfiguration and was unable to complete your request./p> p>Please contact the server administrator, you@example.com and inform them of the time the error occurred, and anything you might have done that may have caused the error./p> p>More information about this error may be available in the server error log./p> p>Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request./p> /body>/html>ps: to same haze apache kdykoliv kdyz se pokusim spustit i pl :( ve vysledku by to vypadalo na webovou stranku, kde by byly buttony start program A, shutdown pc01 apt ... jenze kdyz ono to jaksi nefunguje :(
#!/usr/bin/perl print "ahoj";jenom je blby ze ted jsem si nainstaloval distribucni apache pomoci instalatoru a furt ta sama chyba (jako u meho kompilovaneho :( shutdown jsem prozatim nezkousel, zkousel jsem si spustit treba gimp, nebo tak (proste neco pro normalniho usera) ale nejde vubec nic :( prava resp vlastnika jsem zkousel apache, roota a usera ale furt to stejne (na adresar s cgi scripty)
#!/usr/bin/perl print "Content-type: text/plain\n\n"; print "Hello World!";
Tiskni
Sdílej:
ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.