setting up a url w/ a prefix... joe.ozzu.com, etc.

  • homer simpson
  • Student
  • Student
  • homer simpson
  • Posts: 96

Post 3+ Months Ago

How exactly does one setup a website w/ various "prefixes"? such as joe.ozzu.com, mike.ozzu.com? Is this somethign the host has to do?

Also, can individuals upload files to their pages i.e. joe.ozzu.com? How does one setup an anonymous FTP upload for others to upload files onto a server w/o effecting the main page. i.e. http://www.ozzu.com

thanks
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • Bigwebmaster
  • Site Admin
  • Site Admin
  • User avatar
  • Posts: 9089
  • Loc: Seattle, WA & Phoenix, AZ

Post 3+ Months Ago

Good question first off :D

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:



Code: [ Select ]
<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>
  1. <VirtualHost 64.245.51.13:80>
  2. Port 80
  3. ServerAdmin hostmaster@somedomain.com
  4. DocumentRoot /home/brian/websites/ozzu.com/public_html
  5. ServerName ozzu.com
  6. ServerAlias www.ozzu.com
  7. CustomLog /home/brian/websites/logs/ozzu.com/access.log combined
  8. ErrorLog /home/brian/websites/logs/ozzu.com/error.log
  9. </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:

Code: [ Select ]
<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>
  1. <VirtualHost 64.245.51.13:80>
  2. Port 80
  3. ServerAdmin hostmaster@somedomain.com
  4. DocumentRoot /home/brian/websites/ozzu.com/public_html
  5. ServerName ozzu.com
  6. ServerAlias www.ozzu.com
  7. CustomLog /home/brian/websites/logs/ozzu.com/access.log combined
  8. ErrorLog /home/brian/websites/logs/ozzu.com/error.log
  9. </VirtualHost>
  10. <VirtualHost 64.245.51.13:80>
  11. Port 80
  12. ServerAdmin hostmaster@somedomain.com
  13. DocumentRoot /home/brian/websites/ozzu.com/joe.ozzu.com
  14. ServerName joe.ozzu.com
  15. CustomLog /home/brian/websites/logs/joe.ozzu.com/access.log combined
  16. ErrorLog /home/brian/websites/logs/joe.ozzu.com/error.log
  17. </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 :drinking:
  • Bigwebmaster
  • Site Admin
  • Site Admin
  • User avatar
  • Posts: 9089
  • Loc: Seattle, WA & Phoenix, AZ

Post 3+ Months Ago

By the way if you have some server software like Ensim or something else the procedure above may be totally different, and it may be much more simple to setup if you have no idea how to mess with things from ssh or telnet.
  • Willy
  • Graduate
  • Graduate
  • Willy
  • Posts: 199

Post 3+ Months Ago

when you say you need to update the dns files? does a db.joe.ozzu file need to be created? What DNS files exaclty need to be changed / modified?


~j
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Posts: 23456
  • Loc: Woodbridge VA

Post 3+ Months Ago

Window 2000 Server makes it much easier. Here's the process on how I create child domain's (for the record - joe.ozzu.com is an example of a child domain).

My host provider allows domain admins acess to modify DNS records. That's a plus! For reference let's say my domain IP is 255.255.255.1 and my domain is http://www.mydomain.com. Now let's say I want to call my child domain service.mydomain.com

Obviously mydomain.com resolves to 255.255.255.1 This is called an A-Record. http://www.mydomain.com is actually a C-Record. I like setting up domains with both because it allows people to type in the address either way, and it still resolves to my site.

Now, to create my child domain, I use the DNS manager to simply create a new A-Record for service.mydomain.com and set it to also resolve to 255.255.255.1 Very simple. That part's done. The problem is both names resolve to the same IP which means that either one they type in is going to resolve to my default index page (default.asp). But I want service.mydomain.com to resolve to a default index page in my "service" directory (service/index.html).

This is easily accomplished with a basic ASP redirect script.
Code: [ Select ]
<!--
'**************************************
  ' Name: Multi Domain Redirect
  ' Description:If you have multiple domai
  '   n names pointing to the same web site, t
  '   his code will allow you to redirect the
  '   user to a subdirectory based on the web
  '   address then type in the browser.
  ' By: Glenn C.
  '
  'This code is copyrighted and has  ' limited warranties.Please see http://w
  '   ww.Planet-Source-Code.com/xq/ASP/txtCode
  '   Id.6349/lngWId.4/qx/vb/scripts/ShowCode.
  '   htm  'for details.  '**************************************
  
  <%@ Language=VBScript %>
  <%
  ' Set up your variables
  Dim sURL, sPath
  ' Get the domain name typed in the brows
  '   er.
  sURL = Request.ServerVariables("HTTP_HOST")
  ' Get the rest of the path after the dom
  '   ain name.
  sPath = Request.ServerVariables("PATH_INFO")
  ' Based on the domain name, redirect the
  '   user
  ' to the correct directory and attach th
  '   e rest
  ' of the path.
  Select Case sURL
      Case "www.mydomain.com", "mydomain.com"
          ' Ignore...this is the current site.
      Case "service.mydomain.com"
          ' redirect To the "service" directory
  Response.Redirect "service/index.html"
  
  '  

  End Select
  %>
//-->
  1. <!--
  2. '**************************************
  3.   ' Name: Multi Domain Redirect
  4.   ' Description:If you have multiple domai
  5.   '   n names pointing to the same web site, t
  6.   '   his code will allow you to redirect the
  7.   '   user to a subdirectory based on the web
  8.   '   address then type in the browser.
  9.   ' By: Glenn C.
  10.   '
  11.   'This code is copyrighted and has  ' limited warranties.Please see http://w
  12.   '   ww.Planet-Source-Code.com/xq/ASP/txtCode
  13.   '   Id.6349/lngWId.4/qx/vb/scripts/ShowCode.
  14.   '   htm  'for details.  '**************************************
  15.   
  16.   <%@ Language=VBScript %>
  17.   <%
  18.   ' Set up your variables
  19.   Dim sURL, sPath
  20.   ' Get the domain name typed in the brows
  21.   '   er.
  22.   sURL = Request.ServerVariables("HTTP_HOST")
  23.   ' Get the rest of the path after the dom
  24.   '   ain name.
  25.   sPath = Request.ServerVariables("PATH_INFO")
  26.   ' Based on the domain name, redirect the
  27.   '   user
  28.   ' to the correct directory and attach th
  29.   '   e rest
  30.   ' of the path.
  31.   Select Case sURL
  32.       Case "www.mydomain.com", "mydomain.com"
  33.           ' Ignore...this is the current site.
  34.       Case "service.mydomain.com"
  35.           ' redirect To the "service" directory
  36.   Response.Redirect "service/index.html"
  37.   
  38.   '  
  39.   End Select
  40.   %>
  41. //-->



That's it! Usually takes me about 5 minutes to set up a child domain using this method. Of course I do understand that this may not be applicable to the question at hand. But it is an easy method that works everytime for sites hosted on a Win2K Server.

Post Information

  • Total Posts in this topic: 5 posts
  • Users browsing this forum: No registered users and 17 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.