apache configuration

4 views
Skip to first unread message

dhanesh arole

unread,
Nov 3, 2012, 5:49:06 PM11/3/12
to cof...@googlegroups.com
Hi all folks , I need to configure an apache server in a way that it wont allow any url ending with ' / ' . This is to avoid access of users in entire web directory.
One of options I was thinking about is to include index page in each directory so it will display that message for such '/' ending addresses. what this technique of authentication called so that I can google it .

--
davcDhanesh
 

shravan aras

unread,
Nov 7, 2012, 9:36:56 PM11/7/12
to cof...@googlegroups.com
Well you could go add index.html files in all directories or you could do it faster by just modifying your apache configuration files.

Goto your site-enabled folder in apache, typically located at /etc/apache2/sites-enabled/
or you can just use the locate command in linux to find it.
Next open your default configuration file from the sites-enabled folder, generally it should just be 000-default.

This file is structured just like any other xml file. Each directory tag inside the virtualhost tag describes a directory to which the rules should be applied. 

In order to stop directory listing for the complete server name space just add

Options -Indexes 

to the <directory /var/www> tag. In all probability you will already have an Options tag, so just append -Indexes to it.

Alternatively you may also add it to <directory /> tag provided you have defined your documentroot as /var/www

You will need to restart your apache server for the changes to take effect.

Another method is to add 

Options -Indexes 

to your .htaccess file if you don't want to modify apache config files. However you need to have 
AllowOverride All 
declared in your apache config file for that to take effect. 
I would suggest you use the first approach, you can also google up the .htaccess approach if you want.

Thanks,
-shravan




--
davcDhanesh
 

--
You received this message because you are subscribed to the Google Groups "CoFSUG" group.
To post to this group, send an email to cof...@googlegroups.com.
To unsubscribe from this group, send email to cofsug+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/cofsug?hl=en-GB.



--
Shravan Aras.
(http://www.kushraho.com)
Reply all
Reply to author
Forward
0 new messages