Results 1 to 12 of 12
  1. #1

    how to create subdomain in linux by command

    hello all
    i have a question. i want to create a subdomain for a special domain in linux server by terminal command. i dont want use gui hosting panel for that. which command should be use in terminal?
    i have do edit httpd.conf by vi command and add subdomain in that, but that subdomain didn't work and i cant load my new subdomain by browser. what am i do for solve this problem? do i should reset httpd.conf or apache service for active this subdomain? anyone have better way to create subdomain by command?
    regards

  2. #2
    Join Date
    Jul 2001
    Location
    Singapore
    Posts
    1,790
    You need to setup that subdomain in your DNS (if you are running DNS for that domain) as well or else when you try to ping that subdomain... it won't resolve to any IP... or show you host not found message
    Giam Teck Choon
    :: Join choon.net Community today to share your tips and tricks on server issues please ::
    :: Singapore Dedicated Servers :: Singapore Virtual Private Servers :: Linux/FreeBSD Server Management ::

  3. #3
    Originally posted by choon
    You need to setup that subdomain in your DNS (if you are running DNS for that domain) as well or else when you try to ping that subdomain... it won't resolve to any IP... or show you host not found message
    hello choon , thank you for reply.
    first i do edit httpd.conf , for next step i should edit zone file and then reload rndc ?
    my question is what's the name of zone file and where is locate?
    i know /var/named is locate of zone files, is it true?
    another question is apache service shuold be restart for active new subdomain after that create? is it necessary or not?
    please tell me step by step. regards

  4. #4
    Join Date
    Jul 2001
    Location
    Singapore
    Posts
    1,790
    Any changes in your httpd.conf (apache configuration file) you need to restart and/or reload your apache in order for the new changes for the config file to take effect. Whereby for your subdomain DNS issue, sorry... you should know better than anyone else since if you host your domain DNS in your server. There are many ways to setup DNS and depending on how you set it up. Which platform you are using may I know?
    Giam Teck Choon
    :: Join choon.net Community today to share your tips and tricks on server issues please ::
    :: Singapore Dedicated Servers :: Singapore Virtual Private Servers :: Linux/FreeBSD Server Management ::

  5. #5
    hello choon
    my server platrom is redhat 9.0
    bind config in this server and dns is setup. my sites are up well but i want to create some subdomain for a special domain which host in my server. thank you

  6. #6
    Join Date
    Jul 2001
    Location
    Singapore
    Posts
    1,790
    RHL 9.0 already EOLed so why still using it?
    Can show me your domain zone? Of course you can replace your real domain as example.com and real IPs as IP 1, IP 2... ... Getting subdomain to work is as simple as adding the appropriate A record in your domain zone and increase the serial number then restart your DNS/BIND/NAMED
    Giam Teck Choon
    :: Join choon.net Community today to share your tips and tricks on server issues please ::
    :: Singapore Dedicated Servers :: Singapore Virtual Private Servers :: Linux/FreeBSD Server Management ::

  7. #7
    Originally posted by choon
    RHL 9.0 already EOLed so why still using it?
    Can show me your domain zone? Of course you can replace your real domain as example.com and real IPs as IP 1, IP 2... ... Getting subdomain to work is as simple as adding the appropriate A record in your domain zone and increase the serial number then restart your DNS/BIND/NAMED
    thank you again dear choon
    first i go into /var/named , but there isn't .db file in here but i see a file like example.com.zone ( example is my special domain )
    then i cat this file and here is my result domain zone:
    [[email protected] named]$ cat example.com.zone
    $TTL 86400
    @ IN SOA ns2.air-wing.com. root.air-wing.com. (
    2005021501 ; serial
    3600 ; refresh
    1200 ; retry
    604800 ; expire
    86400 ; ttl
    )


    IN NS ns2.air-wing.com.
    IN NS dns1.name-services.com.
    IN NS dns2.name-services.com.

    IN MX 10 mail.example.com.

    @ IN A 192.168.1.21

    dns IN A 192.168.1.21
    ftp IN A 192.168.1.21
    www IN A 192.168.1.21
    mail IN A 192.168.1.21
    smtp IN A 192.168.1.21
    pop IN A 192.168.1.21

    domain.com is my special domain. what am i do for next step ( add a record in domain zone ... ) ?
    regards

  8. #8
    Join Date
    Apr 2003
    Location
    NC
    Posts
    3,080
    Where are you hosting the DNS for this domain? If there is not already a file for the doman it sounds like it may be hosted elsewhere.

    If you did have dns you would just add line like this:
    subdomain IN A 123.123.123.123
    John W, CISSP, C|EH
    MS Information Security and Assurance
    ITEagleEye.com - Server Administration and Security
    Yawig.com - Managed VPS and Dedicated Servers with VIP Service

  9. #9
    Join Date
    Jul 2001
    Location
    Singapore
    Posts
    1,790
    Is air-wing.com your real domain? And subdomain you are trying to setup on air-wing.com? If it is so, according to whois... your domain air-wing.com is pointing to:
    NS2.AIR-WING.COM
    TEGTAN1.INTERLINK.OR.JP

    Thus if you want to setup mysub.air-wing.com subdomain, you need to add the A record in your domain zone file in the following DNS then after adding you need to restart the following DNS:
    NS2.AIR-WING.COM
    TEGTAN1.INTERLINK.OR.JP

    Example:
    mysub.air-wing.com. IN A 192.168.1.21
    Note that 192.168.1.21 is not public IP... ... and that IP you added in must also be the same as in your apache virtual host for that subdomain which my example above is mysub.air-wing.com

    Hope this helps
    Giam Teck Choon
    :: Join choon.net Community today to share your tips and tricks on server issues please ::
    :: Singapore Dedicated Servers :: Singapore Virtual Private Servers :: Linux/FreeBSD Server Management ::

  10. #10
    hello , thank you eth00 & choon
    dns for my domain is:
    dns1.name-services.com
    dns2.name-services.com
    my real domain which i want add subdomain for that is:
    shogun4u.com
    i'm going for do it here is part of shogun4u.com.zone:
    dns IN A 192.168.1.21
    ftp IN A 192.168.1.21
    www IN A 192.168.1.21
    mail IN A 192.168.1.21
    smtp IN A 192.168.1.21
    pop IN A 192.168.1.21
    test IN A 192.168.1.21

    is it true?
    regards

  11. #11
    and hereis part of httpd.conf:
    <VirtualHost 192.168.1.21>
    DocumentRoot /home/shogun/public_html
    ServerName www.shogun4u.com
    ServerAlias shogun4u.com
    </VirtualHost>

    #<VirtualHost 192.168.1.21>
    #DocumentRoot /home/shogun/public_html/test
    #ServerName test.shogun4u.com
    #ServerAlias test.shogun4u.com
    #</VirtualHost>

    is it true?

  12. #12
    Join Date
    Jul 2001
    Location
    Singapore
    Posts
    1,790
    as stated before... you are using private address space:
    http://www.faqs.org/rfcs/rfc1918.html
    Giam Teck Choon
    :: Join choon.net Community today to share your tips and tricks on server issues please ::
    :: Singapore Dedicated Servers :: Singapore Virtual Private Servers :: Linux/FreeBSD Server Management ::

Posting Permissions

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