The content of the top-level server directory is publicly available by the web, e.g. files like example.com/readme.txt are readable.
Is it normal? How can i disable this?
(apache, ubuntu 12.04)
Drupal Answers is a question and answer site for Drupal developers and administrators. It only takes a minute to sign up.
Sign up to join this communityIt is not normal. Test if your .htaccess file is there, and looks the same as one in the fresh copy downloaded from Drupal.org - if they are different, use the stock one.
If your .htaccess file is identical to the stock one, you need to make your Apache to respect this part:
# Protect files and directories from prying eyes.
<FilesMatch "\.(engine|inc|info|install|make|module|profile|test|po|sh|.*sql|theme|tpl(\.php)?|xtmpl)(|~|\.sw[op]|\.bak|\.orig|\.save)?$|^(\..*|Entries.*|Repository|Root|Tag|Template)$|^#.*#$|\.php(~|\.sw[op]|\.bak|\.orig\.save)$">
Order allow,deny
</FilesMatch>
How exactly you should do it would be off topic here, but may be asked on Ask Ubuntu.
Note that while default .htaccess protect most extensions you don't want served, it does not hide txt files you explicitly asked for. So just add that extension to the list, as you can see, it's pretty straightforward.
This will block txt files from all directories, except sites/*/files, that have separate .htaccess files, with their own rules of access (since 7.22). If you don't want to serve core's readme.txt, then you probably don't want to serve modules' readme.txt too.
As I understood - you want to hide the txt files on the root direcroty (e.g. Changlog.txt) from prying eyes, therefore you can search Drupal.org for that question (its there..), and you'll see 3 types of solutions:
1. Leave those file as they are ( I don't like that option)
2. Just delete those files
3. Hide them using the site's .htaccess (My favorite option)