Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.debian.user > #180577
| From | Tony Baldwin <tonybaldwin@gmx.com> |
|---|---|
| Newsgroups | linux.debian.user |
| Subject | Re: index.html |
| Date | 2017-05-01 18:00 +0200 |
| Message-ID | <tClTY-2yI-9@gated-at.bofh.it> (permalink) |
| References | <tC7nX-1Ja-1@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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
Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
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
csiph-web