Monday 24 December 2012

Apache Webserver For Multi Dir

As per ubuntu:

amitmund@amitmundlaptop:/etc/apache2/conf.d$ cat svn.conf
# Uncomment this to add an alias.
# This does not work properly with virtual hosts..
Alias /svn /home/svn

<Directory /home/svn/>
     Options +FollowSymLinks
    Options  Indexes                              -> for seeing the directory structures.
    AllowOverride All
    order allow,deny
    allow from all
</Directory>

and at the browser -> http://localhost/svn   [ this will display all the directory too ]   in this way you can export any differ part of the directory, [ some time you might need to check for the file permission or the ownership ]

if you remove Options Indexes then it will search for web page files and will not display directory structure.

Getting Another Error ?Apache give 13 permission denied error messages when we try to access the site via a web browser.
ANS: All the parent directories should have read and execute permission: [ chmod 755 /all/parent/directories ]
Test with the www-data should be owned or not.

Another example:
amitmund@amitmundlaptop:/etc/apache2/conf.d$ cat mediawiki.conf
# Uncomment this to add an alias.
# This does not work properly with virtual hosts..
Alias /mediawiki /var/lib/mediawiki

<Directory /var/lib/mediawiki/>
    Options +FollowSymLinks
    AllowOverride All
    order allow,deny
    allow from all
</Directory>

# some directories must be protected
<Directory /var/lib/mediawiki/config>
    Options -FollowSymLinks
    AllowOverride None
</Directory>
<Directory /var/lib/mediawiki/upload>
    Options -FollowSymLinks
    AllowOverride None
</Directory>


For redhat, check if the selinux have correct permission?

Related help url:
http://stackoverflow.com/questions/1225594/apache-13-permission-denied-in-users-home-directory


No comments:

Post a Comment