CentOS 6.2 disable httpd autoindex
I am trying to disable the Auto index of directories in the apache config. <VirtualHost *:80> ServerName example.com ServerAlias www.example.com example.co.uk www.example.co.uk DocumentRoot /var/www/sites/example.com/public ErrorLog /var/log/httpd/error.log CustomLog /var/log/httpd/access.log combined Options -Indexes </VirtualHost> Will putting Options -Indexes into the VirtualHost configuration disable autoindex in these directories? Asked by Alex Yes, by putting in Options -Indexes you disable autoindex for the entire VirtualHost. You can read about it in the Apache Core Features documentation if you would [...]
Continue Reading »cPanel & DirectoryIndex – server default page showing for domain root
I’m pretty sure that I have a very trivial problem and that lots of you guys have answered this kind of question a thousand times. But I just can’t find any of these answers. So here we go. I am managing a hosting account via cPanel. But for some reason trying to access the website’s index file by just typing in the domain name (e.g. www.mydomain.com) always shows the cPanel default page (i.e. www.mydomain.com/cgi-sys/defaultwebpage.cgi). The [...]
Continue Reading »How can I see my DirectoryIndex order on a shared web server?
How can I view the default DirectoryIndex order? Is there a command I can run? I’m on a shared web server so I can’t view the configuration file. Is the default documented anywhere? My Google-fu is failing today. Thanks in advance. The default value is documented here: http://httpd.apache.org/docs/2.0/mod/mod_dir.html#directoryindex But, distributions may also provide their own defaults. For instance, Ubuntu 10.04 LTS has the following default: DirectoryIndex index.html index.cgi index.pl index.php index.xhtml index.htm (specified in /etc/apache2/mods-enabled/dir.conf) [...]
Continue Reading »Get nginx to always load /webdir/page.php on directories if no index.html page
So i’v been trying out some of the config options in http://wiki.nginx.org/NginxHttpCoreModule with no luck so far. What I want is, if someone goes to ’10.10.10.1/test/’ that it loads the file ‘/webdir/page.php’ (not to redirect them, but to keep them at ’10.10.10.1/test/’, but load the php page. I don’t really want to re-compile with http://github.com/blueyed/nginx-fancyindex#example since it isn’t really what im after, I want to build my own custom directory index in php. I had [...]
Continue Reading »apache2: Options +Indexes ignored
since the configuration of apache 2 has been split into several files instead of http.conf, I can’t get directory listing working. I already found such a question, but it didn’t fit to my problem: http://serverfault.com/questions/70455/why-is-apache-ignoring-the-options-indexes-directive I’m using Ubuntu 10.04 with Apache/2.2.14 and I already looked for these possibilities: Apache can read its directory root no .htaccess in directory root The listing of other directories is working. Only the root directory can not be listed. There [...]
Continue Reading »Changing default Apache page for a virtual host to a mod_autoindex generated listing
I have the following virtual host in my Apache configuration: <VirtualHost *:80> ServerName foobarspaz DocumentRoot “/path/to/document/root” </VirtualHost> There is no index.html file in the document root directory so accessing http://foobarspaz serves up the default Apache test page for my server. I’d like it instead to serve up a mod_autoindex generated directory listing of the document root instead of the default page. How would I go about this? (I’m not exactly sure how to go about [...]
Continue Reading »Disable directory listings with 404 instead of 403
I’ve disabled directory listings like so… Options -Indexes When I try and access a directory like this:- www.example.com/secret/ I get a 403 Forbidden response. However, I want a 404 Not Found response, so hackers can’t guess my directory structure so easily. How would I do that? Enable mod_rewrite and AllowOverride in /secret. Then create .htaccess: RewriteEngine On RewriteBase /secret RewriteRule ^$ – [R=404,L] Check more discussion of this question. Bookmark on Delicious Digg this post [...]
Continue Reading »Change default ReadmeName in Apache
How do I change the default ReadmeName for Apache directory indexes? I have a readme file in the root of my site example.com/README.html which I want to display as the readme file for Apache directory indexes unless the directory has it’s own README.html file. Is this possible? Example; With the directory structure -/ -/folder1/ -/folder1/README.html -/folder2/ -/README.html example.com/ should display example.com/README.html in it’s directory index, example.com/folder1/ should display example.com/folder1/README.html, example.com/folder2/ should display example.com/README.html I can [...]
Continue Reading »


