[solved] Auto Index not working

#1
Hi,

lsws 4.1.10
CentOS release 6.2 (Final)

I am getting an error when 'Options +Indexes' is enabled in a directory's .htaccess file. Litespeed is returning a 'Content-Type: handler/x-httpd-php', which triggers the browser to try and download the file.

How can we get litespeed to create the auto index page properly?

Thank you,
 
Last edited by a moderator:

webizen

Well-Known Member
#3
is this native lsws vhost or apache vhost?

you can try followings and see if your issue goes away.
1. force reinstall 4.1.10
or
2. upgrade to 4.1.11
 
#4
is this native lsws vhost or apache vhost?

you can try followings and see if your issue goes away.
1. force reinstall 4.1.10
or
2. upgrade to 4.1.11
We're using apache vhost. Auto Index is set to "Yes" in litespeed config. Unfortunately force reinstall didn't work, and I don't see a 4.1.11 available. (we're running enterprise)
 
#7
I'm a co-worker of sophrosyne. The 4.1.11 update did not fix the issue, though now instead of the incorrect content type we just get a 404 from litespeed. Here is a (anonymized) snippet of the logs from 4.1.11 with the 404:
http://pastebin.com/2N7CxdAK
The request was for http://example.com/docs/ which points at /home/username/example.com/html/docs/ . There is a .htaccess file in that directory containing (only) "Options +Indexes". It also seems to make no difference if we have the Auto-Index setting set to "Yes" or "Not Set".
 
#9
Sorry for the confusion, the 404 error was caused by a change the client made to their htaccess file (and the AllowOverride None line). I setup a small test case so that doesn't happen again and it looks like the "Content-type: handler/x-httpd-php" issue is still occuring in 4.1.11 . Here is another snippet of the log from a response with the wrong content-type header:
http://pastebin.com/kH171g3T

And the curl request that generated it:
http://pastebin.com/cMXLvujy
 
#11
Adding "AddType application/x-httpd-php .php" to the .htaccess file made no difference. Also, requests for regular PHP files (like example.com/ai-test/test.php) work fine, as in they are properly run through PHP, even without the AddType line. It's just the auto-index script builtin to LS that has this problem. Additionally, the "Content-Type: handler/x-httpd-php" header is causing the browser to throw up a file download prompt but I think we forgot to mention that the contents of that file are the un-interpreted auto-index PHP script.
 

webizen

Well-Known Member
#12
You have this in your vhost conf. That's why suggest earlier to add "AddType application/x-httpd-php .php" in .htaccess to override it.
2012-03-06 11:36:53.727 [DEBUG] [/etc/httpd/conf.d/vhost_example.com.conf:34] processing direcitve: AddHandler x-httpd-php .php
Are you saying http://example.com/ai-test/test.php is ok (php serves) but http://example.com/ai-test/ (default.php) is not? Comment out the "AddHandler" pointed out above and see any difference.
 
#15
While setting up a test environment to give your root access we discovered that it was a problem with our configuration. For future reference, the issue was that these lines were missing from the apache config files (loaded by Litespeed of course):
AddHandler php5-script .php
AddType text/html .php
 
Top