Readers: 6
|< 1 2 3 4 5 6 >| | 54 entries, 6 pages |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
DocumentRoot "/home/user"
<Directory "/home/user/">
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs-2.2/mod/core.html#options
# for more information.
Options None
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
AllowOverride None
# Controls who can get stuff from this server.
Order allow,deny
Allow from all
</Directory>
ScriptAlias /cgi-bin/ "/srv/www/cgi-bin/"
# "/srv/www/cgi-bin" should be changed to whatever your ScriptAliased
# CGI directory exists, if you have that configured.
#
<Directory /home/*/public_html/cgi-bin>
Options ExecCGI
SetHandler cgi-script
</Directory>
Rechte mit chmod 755 skript.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/perl
use strict;
use warnings;
use HTML::Template::Compiled; # musst du wahrscheinlich noch installieren
use File::Find;
use CGI;
my @files;
find( \&wanted, '/home/user' );
my $cgih = new CGI;
print $cgih->header();
my $content = do{ local $/; <DATA> };
my $tmpl = HTML::Template::Compiled->new( scalarref => \$content );
my @links = map{ {HREF => $_, TITLE => $_ } }@files;
$tmpl->param( LINKS => \@links );
print $tmpl->output;
sub wanted{
push @files, $_ if /\.pdf$/;
}
__DATA__
<html>
<body>
<ul>
<%LOOP LINKS %><li><a href="<%= HREF ESCAPE=URL %>"><%= TITLE ESCAPE=HTML %></a></li>
<%/LOOP %>
</ul>
</body>
</html>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#! /usr/bin/perl -w
eval 'exec /usr/bin/perl -S $0 ${1+"$@"}'
if 0; #$running_under_some_shell
use strict;
use File::Find ();
# Set the variable $File::Find::dont_use_nlink if you're using AFS,
# since AFS cheats.
# for the convenience of &wanted calls, including -eval statements:
use vars qw/*name *dir *prune/;
*name = *File::Find::name;
*dir = *File::Find::dir;
*prune = *File::Find::prune;
sub wanted;
# Traverse desired filesystems
Danke
File::Find::find({wanted => \&wanted}, '/home/user');
exit;
sub wanted {
/^.*\.pdf\z/s &&
print("$name\n");
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
DocumentRoot "/srv/www/htdocs"
#
# Configure the DocumentRoot
#
<Directory "/srv/www/htdocs">
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs-2.2/mod/core.html#options
# for more information.
Options None
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
AllowOverride None
# Controls who can get stuff from this server.
Order allow,deny
Allow from all
</Directory>
ScriptAlias /cgi-bin/ "/srv/www/cgi-bin/"
# "/srv/www/cgi-bin" should be changed to whatever your ScriptAliased
# CGI directory exists, if you have that configured.
#
<Directory "/srv/www/cgi-bin">
AllowOverride None
Options +ExecCGI -Includes
Order allow,deny
Allow from all
</Directory>
1
2
3
4
5
6
7
8
9
Objekt nicht gefunden!
Der angeforderte URL konnte auf dem Server nicht gefunden werden. Der Link auf der verweisenden Seite scheint falsch oder nicht mehr aktuell zu sein. Bitte informieren Sie den Autor dieser Seite über den Fehler.
Sofern Sie dies für eine Fehlfunktion des Servers halten, informieren Sie bitte den Webmaster hierüber.
Error 404
localhost
Sun Oct 28 15:14:13 2007
Apache/2.2.3 (Linux/SUSE)
http://localhost/cgi-bin/Datei.pdf
my @links = map{ {HREF => $_, TITLE => $_ } }@files;
my @links = map{ {HREF => '/' . $_, TITLE => $_ } }@files;
|< 1 2 3 4 5 6 >| | 54 entries, 6 pages |