The MU forums have moved to WordPress.org

Confused about WildcardDNS (11 posts)

  1. nigelwong
    Inactive
    Posted 18 years ago #

    Okay my account is setup in cPanel. cPanel automatically creates VirtualHosts for you. Looking at the httpdconf file, i see this:

    <VirtualHost 128.121.20.245>
    ServerAlias xanblog.my3host.com
    ServerAdmin webmaster@xanblog.my3host.com
    DocumentRoot /home/nigel/public_html
    BytesLog domlogs/xanblog.my3host.com-bytes_log
    ServerName http://www.xanblog.my3host.com

    User nigel
    Group nigel
    CustomLog /usr/local/apache/domlogs/xanblog.my3host.com combined
    ScriptAlias /cgi-bin/ /home/nigel/public_html/cgi-bin/
    </VirtualHost>

    Now, i have also configured BIND to *.xanblog.my3host.com. IN A 128.121.20.245 <--- Do i need to do this step?

    By reading other posts, i think i'm supposed to add:

    <VirtualHost *>
    ServerAlias *.xanblog.my3host.com
    ServerAdmin webmaster@xanblog.my3host.com
    DocumentRoot /home/nigel/public_html
    BytesLog domlogs/xanblog.my3host.com-bytes_log
    ServerName http://www.xanblog.my3host.com

    User nigel
    Group nigel
    CustomLog /usr/local/apache/domlogs/xanblog.my3host.com combined
    ScriptAlias /cgi-bin/ /home/nigel/public_html/cgi-bin/
    </VirtualHost>

    Do i add the above, or replace the old VirtualHost given by cPanel. Also, i set my DNS up in the subdomain aswell.

    So basically 2 questions:
    1. Do i need to configure BIND
    2. Do i replace the existing cPanel VirtualHost with the new one, or do i add it on at the bottom?

    Thankyou.

    (Currently, it redirects my site to the IP which has another site installed onto the root of the IP.)

  2. jaseone
    Inactive
    Posted 18 years ago #

    1. Yes otherwise the subdomain won't resolve at all, it needs all requests for *.xanblog.my3host.com to resolve to xanblog.my3host.com so the RewriteRule magic in WPMU can take over.

    2.Just update your existing VirtualHost by changing:

    ServerAlias xanblog.my3host.com
    To:
    ServerAlias xanblog.my3host.com *.xanblog.my3host.com

    Why do you want to use a domain name like xanblog.my3host.com anyway? I think it should play nice with the two level subdomain but I'm not sure.

    EDIT: That ServerAlias should be one line with the two separated by a space.

  3. nigelwong
    Inactive
    Posted 18 years ago #

    Thankyou for your reply. I will get a domain soon, but first i need to learn how to configure it properly =)

    So now i have 2 more questions about your answer

    1. Do i need do use the Wildacrd (*) instead of the IP that cPanel gives you?

    ie. <VirtualHost *> not <VirtualHost 128.121.20.245>

    2. For BIND, what line do i use?
    This is what i am using:
    *.xanblog.my3host.com. IN A 128.121.20.245

    But from what i am reading i need:
    *.xanblog.my3host.com IN CNAME xanblog.my3host.com

    Thankyou jaseone sofar for helping me out =D

  4. nigelwong
    Inactive
    Posted 18 years ago #

    Okay my httpd conf file is here. Please look at it if u need to

    http://www.filefactory.com/get/f.php?f=f57b20f3a6f256275f99ebd1

  5. nigelwong
    Inactive
    Posted 18 years ago #

    Sorry for the ServerAlias i had *.xanblog.my3host.com not xanblog.my3host.com

  6. Cruz
    Member
    Posted 18 years ago #

    I'm quite confused about wildcard..

    1. Is wildcard the same thing as server alias?
    2. From some posts I read that wildcard needs to be added from both the web host and the domain registrar. This is correct?
    3. My host told me that to add server alias, I simply add domain park on Cpanel, but I get the error message "You cannot park your main domain!"

  7. jaseone
    Inactive
    Posted 18 years ago #

    For hosted sites you only need to request your host to make two changes:

    1. Add a wildcard entry in the DNS for *.yourdomain.com to resolve to your server'sIP address (some hosts insist you get a dedicated IP for this step but I have never udnerstood why exactly)
    2. Add a ServerAlias in Apache for *.yourdomain.com

    Your registrar does not need to be involved and if yourdomain.com is your main domain at your host then you don't need to park it or anything, likewise if it is an add-on domain.

    If your host can't understand that then it might be time to look for a new host.

    Cruz,

    Can you pastebin that instead? Downloading through places like that is a pain. You should have just needed to update that single line that I quoted.

  8. nigelwong
    Inactive
    Posted 18 years ago #

    I'm hosting my own server, thats why i need some help =S

    "1. Add a wildcard entry in the DNS for *.yourdomain.com to resolve to your server'sIP address (some hosts insist you get a dedicated IP for this step but I have never udnerstood why exactly)"

    Okay since i have a Subdomain, i configure in cPanel. This is what i have: *.mydomain.com. IN A (IP)

    It still doesnt work!

    2. Add a ServerAlias in Apache for *.yourdomain.com
    Okay so do i place <VirtualHost *> or <VirtualHost (IP)>

  9. jaseone
    Inactive
    Posted 18 years ago #

    1. Does that resolve? If the DNS resolves then the DNS is doing it's job.
    2. Depends entirely on your setup as per your first example, you already have:

    <VirtualHost 128.121.20.245>
    ServerAlias xanblog.my3host.com
    ServerAdmin webmaster@xanblog.my3host.com
    DocumentRoot /home/nigel/public_html
    BytesLog domlogs/xanblog.my3host.com-bytes_log
    ServerName http://www.xanblog.my3host.com
    User nigel
    Group nigel
    CustomLog /usr/local/apache/domlogs/xanblog.my3host.com combined
    ScriptAlias /cgi-bin/ /home/nigel/public_html/cgi-bin/
    </VirtualHost>

    All you need to do is change that to:

    <VirtualHost 128.121.20.245>
    ServerAlias xanblog.my3host.com *.xanblog.my3host.com
    ServerAdmin webmaster@xanblog.my3host.com
    DocumentRoot /home/nigel/public_html
    BytesLog domlogs/xanblog.my3host.com-bytes_log
    ServerName http://www.xanblog.my3host.com
    User nigel
    Group nigel
    CustomLog /usr/local/apache/domlogs/xanblog.my3host.com combined
    ScriptAlias /cgi-bin/ /home/nigel/public_html/cgi-bin/
    </VirtualHost>

    Then everything for *.xanblog.my3host.com will resolve to the same place as xanblog.my3host.com.

    It really isn't that difficult to setup so I don't know why more people aren't having problems.

  10. Cruz
    Member
    Posted 18 years ago #

    Jaseone,
    Thank you very much for your explanation.
    I appreciate it.

    Cruz

  11. nigelwong
    Inactive
    Posted 18 years ago #

    I got it workign now, thanks!

About this Topic

  • Started 18 years ago by nigelwong
  • Latest reply from nigelwong