Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.debian.user > #180562 > unrolled thread
| Started by | Gene Heskett <gheskett@shentel.net> |
|---|---|
| First post | 2017-05-01 02:30 +0200 |
| Last post | 2017-05-01 19:20 +0200 |
| Articles | 5 — 4 participants |
Back to article view | Back to linux.debian.user
index.html Gene Heskett <gheskett@shentel.net> - 2017-05-01 02:30 +0200
Re: index.html Tony Baldwin <tonybaldwin@gmx.com> - 2017-05-01 18:00 +0200
Re: index.html Greg Wooledge <wooledg@eeg.ccf.org> - 2017-05-01 18:20 +0200
Re: index.html <tomas@tuxteam.de> - 2017-05-01 18:30 +0200
Re: index.html Gene Heskett <gheskett@shentel.net> - 2017-05-01 19:20 +0200
| From | Gene Heskett <gheskett@shentel.net> |
|---|---|
| Date | 2017-05-01 02:30 +0200 |
| Subject | index.html |
| Message-ID | <tC7nX-1Ja-1@gated-at.bofh.it> |
Greetings; Imagine my surprise when I looked at /var/www/html/index.html, and found that somehow, it was native to a PCLos install I was running half a decade or more ago! Now, do we have a script that will rebuild a new index.html for the defined root of the server, and which WILL access the /var/www/html/gene directory? This should restore the whole site to http compatibility. Right now, with out without that file, the subdir "gene" isn't accessible. Cannot be found is the message. Cheers, Gene Heskett -- "There are four boxes to be used in defense of liberty: soap, ballot, jury, and ammo. Please use in that order." -Ed Howdershelt (Author) Genes Web page <http://geneslinuxbox.net:6309/gene>
[toc] | [next] | [standalone]
| From | Tony Baldwin <tonybaldwin@gmx.com> |
|---|---|
| Date | 2017-05-01 18:00 +0200 |
| Message-ID | <tClTY-2yI-9@gated-at.bofh.it> |
| In reply to | #180562 |
On 04/30/2017 08:26 PM, Gene Heskett wrote:
> Greetings;
>
> Imagine my surprise when I looked at /var/www/html/index.html,
> and found that somehow, it was native to a PCLos install I was running
> half a decade or more ago!
>
> Now, do we have a script that will rebuild a new index.html for the
> defined root of the server, and which WILL access the /var/www/html/gene
> directory? This should restore the whole site to http compatibility.
>
> Right now, with out without that file, the subdir "gene" isn't
> accessible. Cannot be found is the message.
>
> Cheers, Gene Heskett
>
nope. You've got to write or create your own index, unless you install
something that generates one, such as dokuwiki, or wordpress, or any of
a myriad of other CMS, (micro)blogging, social networking, or wiki
platforms, forums or gallerys...the possibilities are nearly endless.
If you just want to list the directories contents, try putting in an
index.php with something like this in it:
<html>
<body>
<ul>
<?php
// loop through files and list them
$path = "/var/www/html/gene/";
$dir_handle = @opendir($path) or die("Unable to open $path");
while ($file = readdir($dir_handle)) {
if($file == "." || $file == ".." || $file == "index.php" ||
$file == "private" || $file == ".htaccess" || $file == "robots.txt" ||
$file == ".index.php.swp" )
continue;
echo "<li><a href=\"$file\">$file</a></li>";
}
closedir($dir_handle);
?>
</ul>
</body>
</html>
You'll have to have php5 or better installed.
This is essentially how I built http://tonybaldwin.me/pages/
and various other pages on my site, including
http://tonybaldwin.me/images/
only that has
$path = "/path/to/www/images/";
....
<p><a href=\"$file\" target=\"_new\"><img src=\"$file\"
style=\"max-width:200px;\"><br />$file</a>
because that dir is full of images, so I have the index show a
thumbnail, linking to the larger image.
tony
--
http://tonybaldwin.me
all tony, all the time
[toc] | [prev] | [next] | [standalone]
| From | Greg Wooledge <wooledg@eeg.ccf.org> |
|---|---|
| Date | 2017-05-01 18:20 +0200 |
| Message-ID | <tCmdk-2Ui-15@gated-at.bofh.it> |
| In reply to | #180577 |
On Mon, May 01, 2017 at 11:55:49AM -0400, Tony Baldwin wrote: > If you just want to list the directories contents, try putting in an > index.php with something like this in it: Or remove all of index.php, index.html and index.htm, and make sure you've turned on the "Indexes" option for this directory in the Apache config. Then Apache will simply generate a directory index page for you, and you don't need to write a PHP program.
[toc] | [prev] | [next] | [standalone]
| From | <tomas@tuxteam.de> |
|---|---|
| Date | 2017-05-01 18:30 +0200 |
| Message-ID | <tCmn0-2Xx-23@gated-at.bofh.it> |
| In reply to | #180577 |
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Mon, May 01, 2017 at 11:55:49AM -0400, Tony Baldwin wrote: > > On 04/30/2017 08:26 PM, Gene Heskett wrote: > >Greetings; > > > >Imagine my surprise when I looked at /var/www/html/index.html, > >and found that somehow, it was native to a PCLos install I was running > >half a decade or more ago! > > > >Now, do we have a script that will rebuild a new index.html for the > >defined root of the server, and which WILL access the /var/www/html/gene > >directory? This should restore the whole site to http compatibility. > > > >Right now, with out without that file, the subdir "gene" isn't > >accessible. Cannot be found is the message. > > > >Cheers, Gene Heskett > > > > nope. You've got to write or create your own index, unless you > install something that generates one, such as dokuwiki, or > wordpress, or any of a myriad of other CMS, (micro)blogging, social > networking, or wiki platforms, forums or gallerys...the > possibilities are nearly endless. > > If you just want to list the directories contents, try putting in an > index.php with something like this in it [...] Or there is the Options +Indexes for the Apache config [1]. You can fine-tune how the index itself is rendered via the IndexOptions directive [2]. This would be a more lightweight, yet less flexible approach. Note that you'll have to make sure that your clients don't see things you don't want them to see (but this applies even more strongly to a scripting solution, like the PHP example offered) regards [1] https://httpd.apache.org/docs/2.2/mod/core.html#options [2] https://httpd.apache.org/docs/2.2/mod/mod_autoindex.html#indexoptions - -- tomás -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iEYEARECAAYFAlkHYRsACgkQBcgs9XrR2kb4nQCdHtUVN0AbRUmh7CkbLyHKeVxf QbEAnAroaZ3MhCFoEv82gzsDUhFSGL4v =37ag -----END PGP SIGNATURE-----
[toc] | [prev] | [next] | [standalone]
| From | Gene Heskett <gheskett@shentel.net> |
|---|---|
| Date | 2017-05-01 19:20 +0200 |
| Message-ID | <tCn9o-3uH-19@gated-at.bofh.it> |
| In reply to | #180577 |
On Monday 01 May 2017 11:55:49 Tony Baldwin wrote:
> On 04/30/2017 08:26 PM, Gene Heskett wrote:
> > Greetings;
> >
> > Imagine my surprise when I looked at /var/www/html/index.html,
> > and found that somehow, it was native to a PCLos install I was
> > running half a decade or more ago!
> >
> > Now, do we have a script that will rebuild a new index.html for the
> > defined root of the server, and which WILL access the
> > /var/www/html/gene directory? This should restore the whole site to
> > http compatibility.
> >
> > Right now, with out without that file, the subdir "gene" isn't
> > accessible. Cannot be found is the message.
> >
> > Cheers, Gene Heskett
>
> nope. You've got to write or create your own index, unless you install
> something that generates one, such as dokuwiki, or wordpress, or any
> of a myriad of other CMS, (micro)blogging, social networking, or wiki
> platforms, forums or gallerys...the possibilities are nearly endless.
>
> If you just want to list the directories contents, try putting in an
> index.php with something like this in it:
>
> <html>
> <body>
> <ul>
> <?php
> // loop through files and list them
>
> $path = "/var/www/html/gene/";
>
> $dir_handle = @opendir($path) or die("Unable to open $path");
>
> while ($file = readdir($dir_handle)) {
>
> if($file == "." || $file == ".." || $file == "index.php" ||
> $file == "private" || $file == ".htaccess" || $file == "robots.txt" ||
> $file == ".index.php.swp" )
>
> continue;
>
> echo "<li><a href=\"$file\">$file</a></li>";
>
> }
>
> closedir($dir_handle);
> ?>
> </ul>
> </body>
> </html>
>
>
> You'll have to have php5 or better installed.
My web site is very simple, text and pix. So this 82 yo old fart can
usually maintain it himself. No php, no databasie stuff at all.
The closest to high level stuff is that the pix galleries were created
using jigl, so when you visit one of those pages, you get a screenfull
of thumbnails, clicking on one of them brings up a pretty compressed but
full screen image. Clicking on many of those a second time will get you
the original, straight out of the camera version of that image. Those
directories with mixed text & images are presented as a directory
listing, but you can click on an image and get it, or .pdf's and such
are offered for downloading when clicking on the directory entry.
Its a pretty "stable" site. If I add something, the link gets posted on
the mailing list that applies so folks interested in one of my cnc
machines will know about it, but I don't take out adds in the paper
about it.
> This is essentially how I built http://tonybaldwin.me/pages/
> and various other pages on my site, including
> http://tonybaldwin.me/images/
> only that has
> $path = "/path/to/www/images/";
>
> ....
> <p><a href=\"$file\" target=\"_new\"><img src=\"$file\"
> style=\"max-width:200px;\"><br />$file</a>
> because that dir is full of images, so I have the index show a
> thumbnail, linking to the larger image.
>
>
> tony
Cheers, Gene Heskett
--
"There are four boxes to be used in defense of liberty:
soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Genes Web page <http://geneslinuxbox.net:6309/gene>
[toc] | [prev] | [standalone]
Back to top | Article view | linux.debian.user
csiph-web