Find the answer to your Linux question:
Results 1 to 2 of 2
Hi, using the mod_userdir module, how can I get the variable of there username? So if someone enters in the browser http://localhost/~teknoeacid I get UserDir down below to look like ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    May 2003
    Location
    Minnesota
    Posts
    9

    Apache: User Directory Variable in httpd.conf


    Hi, using the mod_userdir module, how can I get the variable of there username?

    So if someone enters in the browser http://localhost/~teknoeacid

    I get UserDir down below to look like /home/teknoeacid/public_html ?

    I was thinking it may be something like this:
    <IfModule mod_userdir.c>
    UserDir "/home/$USER/public_html"
    </IfModule>


    How would I go about doing this correctly?
    -Mike

  2. #2
    Linux Guru
    Join Date
    Apr 2003
    Location
    London, UK
    Posts
    3,284

    Re: Apache: User Directory Variable in httpd.conf

    Quote Originally Posted by teknoeacid
    Hi, using the mod_userdir module, how can I get the variable of there username?

    So if someone enters in the browser http://localhost/~teknoeacid

    I get UserDir down below to look like /home/teknoeacid/public_html ?

    I was thinking it may be something like this:
    <IfModule mod_userdir.c>
    UserDir "/home/$USER/public_html"
    </IfModule>


    How would I go about doing this correctly?
    -Mike
    Like this:
    Code:
    <IfModule mod_userdir.c>
        UserDir public_html
    </IfModule>
    mod_userdir.c should fetch the users home directory from /etc/passwd, then just slap "public_html" on the end of it, ending up with for example "/home/username/public_html"

    Jason

Posting Permissions

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