Results 1 to 17 of 17
  1. #1
    Join Date
    Aug 2002
    Location
    Utah
    Posts
    25

    How Do i set up Domain Wildcard for Mass Virtual with APACHE?

    I have Bind set all up and I have set the Zone like this
    * IN A 123.123.123.123
    It works and everything. Then I Link the Folder to the user’s directory.
    Like this *.domain.com but it does not work.
    I use this configuration in the httpd.conf

    <VirtualHost 123.123.123.123:80>
    VirtualDocumentRoot /var/www/hosts/%0/
    </VirtualHost>

    Apache just gives me an 404 File Not found whenever I put in *.domain.com in my Internet Browser

    (123.123.123.123 is just an example of an IP)

    If someone could boost me in the right dorecton i would greatly appreciate.

    Thank you

    - Brad
    Last edited by Einewton; 10-18-2002 at 08:04 PM.

  2. #2
    Join Date
    Oct 2001
    Location
    Canada
    Posts
    157
    Pls check mod_rewrite docs.

  3. #3
    Join Date
    Sep 2002
    Location
    Mansfield
    Posts
    314
    A record IP TTL

    www.domain.com 127.127.127.0 900
    mail.domain.com 127.127.127.0 900
    irc.domain.com 127.127.127.0 900 some.domain.com 127.127.127.0 900
    domain.com 127.127.127.0 900



    #<VirtualHost _default_:*>
    #</VirtualHost>
    GUI admin tools have no honor. It is a good day to vi.

  4. #4
    Join Date
    Sep 2002
    Location
    LA, CA
    Posts
    51
    Your A record in bind is fine.

    httpd.conf should have an entry like this:
    <VirtualHost 123.123.123.123:80> # domain.com
    DocumentRoot /usr/www/homedir/httpd/htdocs
    ...
    ServerName domain.com
    ServerAlias *.domain.com
    </VirtualHost>

  5. #5
    Join Date
    Apr 2002
    Location
    Seattle, WA
    Posts
    955
    Originally posted by jlee
    Your A record in bind is fine.

    httpd.conf should have an entry like this:
    <VirtualHost 123.123.123.123:80> # domain.com
    DocumentRoot /usr/www/homedir/httpd/htdocs
    ...
    ServerName domain.com
    ServerAlias *.domain.com
    </VirtualHost>
    That would work fine if you want everything to go to one site, but it didn't sound like that is what he wanted... ?


    Are you trying to do something to the effect of...

    blah.domain.com going to /var/www/hosts/blah
    eck.domain.com going to /var/www/hosts/eck

    without having to mess with the apache config all the time? like to automate something? or am i just waaayy off base her?

  6. #6
    Join Date
    Aug 2002
    Location
    Utah
    Posts
    25
    without having to mess with the apache config all the time? like to automate something? or am i just waaayy off base her?
    No, you are right on, but, I have that all set up, I have current sub domains setup already, but i would like for all non-existing sub domains go to a certain page.
    Last edited by Einewton; 10-19-2002 at 12:06 PM.

  7. #7
    Have you tried: *.yourdomain.com. IN A 123.123.123.123 (TTL)?
    AceWebHosting.Com
    Cheap Web Hosting - Multiple Domain Hosting - Reseller Hosting - Virtual Private Server

  8. #8
    Join Date
    Aug 2002
    Location
    Utah
    Posts
    25
    My Bind works
    But i belive it's apache
    Because it gives me a 404 file not found.
    i would like to know how to set up apache so that it will reconize that it's not avabile and go to a certian page. and adding the (TTL) did not correct this problem.

    Thank you all for your Help. I hope we get this problem resolved so that anyone that wants this simular thing will beable to see how to do it.

  9. #9
    Join Date
    Sep 2002
    Location
    Mansfield
    Posts
    314
    If you're getting a 404 then the answer is in the error log - that will tell you where it's looking.
    GUI admin tools have no honor. It is a good day to vi.

  10. #10
    Join Date
    Sep 2002
    Location
    LA, CA
    Posts
    51
    post all of your apache config from <VirtualHost.... down.

  11. #11
    Join Date
    Aug 2002
    Location
    Utah
    Posts
    25
    post all of your apache config from <VirtualHost.... down.

    <VirtualHost 123.123.123.123:80>
    VirtualDocumentRoot /var/www/hosts/%0/
    </VirtualHost>

    Well here is the thing. apache looks for whateveryouputin.domain.com
    I would like to make apache redirect whateveryouputin.domain.com to a certian page.

    I currently have Dynamically Configured Mass Virtual Hosting with APACHE.

    This is what i have and i want to keep thoes subdomains pointing there.

    name.domain.com --> /home/name/
    friend.domain.com --> /home/friend/

    I would like to add the feature so i do not have to add subdomains that do not exist.

    whateveranyonetypesin.domain.com --> /home/website/
    sdjflvodsfoiv.domain.com --> /home/website/
    kvoewoie.domain.com --> /home/website/
    anything1234.domain.com --> /home/website/

  12. #12
    Join Date
    Aug 2002
    Location
    Utah
    Posts
    25
    The only reason it's giving me a 404 is beacuse i dont have the non-existing subdomain link to tell apache where to look when it recives a request for the non existant subdomain.

    So my question again is, How do i configure apache to direct a non existing subdomain to a certain area on the server?

  13. #13
    Join Date
    Sep 2002
    Location
    LA, CA
    Posts
    51
    email me your httpd.conf. ill fix it for you. jlee15@pacbell.net

  14. #14
    I don't know why you have problem with Apache because with my domain i just added: * 1200 IN A 123.123.133.123 to /var/named/mydomain.com.db and then if I try whatever.mydomain.com I'll be served by mydomain.com
    AceWebHosting.Com
    Cheap Web Hosting - Multiple Domain Hosting - Reseller Hosting - Virtual Private Server

  15. #15
    Join Date
    Sep 2002
    Location
    Mansfield
    Posts
    314
    Originally posted by Einewton
    The only reason it's giving me a 404 is beacuse i dont have the non-existing subdomain link to tell apache where to look when it recives a request for the non existant subdomain.
    You're getting a 404 because there is no page where it's looking, and where it's looking is right in error log.

    What Does It Say In The Logs?(tm)
    GUI admin tools have no honor. It is a good day to vi.

  16. #16
    Join Date
    Aug 2002
    Location
    Utah
    Posts
    25
    Here is what My Logs say.

    Access Log
    --------------
    asdfnlkjsjfkskjdfhls.domain.com 123.123.123.123 - - [19/Oct/2002:20:21:59 -0600] "GET / HTTP/1.1" 404 304
    combined

    Error Log
    ------------
    [Sat Oct 19 20:21:59 2002] [error] [client 123.123.123.123] File does not exist: /var/www/hosts/asdfnlkjsjfkskjdfhls.domain.com
    Last edited by Einewton; 10-19-2002 at 10:31 PM.

  17. #17
    Join Date
    Aug 2002
    Location
    Utah
    Posts
    25
    I don't know why you have problem with Apache because with my domain i just added: * 1200 IN A 123.123.133.123 to /var/named/mydomain.com.db and then if I try whatever.mydomain.com I'll be served by mydomain.com
    It would work if I did not have any subdomains and if i did my VirtualHosting Diffrently. right now i am using Dynamically Configured Mass Virtual Hosting (DCMVH)

Posting Permissions

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