Index customisation LightSpeeds emulation of Apache's mod_autoindex doesn't work properly any more

#1
Hi,

Until my webhost (ventraip.com.au) updated their software (this is many months ago, probably well over a year), I used to be able to customise directory listings exactly the same as when I used Apache. Now, that no-longer works properly (so Lightspeed is no-longer a "drop in replacement for Apache" since it doesn't behave the same), and they seem unable to do anything about this. I've wasted many hours of my time trying to get something working again that used to work, for a couple of decades, in Apache webservers.

Previously I uploaded HEADER.html and/or README.html files into directories to include some HTML content above and/or below the directory listing, and that HTML content was inserted into the page as expected. I could incorporate instructions into the page for people to follow, even write links. Now, the webserver is parsing that HTML and escaping all the less-then, greater-than, ampersands and quotes. So instead of rendered HTML, they see what looks like raw source code, all jumbled together in one huge lump.

This turns what I might have typed into my HEADER.html as:
<p>Check the <a href="change-log.html">change log</a> for recent updates.</p>
where they can read that and click on a link to what might be a page buried in a complex directory.

Into this incomprehensible, to anyone but a HTML author, mess:
&;ltp&gt;Check the &lt;a href=&quot;change-log.html&quot;&gt;change log&lt;/a&gt;
Which appears exactly like that garbage in the web browser, and is obviously no-longer a clickable link.

Even just putting plain text into one of those files is a mess. One line or two of text is readable, but no HTML links can be used, and if I wanted to write two paragraphs of text it will be just one huge block of unformattable text.

I was steered in the direction of trying to do it the LightSpeed way instead (which I don't want to have to to), with this info:
https://www.litespeedtech.com/suppo...nfig:autoindex#how_lsws_implements_auto_index

But that doesn't work either. No amount of putting "_autoindex" directories anywhere in my directory paths (inside or outside the public_html directory) allows me to put a PHP file in that could be used to create a custom directory listing page.

Bye,
Tim.
 

serpent_driver

Well-Known Member
#2
Would you provide us with a little bit more information about your "custom" directory listing? Do you set any configuration in your .htaccess or what exactly did you do?
 
#3
Hi,

I'll paste in the exact contents of some simple tests:

.htaccess file (it only has this one line in it):
Options +Indexes

HEADER.html file (it only has this one line in it):
<p>This is a test paragraph <a href="test-file.html">with a link in it</a>.&nbsp; This is the HEADER.html file that should appear above a directory
listing.</p>

README.html file (it only has this one line in it):
<p>This is a test paragraph <a href="test-file.html">with a link in it</a>.&nbsp; This is the README.html file that should appear below a directory
listing.</p>

This is what the Lightspeed server does to them:
http://www.cameratim.com/test2/

And a screenshot of it:


Screenshot at 2022-06-26 17-04-39.png

Oddly, if I do the same kind of thing with other directories, directories also get a filter window inserted above the directory listing. I've done nothing extra to make that happen. I wonder if it counts the number of files in the directory, and adds it after a certain trigger point. As far as I'm concerned, that is not a problem, it seems a good idea to me.


Bye,
Tim.
 

serpent_driver

Well-Known Member
#4
It seems your provider has a different configuration with LiteSpeed as with you previous web server. Basically LiteSpeed follows Apache directive for directory listing. If it is different with LiteSpeed you should ask your host provider what he has done or what he has configured different with LiteSpeed.
 
Last edited:
#5
They used to use Apache, got bought out, switched over to LightSpeed. It used work (even on LightSpeed), but that changed some time ago. They claimed to have done nothing, and claim to be able to do nothing about it.

I got directed to look at:

https://www.litespeedtech.com/suppo...nfig:autoindex#how_lsws_implements_auto_index

To try and do the same kind of thing by messing around with PHP. Many hours of wasting my time, to do something that Apache did for 20+ years very simply, and got nowhere. It doesn't matter where I create a _autoindex directory and put a PHP file in it (inside the same directory, inside a parent directory, in the root below public_html), LightSpeed doesn't make any attempt to use it when viewing a directory without a default index file.

We (customers) have very little configuration control of the webserver, beyond putting .htaccess files in and the few things that CPanel let you do. Their suggestion was to change from a $20/month plan to a $300/month plan to get a virtual server.
 

serpent_driver

Well-Known Member
#6
I can only repeat me, LiteSpeed follows Apache directive. If you think it doesn't, study Apache configuration and try to find find out what has to be done to get the same behaviour with LiteSpeed. If your provider says they have done nothing different you can believe it or not. And of course with shared hosting you have almost no possibilities to configure your custom need, but to pay $300 for a virtual hosting is a cheekiness.

Please don't forget, cPanel can also have influence. It is not the first time when cPanel has a different thinking about what is a correct configuration as LiteSpeed has it. There are many examples for it. The problem is, you (as customer) will always loose.
 
#7
I've been using Apache, directly on our LAN servers for around 20 years. For the WWW I've always used external servers. I can't find any way to make Apache misbehave like their servers are doing. There's no option to make it parse the HEADER.html file into something else before serving it in the middle of the autoindex page.

There's little options in CPanel beyond allow/disallow directory browsing, no setting regarding how to render it. I'm tending to believe the problem *is* caused by how they've configured things. I can't even use the HeaderName directive in the .htaccess file, it always looks for HEADER.html

I'm weighing up creating a CGI script to completly generate the index page my way, or dumping them as a host. Trying to find an Australian host that specifies their server software is a bit of a pain. I'd rather stick with Apache (which I run internally), than relearn the wheel with LightSpeed. Not to mention they're also the mail host.
 
Top