Results 1 to 9 of 9

Thread: Creating Subdomains

  1. #1

    Thread Starter
    Frenzied Member StrangerInBeijing's Avatar
    Join Date
    Mar 2005
    Location
    Not in Beijing
    Posts
    1,666

    Creating Subdomains

    Not much of a network guy, so scuse my stupidity.

    Webserver runs Win2K3 Server, Apache,Php,Mysql (This is live webserver)
    I can RDC into server with admin permissions.

    Got www folder with current website in subfolders (www/oursite)
    created new folder with new site (www/newsite)

    Now I want to create a subdomain (http://newsite/oursite.cn).

    Tried this and some other similar post, but no luck.

    Any advice?
    Install and Configure Eclipse For both Java and PHP development
    Accessible Ajax/jQuery Forms Degrade gracefully with JavaScript Disabled

  2. #2
    WiggleWiggle dclamp's Avatar
    Join Date
    Aug 2006
    Posts
    3,527

    Re: Creating Subdomains

    This is a thread about a sub domain redirect, some info in the thread may be relevant to you http://www.vbforums.com/showthread.php?t=521044
    My usual boring signature: Something

  3. #3

    Thread Starter
    Frenzied Member StrangerInBeijing's Avatar
    Join Date
    Mar 2005
    Location
    Not in Beijing
    Posts
    1,666

    Re: Creating Subdomains

    Thanks dc, but maybe I did not make myself clear. (but then..i dont really know how to "say" these things)

    For instance, my own website's host allow me to create up to 10 sub domains, but I use their control panel for it. So I have my main site (www.mysite.com) and sub domains I created this way (blog.mysite.com, crm.mysite.com, etc)
    It's like completely different websites.

    I just assumed that if one are in control of your own webserver (as i am not like i mentioned earlier), one can do that by some edits to the httpconfig without having to register anything.
    Install and Configure Eclipse For both Java and PHP development
    Accessible Ajax/jQuery Forms Degrade gracefully with JavaScript Disabled

  4. #4
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Creating Subdomains

    So instead of

    (http://newsite/oursite.cn).

    you meant

    (http://newsite.oursite.cn).

    Right?

    In Apache, you just need to create a new <VirtualHost> . A quick search got me this example

    Code:
    Listen 80
    NameVirtualHost *
    
    <VirtualHost *>
    ServerName www.domain.com
    DocumentRoot /home/httpd/htdocs/
    </VirtualHost>
    
    <VirtualHost *>
    ServerName subdomain.domain.com
    DocumentRoot /home/httpd/htdocs/subdomain/
    </VirtualHost>
    Instead of the * though, you probably want to use an IP address.

  5. #5

    Thread Starter
    Frenzied Member StrangerInBeijing's Avatar
    Join Date
    Mar 2005
    Location
    Not in Beijing
    Posts
    1,666

    Re: Creating Subdomains

    thanks again for the reply.

    Yes, that is what I meant.

    however that is what i did, and it did not work. (i mean like the sample)

    maybe i just did sth wrong. will try again after some sleep (it's 4:30 AM on a Sunday Night!)

    [EDIT] - Yes I did restart Apache!
    Install and Configure Eclipse For both Java and PHP development
    Accessible Ajax/jQuery Forms Degrade gracefully with JavaScript Disabled

  6. #6

    Thread Starter
    Frenzied Member StrangerInBeijing's Avatar
    Join Date
    Mar 2005
    Location
    Not in Beijing
    Posts
    1,666

    Re: Creating Subdomains

    Before I edited the first two was there and worked fine. I added the third & restarted Apache. No Luck

    Code:
    <VirtualHost xxx.xxx.xxx.xxx:80>
        ServerAdmin [email protected]
        DocumentRoot "/www/oursite"
        ServerName www.oursite.cn
    </VirtualHost>
    
    <VirtualHost xxx.xxx.xxx.xxx:80>
        ServerAdmin [email protected]
        DocumentRoot "/www/oursite_mobi"
        ServerName www.oursite.mobi
    </VirtualHost>
    <VirtualHost xxx.xxx.xxx.xxx:80>
        ServerAdmin [email protected]
        DocumentRoot "/www/crm"
        ServerName crm.oursite.cn
    </VirtualHost>
    Install and Configure Eclipse For both Java and PHP development
    Accessible Ajax/jQuery Forms Degrade gracefully with JavaScript Disabled

  7. #7
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Creating Subdomains

    And you've set up the CNAME as well?

  8. #8

    Thread Starter
    Frenzied Member StrangerInBeijing's Avatar
    Join Date
    Mar 2005
    Location
    Not in Beijing
    Posts
    1,666

    Re: Creating Subdomains

    whats CNAME?
    [EDIT] - OIC......(sē-nām) Short for canonical name, also referred to as a CNAME record, a record in a DNS database that indicates the true, or canonical, host name of a computer that its aliases are associated with. A computer hosting a Web site must have an IP address in order to be connected to the World Wide Web. The DNS resolves the computer’s domain name to its IP address, but sometimes more than one domain name resolves to the same IP address, and this is where the CNAME is useful. A machine can have an unlimited number of CNAME aliases, but a separate CNAME record must be in the database for each alias

    uuhm....guess web host got to do that?
    Install and Configure Eclipse For both Java and PHP development
    Accessible Ajax/jQuery Forms Degrade gracefully with JavaScript Disabled

  9. #9
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: Creating Subdomains

    You may need a catch all CNAME set up if you want to add arbitrary domains and I suggest that if you want complete control over your domain name records you use a service such as ZoneEdit.
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

Posting Permissions

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



Click Here to Expand Forum to Full Width