can bind point to a dir?

Discussion in 'Server Operation' started by Jshel, Dec 7, 2007.

  1. Jshel

    Jshel New Member

    I'm running fedora core 7 with bind 9. I host a www server and mail server on the same machine with webmail. I would like mail.domain.com to go directly to the webmail and not my default webpage. I understand DNS and I'm familiar enough with bind to be able to get around. But I just can't figure out how to have mail.domain.com pull domain.com/webmail
    Thank you for your time,
    Joe
     
  2. falko

    falko Super Moderator ISPConfig Developer

  3. Jshel

    Jshel New Member

    Issue setuping up Vhost

    A while ago i setup a web and mail server and used a Vhost to point mail.domain.com to the webmail dir. I am in the process of redoing the
    server due to a dead hard drive. My httpd.conf file has this entry

    <virtualhost mail.domain.com>
    ServerName mail.domain.com
    DocumentRoot /var/www/html/webmail
    </virtualhost>

    I have tried multiple configs from the apache site and i'm ready to shot myself in the head. (figure of speech ONLY)
    When i have it setup (what i believe is correct) domain.com and mail.domain.com go to the same darn place "DOMAIN.COM"
    I'm spacing something really simple i know but hell if i can find it.
    Any help would be greatly appreciated. Thank you in advance.
    JSHEL
     
  4. chipsafts

    chipsafts New Member

    What does your browser show when you go to mail.domain.com ?
    any errors about the setup in the apache or syslog logs?
     
  5. Jshel

    Jshel New Member

    If i go to mail.domain.com the browser just brings up domain.com, and i'm not getting anything in the logs what so ever. No error starting httpd either. I have turned on debug. I'll post some of the logs tomorrow at work. I really appreciate the help. Thank you.
     
  6. falko

    falko Super Moderator ISPConfig Developer

    Can you post the vhost configurations of mail.domain.com and domain.com? What's the output of
    Code:
    ifconfig
    ?
     
  7. Jshel

    Jshel New Member

    Morning,
    I figured it out. I pulled my head out of the box and realized i was for getting to put in the (NameVirtualHost *:80) directive. all is running well now.
    for anyone else you must have these entrys

    NameVirtualHost *:80

    <virtualhost *:80>
    servername domain.com
    documentroot /some/dir
    </virtualhost>

    <virtualhost *:80>
    servername mail.domain.com
    documentroot /some/dir/webmail_dir
    </virutalhost>

    Thank you for everyones help on this issue.
     
  8. martien

    martien New Member

    You can also add cname record for your mail.domain.com and then in your webmail vhost (webmail.domain.com for example) you can add
    Code:
    ServerAlias mail.domain.com mail2.domain.com
     

Share This Page