all subdomains work except www

Discussion in 'Installation/Configuration' started by jasondavis87, Jul 11, 2011.

  1. jasondavis87

    jasondavis87 New Member

    Hello all,

    I've searched the forums but didn't find anything on this:

    My issue is that I have a website: domain.com
    In my website i need all subdomains to goto the same place. I have a php file that parses the subdomain out and displays different data. So for example, example1.domain.com, example2.domain.com, example3.domain.com need to point to the same place and the php script will handle displaying the different data.

    I've gotten everything to work, except "www.domain.com"

    Here's the other catch: i can ping and trace-route the "www.domain.com" and the "domain.com" and everything else and they come back with successful pings and correct IP address for traceroute.

    I thought it was my DNS settings at first but since ping and trace-route work i'm not sure. either way, just to put all the information out there, I currently have these settings in my DNS:
    Code:
    www    A    300    123.123.123.123
    @        A    300    123.123.123.123
    @        ns   7200  ns1.zoneedit.com
    @        ns   7200  ns2.zoneedit.com
    These are my current settings. I've tried using the fqdm, "www.domain.com." tried using www CNAME 7200 domain.com, tried using * A 300 123.123.123.123. Those didnt work either.

    Now for my ISPConfig, I run CentOS 5.5 x64 and followed the perfect server guidelines for setting this up from this website. I should state, I am using a VPS from fanaticalvps.com as well. There were some things i wasnt able to do and found workarounds for them, but this was with BIND server, which i currently have turned off due to using zoneedit.com DNS and suPHP(i think). From what i read, this is due to the fact that I was using a vps.

    In ISPConfig, I've created the website, the ftp connection for this and that all works, email works, etc. I set the website to use domains for all 3 options for subdomains, "none", "www", "*" - all actually produce the same result: all subdomains work except "www."

    Any Help is appriciated. Thanks
     
  2. jasondavis87

    jasondavis87 New Member

    Mistake

    Ok so i just made a mistake and accidently deleted the site. (thought i was deleting a subdomain). - I've got everything back up and running and same problem.

    This time however, I had to add a dns record:

    * A 300 123.123.123.123

    Without this the other sub-domains didnt work. Now its back to everything works but www.domain.com
     
  3. falko

    falko Super Moderator

    Can you post the Apache vhost configuration of domain.com?
     
  4. jasondavis87

    jasondavis87 New Member

    Code:
    <Directory /var/www/domain.com>
        AllowOverride None
        Order Deny,Allow
        Deny from all
    </Directory>
    
    <VirtualHost *:80>
          DocumentRoot /var/www/domain.com/web
    
        ServerName domain.com
        ServerAlias www.domain.com
        ServerAdmin webmaster@domain.com
    
        ErrorLog /var/log/ispconfig/httpd/domain.com/error.log
    
    
        ErrorDocument 400 /error/400.html
        ErrorDocument 401 /error/401.html
        ErrorDocument 403 /error/403.html
        ErrorDocument 404 /error/404.html
        ErrorDocument 405 /error/405.html
        ErrorDocument 500 /error/500.html
        ErrorDocument 503 /error/503.html
    
        <Directory /var/www/domain.com/web>
            Options FollowSymLinks
            AllowOverride All
            Order allow,deny
            Allow from all
        </Directory>
        <Directory /var/www/clients/client1/web5/web>
            Options FollowSymLinks
            AllowOverride All
            Order allow,deny
            Allow from all
        </Directory>
    
    
        # Clear PHP settings of this website
        <FilesMatch "\.ph(p3?|tml)$">
            SetHandler None
        </FilesMatch>
        # mod_php enabled
        AddType application/x-httpd-php .php .php3 .php4 .php5
        php_admin_value sendmail_path "/usr/sbin/sendmail -t -i -fwebmaster@domain.com"
        php_admin_value upload_tmp_dir /var/www/clients/client1/web5/tmp
        php_admin_value session.save_path /var/www/clients/client1/web5/tmp
            # PHPIniDir /var/www/conf/web5
        php_admin_value open_basedir /var/www/clients/client1/web5/web:/var/www/clients/client1/web5/tmp:/var/www/domain.com$
    
        # add support for apache mpm_itk
        <IfModule mpm_itk_module>
          AssignUserId web5 client1
        </IfModule>
    
        <IfModule mod_dav_fs.c>
          # DO NOT REMOVE THE COMMENTS!
          # IF YOU REMOVE THEM, WEBDAV WILL NOT WORK ANYMORE!
          # WEBDAV BEGIN
          # WEBDAV END
        </IfModule>
    
    
    </VirtualHost>
    
    
     
  5. jasondavis87

    jasondavis87 New Member

    Wow ... I'm an idiot ... I just found the issue:

    I forgot that I changed my c:\windows\system32\drivers\etc\hosts File to redirect my www.domain.com to my internal IP because i used to host it from my house and the router couldnt handle the loop back.

    Thanks everyone for your help.
     

Share This Page