2

I am trying to reference my libs directory which is a sibling directory to my DocumentRoot.

I am using the following ScriptAlias to try to accomplish this.

ScriptAlias /libs/ "../libs"

But when I go to example.com/libs/ I get a the following error

Forbidden
You don't have permission to access /libs/ on this server

I am able to view the libs directory using the following configuration so I don't think it's a file permission error.

<VirtualHost *>
    ServerName example.com
    ServerAlias www.example.com
    DocumentRoot C:/www/libs
<VirtualHost *>

More relevant httpd.cong setting below

<Directory />
    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all
</Directory>
<Directory "C:/www">
    Options Indexes FollowSymLinks
    AllowOverride None
    Order Deny,Allow
    Deny from none
    Allow from all
</Directory>
NameVirtualHost *
<VirtualHost *>
    ServerName example.com
    ServerAlias www.example.com
    DocumentRoot C:/www/example
    ScriptAlias /libs/ "../libs"
    <Directory "C:/www/libs">
        Options Indexes FollowSymLinks
        AllowOverride None
        Options +ExecCGI
        Order Deny,Allow
        Deny from none
        Allow from all
    </Directory>
</VirtualHost>

1 Answer 1

1

The following is conflicting with each other:

ScriptAlias /libs/ "../libs"
<Directory "C:/www/libs">
    ...
    ...
    Options +ExecCGI
    ...
    ...
    ...
</Directory>

See this link: http://httpd.apache.org/docs/2.0/mod/mod_alias.html#scriptalias

Both instructions are basically the same thing, except that you're missing the SetHandler line in Directory.

Try removing the Options line, or adding the SetHandler line in your Directory block and changing ScriptAlias for Alias...

1
  • 1
    Thanks for the reference. Looks like I needed to use Alias and not ScriptAlias as I am trying to serve up static content.
    – sissonb
    Mar 19, 2012 at 1:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .