Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 279
  • Last Modified:

Aliases in apache

Hi All,

I'm busy creating a software depot on our intranet. basically it's a site where people within the company can browse for software for various platforms, and download. I want to create an alias in my virtual server.

The documentroot for my server is /var/www/html/software
The alias I want to set up is:

Alias /downloads/ "/var/www/downloads/"

Thought when I try to follow a link such as
http://intranet.mycompany.com/downloads/mysoftware.zip

I get an error about no permission. Is this because the alias points somwhere "below" my documentroot, or is there something else I need to add to the httpd.conf ?
0
jnbkze
Asked:
jnbkze
  • 3
  • 3
1 Solution
 
PCBackupCommented:
This is probably due to the directory /var/www/downloads belonging to a priviliged account.  It should be accessible to the apache program, which requires that it belong to a non-privileged user (non-root on a unix box).  If you created it when logged on as an administrative user, then you probably just need to reassign the ownership to the apache program user, whatever that is on your box.

Gene
0
 
jnbkzeAuthor Commented:
The permissions are rwxrwxrwx for that directory
0
 
PCBackupCommented:
Opening up permissions is much more dangerous than just reassigning the directory to the apache user identity.  Giving everyone full access is not a good practice.

Gene
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
jnbkzeAuthor Commented:
Hi Gene,

Agreed - it was for testing purposes only. Thing is - it still doesn't resolve my problem.
0
 
PCBackupCommented:
Do you have a <Location> block after the alias to specify the web access functions available?  For instance, if the default access for a web visitor is NONE because of where the directory is located, then you need to override it with something like the following...

    Alias /downloads /var/www/downloads/
    <Location /downloads>
      AllowOverride None
      Options All
      Order allow,deny
      Allow from all
    </Location>

Since it sounds like your directory is outside the base document tree, this might be necessary to give the web visitor access to the contents.  The "Allow from all" line specifies that anyone can access this directory's contents from any remote location.

Gene
0
 
jnbkzeAuthor Commented:
Hi Gene,

Yip that's exactly what I was looking for!
the </location> tags in the conf file made all the difference

Thanks again.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now