Good question first off
For much of the procedures below you made need to be root user to have permissiont to make directories, edit httpd.conf and restart the httpd daemon.
The first step to setting up a domain to have prefixes is to modify the internal DNS so that each subdomain you want will resolve. If you do not manage your own DNS then you would simply ask your host to add the subdomain that you want, such as joe.ozzu.com.
After you have the DNS setup the next step is to create a directy that you would like to place the content in for the subdomain and to modify your server configuration. I am assuming you are using Apache, so I will explain in terms of Apache. However it will most likely be different to set it up if you are not using Apache. Again part of this depends on your host. Your host may set this up for you as well, and if that is the case there is really not much for you to do, but upload your content to the directory they made for your sub domain.
If you host doesn't do this for you need to create a directory such as subdomain.yoursite.com - I usually place that one directory level below your other site. So if your other site is in public_html for instance I would create another folder/directory in the same directory that public_html resides in. Not actually in public_html though. If you need ot make directories and am not sure how, let me know and I can explain that in further detail here.
Once your directories have been made it is now time to edit your Apache Server. The most common location of your file that you need to edit is located here:
/etc/httpd/conf/httpd.conf
You would need to edit that using pico or vi in telnet or ssh (I recommend using ssh). In httpd.conf you would need to goto the bottom of the file (usually the bottom), and find the Virtualhost section. In this section you would have something like the following:
<VirtualHost 64.245.51.13:80>
Port 80
ServerAdmin hostmaster@somedomain.com
DocumentRoot /home/brian/websites/ozzu.com/public_html
ServerName ozzu.com
ServerAlias www.ozzu.com
CustomLog /home/brian/websites/logs/ozzu.com/access.log combined
ErrorLog /home/brian/websites/logs/ozzu.com/error.log
</VirtualHost>
- <VirtualHost 64.245.51.13:80>
- Port 80
- ServerAdmin hostmaster@somedomain.com
- DocumentRoot /home/brian/websites/ozzu.com/public_html
- ServerName ozzu.com
- ServerAlias www.ozzu.com
- CustomLog /home/brian/websites/logs/ozzu.com/access.log combined
- ErrorLog /home/brian/websites/logs/ozzu.com/error.log
- </VirtualHost>
What you would want to do now is basically copy and paste this but change everything that says ozzu.com to subdomain.ozzu.com. Well for the most part. Look more closely below to see exactly how it would be modified. Also remember that this is just an example below, in your server you would have to be matching all your paths completely. By copying and pasting your other entry you would be pretty much having all the right paths already, so it wouldn't really be too difficult. You would place this right below the other so it would eventually look something like this:
<VirtualHost 64.245.51.13:80>
Port 80
ServerAdmin hostmaster@somedomain.com
DocumentRoot /home/brian/websites/ozzu.com/public_html
ServerName ozzu.com
ServerAlias www.ozzu.com
CustomLog /home/brian/websites/logs/ozzu.com/access.log combined
ErrorLog /home/brian/websites/logs/ozzu.com/error.log
</VirtualHost>
<VirtualHost 64.245.51.13:80>
Port 80
ServerAdmin hostmaster@somedomain.com
DocumentRoot /home/brian/websites/ozzu.com/joe.ozzu.com
ServerName joe.ozzu.com
CustomLog /home/brian/websites/logs/joe.ozzu.com/access.log combined
ErrorLog /home/brian/websites/logs/joe.ozzu.com/error.log
</VirtualHost>
- <VirtualHost 64.245.51.13:80>
- Port 80
- ServerAdmin hostmaster@somedomain.com
- DocumentRoot /home/brian/websites/ozzu.com/public_html
- ServerName ozzu.com
- ServerAlias www.ozzu.com
- CustomLog /home/brian/websites/logs/ozzu.com/access.log combined
- ErrorLog /home/brian/websites/logs/ozzu.com/error.log
- </VirtualHost>
- <VirtualHost 64.245.51.13:80>
- Port 80
- ServerAdmin hostmaster@somedomain.com
- DocumentRoot /home/brian/websites/ozzu.com/joe.ozzu.com
- ServerName joe.ozzu.com
- CustomLog /home/brian/websites/logs/joe.ozzu.com/access.log combined
- ErrorLog /home/brian/websites/logs/joe.ozzu.com/error.log
- </VirtualHost>
In the above code the DocumentRoot should point to the directory you had made above which is where your content of your subdomain would reside. After you have made the changes you would change your httpd.conf file and then restart Apache by issuing a command similiar to:
/etc/rc.d/init.d/httpd restart
After the httpd daemon restarts you should be all setup. Now you just have to wait for your new subdomain in the DNS to resolve (might take up to 24 hours or more) and then upload your content to your subdomain directory, and everything should work. Again in your case some things may be a bit different, every server usually has a slightly unique configuration depending on who set it up, and how they wanted the server, unless it was just the default install.
Hope this helps
