Saturday, September 6, 2008

How to add an Apache directory alias in Mac OS X 10.5 (Leopard)

Another point that I spent a lot of time trying to do was to make an Apache directory alias. The first thing that you have to know is that all directories in the path for the target directory must be with at least permission to read. This was the point that I spent more time. I was trying to make an alias to the directory ~/Desktop/quickstart and the Desktop directory had no read permission for group and others, so that was the problem.
  • You have to edit /etc/apache2/users/{username}.conf and add the following lines:
<IfModule alias_Module>
Alias /your_project /Users/{username}/Desktop/your_project
</IfModule>

<Directory "/Users/{username}/Desktop/your_project">
    Options Indexes MultiViews FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
<Directory>

  • Save the file and restart apache server.

7 comments:

Felix said...
This comment has been removed by the author.
Felix said...

Hi,
I could need some help. Edited the felix.conf file to http://codeviewer.org/view/code:1121. I removed the tags because without them I get a 403 error instead of 404.
403 means Permission denied and I don't know how to change the permission correctly:
drwxr-xrwx 4 felix staff 136 15 Aug 18:42 test

I try to access the directory via http://localhost/Drivess

Thank you very much

guneves said...
This comment has been removed by the author.
guneves said...

most important part is:
"all directories in the path for the target directory must be with at least permission to read."

So you know:
$ represents terminal (should not be typed)
gus represents my user folder

So for example: I wanted to add access to:
/Users/gus/Documents/Griffith/sem6/2622ICT/Lab exercises/

So I had to:
$ chmod 755 /Users/
$ chmod 755 /Users/gus/
$ chmod 755 /Users/gus/Documents/
... and so on

I have also done:
$ chmod 755 /Users/gus/Documents/Griffith/sem6/2622ICT/Lab exercises/*
as I want all folders inside that folder to be visible.
This way I can open any version I have there (each week I have a new lab done).

I have also enabled symlinks and then I have actually used the symlink in my alias.
Example:
$ cd /Users/gus/Sites
$ ln -s /Users/gus/Documents/Griffith/sem6/2622ICT/Lab\ exercises/ flickmee

and then my alias was defined as:
Alias /flickmee "/Users/tavin/Sites/flickmee"

Followed by:
<Directory "/Users/tavin/Sites/flickmee">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>

Hope this helps other people.
Google for macos x apache symlinks for mor info on symlinks

PS: Had to repost because the chars < > were interpreted as html.

Cheers!

guneves said...

Something I forgot to mention:
You may need to call sudo before some commands (so you can do that as root). Terminal will require you user password if using sudo.

and also, to restart apache you can use:
sudo apachectl graceful

Cheers! XD

Unknown said...

Slot Machines - TricktoACTOE
Slot Machines. Slot Machines 토 블리 have different ways 스포츠토토 언오버 비코리아 놀검소 of playing, such as in the winwinbet casino where you use a reel wheel batman 토토 넷마블 or a spinning reel. The 토토사이트 추천인 샤오미 same wheel or spin

dashinsachse said...

The velocity of the machine is noticeably slower in Pokémon Emerald comparability with} Pokémon Ruby and Sapphire. They usually are not allowed to dam the jackpot till they can afford it. As for 우리카지노 the slot machines, I would take movies of how the reels would go into hyper-speed to avoid the bonus image it would, and will, have landed on. Embrace the profitable moment and let your unforgettable journey unfold. Slots {are now|at the moment are|are actually} available on level 2 and three including our new high restrict slots salon on level three. Progressive slots put a few of the the} wagered funds into a jackpot pool that progresses with every credit wager.