Results 1 to 6 of 6
  1. #1

    Question Subdomains revisited

    After replacing the HD in my XP server I decided to give Apache 2.0 a try. So what am I doing wrong here. All my subdomains resolve to the main webpage of my domain, and not their own. I can configure Apache to serve just my domain, and I can configure it to serve my domain as a Vhost, but none of the subdomains end up at the proper page. They all end up back at my domain. I have a static IP address, and the server is behind a router. But that wasn't an Issue before (with apache 1.*). Here is a sample of what I have setup. Where did this go wrong?

    NameVirtualHost *:80

    <VirtualHost *:80>
    ServerAdmin [email protected]
    DocumentRoot C:\webpages\mydomain
    ServerName mydomain.com
    ErrorLog logs/mydomain.com-error_log
    CustomLog logs/mydomain.com-access_log
    </VirtualHost>

    <VirtualHost *:80>
    ServerAdmin [email protected]
    DocumentRoot C:\webpages\hosts\host1
    ServerName host1.mydomain.com
    ErrorLog logs/host1.mydomain.com-error_log
    CustomLog logs/host1.mydomain.com-access_log
    </VirtualHost>

    If any of you can straighten out my mess I would appreciate it.

  2. #2
    Join Date
    Dec 2002
    Location
    Quad Cities, Iowa
    Posts
    1,597
    I am not sure about Windows. But on Linux you have to restart apache after making changes. So give that a shot if you haven't already. Other than that, the configuration you posted above looks as it should.

    Best of Luck!
    Need a new Web Host?
    Become a Host Refugee and receive TRUE 24/7 Support

    cPanel + Fantastico, PHP4 or PHP5
    HostRefugee.com - See our current promotions

  3. #3
    Once a change is made to the apache configuration file it should be restarted.

    Also do check whether the document root for your subdomains ar specified correctly.

  4. #4
    yea ive been restarting it every time. i just cant get the thing to work. i think im going crazy because it all looks good to me.

  5. #5
    Join Date
    Sep 2004
    Location
    New Jersey
    Posts
    104
    To access your virtual host you're using http://host1.mydomain.com and not http://www.host1.mydomain.com by mistake, correct?

    Brian
    Colynx, LLC. (http://www.colynx.com)
    Providing inexpensive Web, email, DNS hosting, and more. Now offering $8/yr domain registrations. Name your own price for hosting. Hosting should be on YOUR terms.

  6. #6
    Join Date
    Dec 2002
    Location
    Quad Cities, Iowa
    Posts
    1,597
    Try this:

    <VirtualHost *:80>
    ServerAdmin [email protected]
    DocumentRoot C:\webpages\mydomain
    ServerName www.mydomain.com
    ServerAlias www.mydomain.com mydomain.com
    ErrorLog logs/mydomain.com-error_log
    CustomLog logs/mydomain.com-access_log
    </VirtualHost>

    <VirtualHost *:80>
    ServerAdmin [email protected]
    DocumentRoot C:\webpages\hosts\host1
    ServerName www.host1.mydomain.com
    ServerAlias www.host1.mydomain.com host1.mydomain.com
    ErrorLog logs/host1.mydomain.com-error_log
    CustomLog logs/host1.mydomain.com-access_log
    </VirtualHost>
    Need a new Web Host?
    Become a Host Refugee and receive TRUE 24/7 Support

    cPanel + Fantastico, PHP4 or PHP5
    HostRefugee.com - See our current promotions

Posting Permissions

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