Wednesday, 15 September 2010

Need apache to show unix directory -



Need apache to show unix directory -

i have apache running on unixservera , wish view file on unix [/app1/bea/hello.txt] in browser using url http://unixservera/sg/hello.txt

kindly help changes need create in httpd.conf.

i have included conf file [bulk.conf] in httpd.conf , bulk.conf file has below entry not help.

scriptalias /sg/ "/app1/bea/"

below error see in browser

internal server error server encountered internal error or misconfiguration , unable finish request.

please contact server administrator, user@unixservera , inform them of time error occurred, , might have done may have caused error.

more info error may available in server error log.

error log shows this:

[thu feb 21 04:57:45 2013] [error] (2)no such file or directory: exec of '/appl/bea/hello.txt' failed [thu feb 21 04:57:45 2013] [error] [client 109.71.70.209] premature end of script headers: hello.txt

when utilize scriptalias directive instruct apache handle file within selected directory script or executable file. apache tutorial: dynamic content cgi explains, such script expected generate valid output http response, including http headers. instance, there's printenv.pl sample script bundled apache:

#!/usr/bin/perl ## ## printenv -- demo cgi programme prints environment ## print "content-type: text/plain; charset=iso-8859-1\n\n"; foreach $var (sort(keys(%env))) { $val = $env{$var}; $val =~ s|\n|\\n|g; $val =~ s|"|\\"|g; print "${var}=\"${val}\"\n"; }

as executable file, run console:

./printenv.pl

i don't know hello.txt contains *.txt extension suggests isn't programme @ all. if is programme after all, create sure that:

it prints @ to the lowest degree content-type header plus blank line. it has executable flag: chmod a+x hello.txt

apache

No comments:

Post a Comment