Welcome to MacTalk Australia

the largest Australian community for Apple discussions and topics

» Join the discussions, Register Now!
Results 1 to 6 of 6
  1. #1

    Join Date
    Mar 2009
    Location
    Oregon USA
    Posts
    3

    Default Apache URL Mapping

    In Mac OS X 10.5.6 (which comes with Apache 2 installed and configured), how does apache know to map the URL "http://localhost/~my_name/" to the directory "/Users/my_name/Sites/" ?

  2. #2

    Default

    Don't quote me, as I'm no good with that side of web servers, but it's essentially just an alias, from what I know.
    It's all stored in the Apache config file, iirc.
    MacBook 5,1: 2.0GHz, 4GB RAM, 500GB HDD, SuperDrive, OS X 10.7, Windows 7
    Mac Mini 4,1: 2.4GHz, 8GB RAM, 120GB SSD, 1TB Ext. HDD (Time Machine), 2TB Ext. HDD, OS X 10.8

  3. #3

    Default

    You can also look in /etc/apache2/users dir.
    Everything in that directory are included by httpd-userdir.conf, which is in turn included by httpd.conf

  4. #4

    Join Date
    Mar 2004
    Location
    Berkeley, CA
    Posts
    1,215

    Default

    In /etc/apache2/httpd.conf there is this line:

    # User home directories
    Include /private/etc/apache2/extra/httpd-userdir.conf

    From there:


    # Settings for user home directories
    #
    # Required module: mod_userdir

    #
    # UserDir: The name of the directory that is appended onto a user's home
    # directory if a ~user request is received. Note that you must also set
    # the default access control for these directories, as in the example below.
    #
    UserDir Sites

    #
    # Users might not be in /Users/*/Sites, so use user-specific config files.
    #
    Include /private/etc/apache2/users/*.conf

    And so on...

    Dave

  5. #5

    Join Date
    Mar 2009
    Location
    Oregon USA
    Posts
    3

    Default

    Thanks, MacDave! This is exactly what I was looking for. I was just grep'ing for UserDir in httpd.conf and didn't get anything- forgot to check for included conf files within httpd.conf. Duh!

  6. #6

    Join Date
    Mar 2009
    Location
    Oregon USA
    Posts
    3

    Default

    Thanks, everyone, for the quick responses! Got exactly the answer I was looking for.

Tags for this Thread

Posting Permissions

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