I have noticed that I have the following lines in apache2.conf (on ubuntu 14.04):

<Directory /usr/share>
        AllowOverride None
        Require all granted
</Directory>

And the reason for this is written as:

not allow access to the root filesystem outside of /usr/share and /var/www. The former is used by web applications packaged in Debian, the latter may be used for local directories served by the web server.

But this tells me absolutely nothing. Can someone explain in a plain English why do I need to grant access to this folder.

up vote 7 down vote accepted

if you are not using web applications which are packaged with your OS (or you install to that location) you can safely ignore it.

Examples of stuff which might be there though would include common PHP libraries (like ADODB etc), frameworks like Zend, programs like Cacti, Nagios, Cups etc may all be there.

There is, of-course, no harm in commenting this code out if you don't think your application uses it, and add it back if you get errors in your log of the nature that it can't read files there.

/usr/share is, as the quoted passage says, "used by web applications packaged in Debian."

If you install, say, Wordpress from an apt repository, it will be installed into /usr/share.

If that's still not plain English enough, we'll need more detail about what part of it you're understanding and what part of it you're not.

  • I do not understand whether I need to grant permissions for this folder if I am rolling out my own project. The only thing I have installed from apt (related to this project) is the mongo database. – Salvador Dali Sep 10 '14 at 6:46

Additional information to the answer of davidgo:

You might want to grant access only from your local server, so configure it like the following:

<Directory "/usr/share/doc/">
    Options Indexes MultiViews FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all
    Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.