Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
07-29-2004, 04:41 AM #1
- Join Date
- Jul 2004
- Thanked 0 Times in 0 Posts
creating subdomains or virtual hosts
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.
07-29-2004, 05:50 AM #2
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.
07-29-2004, 02:24 PM #3
- Join Date
- Jun 2002
- Winona, MN - The land of 10,000 lakes
- 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
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.