1

I am trying to use nclud's windex to stylise my apache directory listings for an internal project (security isn't too much of a concern)

Windex uses a HeaderName and ReadmeName directive pointing to php files, and it all works so long as the windex php files are in the directory the VirtualHost is being served from.

However, I want to make a standard installation in /usr/share/windex for two reasons. The first is that I don't want the Windex folder to appear in the listings. The second is that I want to use it on more than one virtualhost then modify it for all.

So the .htaccess file stays in my /srv/www directory. In my httpd.conf for the virtualhost I specify an alias:

Alias /windex/ "/usr/share/windex"
<Directory "/windex">
    Options Indexes,FollowSymlinks
    AllowOveride All
    Order Allow,Deny
    Allow from all
</Directory>
<Directory "/usr/share/windex">
    Options Indexes,FollowSymlinks
    AllowOveride All
    Order Allow,Deny
    Allow from all
</Directory>

Now this works for the image and css files in /windex/icons/* and /windex/css/* all styles are applied correctly. However, the php files don't get processed. If, however I browse to the /windex/header.php file, the file is processed by PHP correctly.

Thanks James

James Booker
  • 33
  • 1
  • 5

2 Answers2

0

From Installation notes:

If you'd rather not have the windex folder sitting at the top of your site, you'll need to change the filepaths in config.php, all CSS files, and any .htaccess file derived from main.htaccess

lg.
  • 4,649
  • 3
  • 21
  • 20
  • Unfortunately this doesn't answer my question. All the paths in the htaccess, css and config.php are relative URI paths, rather than filesystem paths, and since I'm making an alias on the /windex path, it should all still work as far as I can tell - the relative paths have not changed – James Booker Jul 30 '10 at 12:24
0

Hi I found the answer. I bumped up error logging in apache and found this:

Fri Jul 30 14:35:31 2010] [error] [client 160.50.3.128] PHP Warning:  require_once(/srv/www/8081/windex/markdown.php): failed to open stream: No such file or directory in /usr/share/windex/config.php on line 84
[Fri Jul 30 14:35:31 2010] [error] [client 160.50.3.128] PHP Fatal error:  require_once(): Failed opening required '/srv/www/8081/windex/markdown.php' (include_path='.:/usr/share/php:/usr/share/pear') in /usr/share/windex/config.php on line 84

I found that the developer was using the following lines to include markdown and textile capability:

require_once( $_SERVER["DOCUMENT_ROOT"]. $windexPath . '/textile.php');

And a similar line further down for markdown.php - this was causing PHP to look in the path '/srv/www/8081/windex/markdown.php' rather than just in the directory where config.php was - I changed the line to:

require_once( 'textile.php');

And now everything is ok. Thanks for trying to help.

James Booker
  • 33
  • 1
  • 5