Virtual Sites & DNS Setup

Discussion in 'Installation/Configuration' started by Jayson Wonder, Nov 29, 2008.

  1. Jayson Wonder

    Jayson Wonder New Member

    Hi,

    I have read many atricles on here abotu DNS but maybe I am dumb or I just can't grasp the concept.

    I am asking for step by step instructions on how to setup my Fedora 9 with ISPConfig server to work with virtual sites. I do not uderstand hwo to set up the DNS on the sites or in ISPConfig to work with anything.

    At this point I only want to get this to work onmy local / private network for testing. I am not good enuff to run my sites live yet.

    I have the server with an IP address of 192.168.1.200 and the name is server.domain.com.

    I want to be able to access various virtual hosts / sites but do not know what to do.

    Please advise. After the Perfect Server install guide, I am feeling left hanging with no clear help on this type of setup.

    Thanks in advance
     
  2. zcworld

    zcworld New Member

    ok simple fix to ur problem

    ok i take it that ur work station is windows ?
    or is it linux
    if its linux than im on the other ATM
    if its windows
    i can help with easy


    step 1 .
    control panel -> network or Network and Sharing Center ( if in vista)
    step 2
    find Local Area Connection -> View status -> Properties -> click the continue box that's pops up

    step 3.
    Internet Protocol ver 4 ( TCP/IPv4)

    step 4.
    Use The Following DNS Servers Addresses
    add in your ISPconfig box IP address
    than your Router / ISP DNS Server as the second one

    than click on ok ok ok to close the local Area Connection windows and make the changes to the DNS settings


    this will let you use your DNS on your WWW box as fist DNS it looks at
    so any sites you got there it will find them for you


    PM / IM me if u need help ...
     
  3. Jayson Wonder

    Jayson Wonder New Member


    Hi,

    thanks,I did this but I still cannot reach the sites on the server setup with ISPconfig. Maybe I have them setup wrong or missing something.

    My server is at 192.168.1.200 with a name server.mydomain.com
    I have setup a new virtual site at 192.168.1.201 with a name myvirtual.com

    What is wrong becasue now I cannot reach either site by domain or IP. Maybe I need something in ISPConfig DNS Management under master or slave or prt?

    Any thought are aprreciated!
     
  4. falko

    falko Super Moderator

  5. Jayson Wonder

    Jayson Wonder New Member

    Yes, thanks, I went and read that thread. I tottaly get this part and have done this on my clients but I still cannot reach any virtual sites.

    I can now reach the server home page which is www.mydomain.com on the main server IP 192.168.1.200

    Prob is I cannot reach the virtual sites I create using additional IP's such as:

    192.168.1.201 www.virtualdomain.com

    I have entered them into the clients host file as well.

    What am I missing.
     
  6. zcworld

    zcworld New Member

    can u do an dig command

    type in
    on your linux box

    dig @localhost mysite.com

    you should get an display printout like this

    [zcworld@server1 ~]$ dig @localhost vdb.site.lan

    ; <<>> DiG 9.5.0b2 <<>> @localhost vdb.site.lan
    ; (1 server found)
    ;; global options: printcmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 20108
    ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

    ;; QUESTION SECTION:
    ;vdb.site.lan. IN A

    ;; ANSWER SECTION:
    vdb.site.lan. 86400 IN A 192.168.1.25

    ;; Query time: 11 msec
    ;; SERVER: 127.0.0.1#53(127.0.0.1)
    ;; WHEN: Mon Dec 1 07:21:12 2008
    ;; MSG SIZE rcvd: 46

    [zcworld@server1 ~]$

    if so than change it from @localhost to the @IPADDRESS And see if thats works for you : if both not working than your DNS is the problem there as far as i can tell
     
  7. Jayson Wonder

    Jayson Wonder New Member

    This is what the output of dig gives me:
    Code:
    ; <<>> DiG 9.5.0-P2 <<>> @localhost www.testdomain.com
    ; (1 server found)
    ;; global options:  printcmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 50144
    ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 0
    
    ;; QUESTION SECTION:
    ;www.testdomain.com.            IN      A
    
    ;; ANSWER SECTION:
    www.testdomain.com.     86400   IN      A       192.168.1.201
    
    ;; AUTHORITY SECTION:
    testdomain.com.         86400   IN      NS      192.168.1.1.
    testdomain.com.         86400   IN      NS      192.168.1.200.
    
    ;; Query time: 5 msec
    ;; SERVER: 127.0.0.1#53(127.0.0.1)
    ;; WHEN: Sun Nov 30 18:42:19 2008
    ;; MSG SIZE  rcvd: 104
    If i read this correctly I should be good but why no site?
     
  8. falko

    falko Super Moderator

    What happens when you type www.virtualdomain.com into your browser?
    Are there any errors in the logs on the server?
     
  9. Jayson Wonder

    Jayson Wonder New Member

    Well no, that is what seem so wierd. Unless I am not sure where to look for this type of errors.

    All I get is a Sharred IP page when I use main apache at either the IP address of: 192.168.1.200 or the domain: mydomain.com.

    If I attempt to reach my first virtual site at: 192.168.1.201 or virtualdomain.com I simply get an Internet Explorer cannot display the webpage error.

    Please advise where I should look for potential error or glitch. I am so desperate to solve this.

    Thanks to everyone so far for trying to help me out!!!
     
  10. falko

    falko Super Moderator

    What's the output of
    Code:
    ifconfig
    , and what's in Vhosts_ispconfig.conf?
     
  11. Jayson Wonder

    Jayson Wonder New Member

    Here is my ifconfig:
    Code:
    lo        Link encap:Local Loopback
              inet addr:127.0.0.1  Mask:255.0.0.0
              inet6 addr: ::1/128 Scope:Host
              UP LOOPBACK RUNNING  MTU:16436  Metric:1
              RX packets:1227 errors:0 dropped:0 overruns:0 frame:0
              TX packets:1227 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:0
              RX bytes:62412 (60.9 KiB)  TX bytes:62412 (60.9 KiB)
    
    wlan0     Link encap:Ethernet  HWaddr 00:1E:58:9E:37:02
              inet addr:192.168.1.200  Bcast:192.168.1.255  Mask:255.255.255.0
              inet6 addr: fe80::21e:58ff:fe9e:3702/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:5478 errors:0 dropped:0 overruns:0 frame:0
              TX packets:4667 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000
              RX bytes:5095426 (4.8 MiB)  TX bytes:779749 (761.4 KiB)
    
    wmaster0  Link encap:UNSPEC  HWaddr 00-1E-58-9E-37-02-F4-4F-00-00-00-00-00-00-00-00
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:0 errors:0 dropped:0 overruns:0 frame:0
              TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000
              RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)
    
    And here is the Vhosts_ispconfig.conf:
    Code:
    ###################################
    #
    # ISPConfig vHost Configuration File
    #         Version 1.0
    #
    ###################################
    #
    NameVirtualHost 192.168.1.200:80
    <VirtualHost 192.168.1.200:80>
      ServerName localhost
      ServerAdmin root@localhost
      DocumentRoot /var/www/sharedip
      <IfModule mod_rewrite.c>
        RewriteEngine on
        RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK)
        RewriteRule .* - [F]
      </IfModule>
    </VirtualHost>
    NameVirtualHost 192.168.1.201:80
    <VirtualHost 192.168.1.201:80>
      ServerName localhost
      ServerAdmin root@localhost
      DocumentRoot /var/www/sharedip
      <IfModule mod_rewrite.c>
        RewriteEngine on
        RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK)
        RewriteRule .* - [F]
      </IfModule>
    </VirtualHost>
    #
     
  12. falko

    falko Super Moderator

    There's nothing else in Vhosts_ispconfig.conf?
    Can you go to the directory where Vhosts_ispconfig.conf is located and post the output of
    Code:
    ls -la
    ?
     
  13. Jayson Wonder

    Jayson Wonder New Member

    Here is the entire Vhosts_ispconfig.conf file, I think I missed some text when I cut and paste:
    Code:
    ######################################
    # Vhost: www.virtualdomain.com:80
    ######################################
    #
    #
    <VirtualHost 192.168.1.201:80>
    ServerName www.virtualdomain.com:80
    ServerAdmin webmaster@virtualdomain.com
    DocumentRoot /var/www/web6/web
    ServerAlias testdomain.com
    DirectoryIndex index.html index.htm index.php index.php5 index.php4 index.php3 index.shtml index.cgi index.pl index.jsp Default.htm default.htm
    ErrorLog /var/www/web6/log/error.log
    Alias /error/ "/var/www/web6/web/error/"
    ErrorDocument 400 /error/invalidSyntax.html
    ErrorDocument 401 /error/authorizationRequired.html
    ErrorDocument 403 /error/forbidden.html
    ErrorDocument 404 /error/fileNotFound.html
    ErrorDocument 405 /error/methodNotAllowed.html
    ErrorDocument 500 /error/internalServerError.html
    ErrorDocument 503 /error/overloaded.html
    AliasMatch ^/~([^/]+)(/(.*))? /var/www/web6/user/$1/web/$3
    AliasMatch ^/users/([^/]+)(/(.*))? /var/www/web6/user/$1/web/$3
    <IfModule mod_rewrite.c>
      RewriteEngine on
      RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK)
      RewriteRule .* - [F]
    </IfModule>
    </VirtualHost>
    #
    #
    #
    ls -ls output is:
    Code:
    total 16
    drwxr-xr-x 2 root root 4096 2008-11-24 23:31 .
    drwxr-xr-x 3 root root 4096 2008-11-24 23:20 ..
    -rw-r--r-- 1 root root 1830 2008-12-02 21:25 Vhosts_ispconfig.conf
    -rw-r--r-- 1 root root 1830 2008-12-02 21:25 Vhosts_ispconfig.conf~
     
  14. falko

    falko Super Moderator

    Ok, you have a ServerName of www.virtualdomain.com and a ServerAlias of testdomain.com - this means you can use either www.virtualdomain.com or testdomain.com in your browser, nothing else - not virtualdomain.com (without www), not www.testdomain.com, etc.
     
  15. Jayson Wonder

    Jayson Wonder New Member

    I see that. I found it strange as I had deleted the testdomain.com site earlier. It was from a first test tried with failure.

    I have deleted all sites and all DNS entries in ISPConfig. Gonna start from scratch again. My Vhosts_ispconfig.conf is now empty as well.

    I am tempted to reinstall ISPConfig but I fear I might only make things worse if I do not remove properly.

    I have deleted all clients and resellers in ISPConfig, only my admin account and I will attempt to create 1 new client called Test and 1 new site called testvsite.com and still have nothing but "Internet Explorer cannot display the webpage"

    here is what is in my new Vhosts_ispconfig.conf output:
    Code:
    ###################################
    #
    # ISPConfig vHost Configuration File
    #         Version 1.0
    #
    ###################################
    #
    NameVirtualHost 192.168.1.200:80
    <VirtualHost 192.168.1.200:80>
      ServerName localhost
      ServerAdmin root@localhost
      DocumentRoot /var/www/sharedip
      <IfModule mod_rewrite.c>
        RewriteEngine on
        RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK)
        RewriteRule .* - [F]
      </IfModule>
    </VirtualHost>
    NameVirtualHost 192.168.1.201:80
    <VirtualHost 192.168.1.201:80>
      ServerName localhost
      ServerAdmin root@localhost
      DocumentRoot /var/www/sharedip
      <IfModule mod_rewrite.c>
        RewriteEngine on
        RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK)
        RewriteRule .* - [F]
      </IfModule>
    </VirtualHost>
    #
    #
    ######################################
    # Vhost: www.testvsite.com:80
    ######################################
    #
    #
    <VirtualHost 192.168.1.201:80>
    ServerName www.testvsite.com:80
    ServerAdmin webmaster@testvsite.com
    DocumentRoot /var/www/web8/web
    ServerAlias testvsite.com
    DirectoryIndex index.html index.htm index.php index.php5 index.php4 index.php3 index.shtml index.cgi index.pl index.jsp Default.htm default.htm
    ErrorLog /var/www/web8/log/error.log
    Alias /error/ "/var/www/web8/web/error/"
    ErrorDocument 400 /error/invalidSyntax.html
    ErrorDocument 401 /error/authorizationRequired.html
    ErrorDocument 403 /error/forbidden.html
    ErrorDocument 404 /error/fileNotFound.html
    ErrorDocument 405 /error/methodNotAllowed.html
    ErrorDocument 500 /error/internalServerError.html
    ErrorDocument 503 /error/overloaded.html
    AliasMatch ^/~([^/]+)(/(.*))? /var/www/web8/user/$1/web/$3
    AliasMatch ^/users/([^/]+)(/(.*))? /var/www/web8/user/$1/web/$3
    <IfModule mod_rewrite.c>
      RewriteEngine on
      RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK)
      RewriteRule .* - [F]
    </IfModule>
    </VirtualHost>
    #
    #
    #
    I figure something still wrong as I can't get the www.testvsite.com to come up in a browser by domain or ip address. I can reach the localhost page if that means anything.

    I dunno if it is time to reinstall the entire OS and start again, it just seems odd. Not sure what I am doing wrong. I do appreciate the help you have been providing. I just don't get what is wrong here.
     
  16. falko

    falko Super Moderator

    What's at the end of your httpd.conf? Is Vhosts_ispconfig.conf included there?
     
  17. Jayson Wonder

    Jayson Wonder New Member

    Yes it is the last line in that file. Any other places to detect and error? This is strange. Do you recommed that I try to romove and reinstall my ISPConfig or reinstal the entire distribution?

    Thanks,
     
  18. falko

    falko Super Moderator

    So you have put www.testvsite.com into your client PC's host file and still cannot connect to the web site?

    What does
    Code:
    nslookup www.testvsite.com
    on the client return (you can run this command even on a Windows box)?
     
  19. Jayson Wonder

    Jayson Wonder New Member

    Yes, I have the following line in my host file on my windows client:
    Code:
    192.168.1.201	www.testvsite.com	testvsite.com
    From the windows box nslookup output is:
    Code:
    Microsoft Windows [Version 6.0.6001]
    Copyright (c) 2006 Microsoft Corporation.  All rights reserved.
    
    C:\Users\LDJ>nslookup www.testvsite.com
    Server:  UnKnown
    Address:  192.168.1.200
    
    *** UnKnown can't find www.testvsite.com: Non-existent domain
    
    And nslookup from the server console I get this output:
    Code:
    Server:         192.168.1.1
    Address:        192.168.1.1#53
    
    ** server can't find testvsite.com: NXDOMAIN
    So I am assuming there is a DNS problem...

    I tried to ping www.testvsite.com and get this output:
    Code:
    From 192.168.1.200 icmp_seq=50 Destination Host Unreachable
    From 192.168.1.200 icmp_seq=51 Destination Host Unreachable
    From 192.168.1.200 icmp_seq=52 Destination Host Unreachable
    From 192.168.1.200 icmp_seq=54 Destination Host Unreachable
    From 192.168.1.200 icmp_seq=55 Destination Host Unreachable
    From 192.168.1.200 icmp_seq=56 Destination Host Unreachable
    
    I'm not having much luck...
     
    Last edited: Dec 7, 2008
  20. falko

    falko Super Moderator

    Are you using some kind of personal firewall on your Windows system that prevents that the hosts file can be altered or that the entries in that file are followed?
     

Share This Page