SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Addict
    Join Date
    Jan 2012
    Posts
    265
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    alias.conf Questions

    I discovered the alias.conf function by accident. I received a huge database-driven website on a CD from http://www.catalogueoflife.org/ and installed it on my Mac, but it doesn't work - at least not beyond the home page. I don't get any responses from their support e-mail, so I want to try and figure out how to make it work one step at a time.

    The first thing I noticed is there is no index page inside the main folder (col2013/ac). Instead, the default index page is apparently @ col2013ac/public/index.php. I couldn't figure out how they make that internal index page display as the primary home page until I stumbled across a file at col2013ac/alias.conf

    When I type http://col2013ac/ into my browser, this default home page displays properly. (The links don't work, but that's another problem I'll tackle next.) Here's the code from alias.conf...

    Code:
    Alias /col2013ac "/Applications/MAMP/htdocs/col2013ac/public/"
    <Directory "/Applications/MAMP/htdocs/col2013ac/public/">
    Options Indexes MultiViews FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
    </Directory>
    However, I don't want to be glued to my MAMP folder. I want to move this into my Sites folder and learn how to manipulate it. So I copied it into my Sites folder and modified the alias.conf file as follows...

    Code:
    # Location = /Users/davidblomsrom/Sites/col2013ac/alias.conf
    # The two lines below are the original code...
    # Alias /col2013ac "/Applications/MAMP/htdocs/col2013ac/public/"
    # <Directory "/Applications/MAMP/htdocs/col2013ac/public/">
    Alias /Users/MyName/Sites/col2013ac "/Users/MyName/Sites/col2013ac/public/"
    <Directory "/Users/MyName/Sites/col2013ac/public/">
    Options Indexes MultiViews FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
    </Directory>
    But when I try to access the home page for this new site at http://Site, I get this message:

    Forbidden

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

    I can easily work around the problem by simply inserting a page named index.php inside the main folder and inserting a link on that page to /public/index.php. However, I'm intrigued by this alias function and would like learn how to use it.

    Can anyone see any obvious mistakes I'm making? Is it possible it isn't working right because of some other file that also has to be modified?

    Thanks.

  2. #2
    SitePoint Member
    Join Date
    Dec 2009
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This syntax is incorrect:

    Code:
    Alias /Users/MyName/Sites/col2013ac "/Users/MyName/Sites/col2013ac/public/"
    You can't define the actual or full path as an alias. It's like giving a nickname to a specific dir/path, A virtual name so you can access it by http://domain.com/ALIAS-HERE

    Something like:

    Alias /col2013ac "/Users/MyName/Sites/col2013ac/public/" should work.
    Attacker.NET
    Server Management.:.Security Hardening & Much more!
    Certified Information Security Professionals
    E-mail: sales@attacker.net | http://attacker.net


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •