[mdlug] Apache and Config for files outside of www dir

Dr. Robert Meier list1c30fe42 at bellsouth.net
Wed Aug 25 18:23:06 EDT 2010


Rich, Evan, Greg, ...

>> On Aug 25, 2010 8:35 AM, "Evan Carew" <elcarew at sbcglobal.net> wrote:
>>> Much like the originator of this thread,
>>> I wanted to do web development outside of /var/www,
>>> in this case, my /home/me/Projects directory.
>>> I was under the impression that I could use soft links, or aliases, but nothing worked.

Symlink references cannot be integrity checked directly by apache
(The file name "/home/projects" and the delivered content can be
checked but not the intermediate contents.).

Consequently apache won't follow symlinks by default.

In concert with other features "Options FollowSymlinks" can direct the
server to use symlinks.

	---- /etc/apache2/httpd.conf.local ----
...
# Prepared Presentations
Alias /presentations/ "/home/presenter/presentations/speeches/"

<Directory "/home/presenter/presentations/speeches">
 Options Indexes MultiViews FollowSymLinks
 AllowOverride None
 Order allow,deny
 Allow from all
</Directory>
...
	---- /etc/apache2/httpd.conf.local ----

Alias <string-to-match> <replacement-string>
  - operates on URIs given to server
  - / leading and trailing / restrict match to a hierarchy
<Directory ...>
  - identifies namespace scope to which overrides are to be applied
Options ...
  - changes to apply in given scope
Indexes
  - if URI maps to a directory
  - and there is no index page (e.g. index.html)
  - return a virtual index page
  - rather than refuse delivery (i.e. apache default)
  - or return entire directory (HTML standard)
MultiViews
  - return page in requesters choice of format
  - (e.g. convert picture.gif file in directory to jpeg
     if URI is .../picture.jpg)
FollowSymLinks
  - chain access along soft links (i.e. normal unix behavior)
AllowOverride None
  - terminate change application chain for this scope
  - (i.e. ignore .htacces, etc. in directory)
Order allow,deny
  - expand by allow before restricting deny
Allow from all
  - deliver to any requester

See http://httpd.apache.org/docs/2.0/sections.html for further details.

>>>> You may need to tweak some of the directives in the
>>> <Directory></Directory> block, but that should be a relatively
>>> straightforward method of doing what you are trying to do.

Hopefully helpful,
--
Bob



More information about the mdlug mailing list