Subdomains and Apache

Discussion in 'Server Operation' started by redstar, Apr 21, 2005.

  1. falko

    falko Super Moderator Howtoforge Staff

    Yes.

    It's not working for me. The site cannot be found.
    Is 58.7.0.171 the correct IP address?

    Code:
    mh1:~# dig linux.rockinghamgateway.com
    
    ; <<>> DiG 9.2.1 <<>> linux.rockinghamgateway.com
    ;; global options:  printcmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 15555
    ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
    
    ;; QUESTION SECTION:
    ;linux.rockinghamgateway.com.   IN      A
    
    ;; ANSWER SECTION:
    linux.rockinghamgateway.com. 3560 IN    A       58.7.0.171
    
    ;; Query time: 57 msec
    ;; SERVER: 213.191.92.84#53(213.191.92.84)
    ;; WHEN: Thu Jun 21 16:22:56 2007
    ;; MSG SIZE  rcvd: 61
     
  2. tommytomato

    tommytomato New Member

    thanks

    I know its not working because i have the server off, by the time you get around to viewing the link, I've probley turn it off and i'm out to work ;)

    TT
     
  3. Dutzzu

    Dutzzu New Member

    tks for help falko :D

    i have a new question now: if i want to host 2 domains on a single server, what do i have to change in httpd.conf ?!? just paste a code similary like that for virtual host ?!?
    smt like this ( if i have dutzzu.ro, and now i want to add another domain - example.ro )

    Code:
    Listen 80
    NameVirtualHost *
    
    <VirtualHost *>
      ServerName dutzzu.ro
      DocumentRoot /www/webroot
    </VirtualHost>
    
    <VirtualHost *>
     ServerName example.ro
    DOcumentRoot /www/webroot/example.ro
    </VirtualHost>
    

    Is this corect ? or i have to past smth else ( another code ) somwhere else ?
     
  4. falko

    falko Super Moderator Howtoforge Staff

  5. commanderxai

    commanderxai New Member

    Compound Subdomains?

    Since this is along the same lines how would one accomplish a compound subdomain.

    Example: http://sub1.sub2.sub3.host.tld/

    in my <VirtualHost> Tag this is what I listed as the primary data:

    Code:
            ServerAdmin [email protected]
    	ServerName www.ebarg.com
    	ServerAlias ebarg.com *.*.*.*.ebarg.com *.*.*.ebarg.com *.*.ebarg.com *.ebarg.com 
    	DocumentRoot /my/path/to/root/
            
    Obviously this wont work (already tried). httpd does not fault, but it won't let me us any more than one domain. I am sure it is possable though because you see it on government websites alot (course maybe it is a government thing).

    Any ideas?
     
  6. commanderxai

    commanderxai New Member

    Hey, I figured it out to anyone who is interested.

    Code:
    	ServerAdmin [email protected]
    	ServerName www.ebarg.com
    	ServerAlias ebarg.com "^(a-zA-Z0-9_.)+$".ebarg.com *.ebarg.com 
    	DocumentRoot /my/path/to/root/
    
    The last ServerAlias directive is redundant, but I left it in there anyway.

    Maybe someone can find this handy.
     
  7. rul3z

    rul3z New Member

    What if you are using Dynamic DNS? Who shall you point the subdomain to the correct IP?

    Isn't there any work around?
     
  8. falko

    falko Super Moderator Howtoforge Staff

    You can use CNAME records that point to your dyndns.org address.
     
  9. rul3z

    rul3z New Member

    Yes actually I finally managed to figure that out yesterday and sorry for not saying that here. I found it in the dyndns.org forum.

    Thanks falko
     

Share This Page