Making public_html Work in Ubuntu 8.04 with Apache2

Filed Under (Web Development) by manatarms on 20-01-2009

Tagged Under : , ,

Ever wanted each user on your server to have their own web directory? I wanted users on my server to have access to the public_html directory in their home directory so that they could display content at http://www.mydomain.com/~USERNAME. How do you do this?

  1. Edit /etc/apache2/apache2.conf
  2. Find the section that looks like this:
  3. 1
    2
    3
    4
    5
    6
    7
    8
    
    #UserDir is now a module
    #UserDir public_html
    #UserDir disabled root
     
    #<Directory /home/*/public_html>
    #	AllowOverride FileInfo AuthConfig Limit
    #   Options Indexes SymLinksIfOwnerMatch IncludesNoExec
    #</Directory>
  4. Make it look like this:

    1
    2
    3
    4
    5
    6
    7
    8
    
    #UserDir is now a module
    UserDir public_html
    #UserDir disabled root
     
    <Directory /home/*/public_html>
    	AllowOverride FileInfo AuthConfig Limit
    	Options Indexes SymLinksIfOwnerMatch IncludesNoExec
    </Directory>

  5. Sit back and relish in your own glory knowing that you have just accomplished something done today!

How did I figure this out? Click here.

Leave a Reply