Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Jul 2004
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question creating subdomains or virtual hosts

    hi all,
    good morning(well it is morning here)...i was wondering if someone knows how to create subdomains or virtual hosts?
    what i mean is like..u know, allowing the user to create their website(subdomain) like http://mydomain.abcnet.com ??i am using php and apache.haven't got a clue where to start this as i totally have no idea at all. or is there an easier way like http://www.abcnet.com/mivec?(like brinksters style, www21.brinkster.com/user...)
    thanking you all in advance.

  • #2
    Senior Coder missing-score's Avatar
    Join Date
    Jan 2003
    Location
    UK
    Posts
    2,194
    Thanks
    0
    Thanked 0 Times in 0 Posts
    the second way is much easier mainly becuase it wont require you to have any further permissions...

    To create a subdoman I believe you need to add to the Apache httpd.conf file, and there may be other things too... Im not sure, Ive only ever specified access ports this way.

  • #3
    Mega-ultimate member
    Join Date
    Jun 2002
    Location
    Winona, MN - The land of 10,000 lakes
    Posts
    1,855
    Thanks
    1
    Thanked 45 Times in 42 Posts
    If you're running apache, it's SUPER EASY to set up user accounts in the http://www.mysite.com/~username fashion.

    Simply do the following.

    1) Check your umask and set it to something like 022.
    2) Set the permissions on the subdirectories of /home to 750 (chmod 750 /home/*)
    3) Change the group ownership on the /home sub dirs to apache (chgrp apache /home/*)
    4) Make sure apache is running under the group "apache"
    5) Configure the UserDir directive in the httpd.conf file to something like "public_html"
    6) Make a directory in each user account called "public_html" and set the group ownership to apache with the permissions 4755 (chmod 4755 public_html)

    This will take care of all your existing users on the system so they can access their site at http://www.mysite.com/~username
    Edit: Note, some systems already have some of this done for you


    Now, simply add a directory in the /etc/skel directory called public_html with permissions 4755 and group owner of apache. Then every time you add a user, their public_html dir will be automatically created and you'll be good to go!

    Hope this helps.


  •  

    Posting Permissions

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