top level domain redirected to subdomain (hostname of server)

Discussion in 'Installation/Configuration' started by asdru, Oct 28, 2019.

  1. asdru

    asdru New Member

    hi to all,
    i setup new vps ISPConfig version is 3.1.15p2 with: debian 9.11, apache + php-fpm and single ip address
    hostname is manage.mydomain.com
    then i setup new client > new site mydomain.com
    Into dns zone of mydomain.com i create A record manage.mydomain.com point to ispconfig
    but mydomain.con for now point to other hosting (I will change the address when I have done the server setup)
    into my local hosts file i setup ip of ispconfig pointing to mydomain.com
    When i go to domain.com ispconfig redirect me to documentroot of manage.domain.com instead of documentroot of mydomain.com

    i have attached report generated by htf-common-issues.php

    How can fix?
    Any suggestions?
    Thank in advance
     

    Attached Files:

  2. asdru

    asdru New Member

    I cannot edit original message.

    Edit:
    When i go to domain.com i get unable to connect
    but when i go to manage.bigbonus.it port 80 ispconfig redirect me to documentroot of mydomain.com instead of default documentroot of manage.mydomain.com port 80.

    WAS: When i go to domain.com ispconfig redirect me to documentroot of manage.domain.com instead of documentroot of mydomain.com
     
  3. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    Try Internet Search Enginnes with
    Code:
    site:howtoforge.com wrong website shown
     
    asdru likes this.
  4. asdru

    asdru New Member

    Thank for your reply.
    Resolved half problem. Now default page when browse manage.mydomain.com is correct.
    But i can't connect to mydomain.com the site enebled. Browser get unable to connect

    Here output for command apache2ctl -S
    Code:
    AH00548: NameVirtualHost has no effect and will be removed in the next release /etc/apache2/sites-enabled/000-ispconfig.conf:73
    VirtualHost configuration:
    *:8081   manage.mydomain.com (/etc/apache2/sites-enabled/000-apps.vhost:9)
    *:8080   manage.mydomain.com (/etc/apache2/sites-enabled/000-ispconfig.vhost:9)
    *:80     is a NameVirtualHost
             default server manage.mydomain.com (/etc/apache2/sites-enabled/000-default.conf:1)
             port 80 namevhost manage.mydomain.com (/etc/apache2/sites-enabled/000-default.conf:1)
             port 80 namevhost mydomain.com (/etc/apache2/sites-enabled/100-mydomain.com.vhost:7)
                     alias www.mydomain.com
    *:443    is a NameVirtualHost
             default server manage.mydomain.com (/etc/apache2/sites-enabled/000-default-ssl.conf:2)
             port 443 namevhost manage.mydomain.com (/etc/apache2/sites-enabled/000-default-ssl.conf:2)
             port 443 namevhost mydomain.com (/etc/apache2/sites-enabled/100-mydomain.com.vhost:114)
             alias www.mydomain.com
    
    
    Other test
    nmap -p 80 manage.mydomain.com
    Code:
    Starting Nmap 7.60 ( https://nmap.org ) at 2019-10-28 15:56 CET
    Nmap scan report for manage.mydomain.com (xxx.xxx.xxx.xxx)
    Host is up (0.029s latency).
    PORT   STATE SERVICE
    80/tcp open  http
    Nmap done: 1 IP address (1 host up) scanned in 0.09 seconds
    
    nmap -p 80 mydomain.com
    Code:
    Starting Nmap 7.60 ( https://nmap.org ) at 2019-10-28 15:57 CET
    Nmap scan report for mydomain.com (xxx.xxx.xxx.xxx)
    Host is up (0.032s latency).
    PORT   STATE  SERVICE
    80/tcp closed http
    Nmap done: 1 IP address (1 host up) scanned in 0.26 seconds
    
     
  5. Steini86

    Steini86 Active Member

    You didn't show this, but is the IP address actually the same? Seems not to be the case, you get two different outputs. Are your DNS entries correct? (Try with tool "dig")
    Do you connect via HTTPS (port 443?) Have you set up SSL correctly for both domains?
     
  6. asdru

    asdru New Member

    yes are the same ip for manage.mydomain and mydomain
    dns for manage.mydomain.com has A record on main DNS ZONE.
    But mydomain.com is set into my local hosts file. Same IP as manage.mydomain.com.
    Yes i can connect to https on manage.mydomain.com, self signed ssl.
    I setup ssl self signed ssl for added site mydomain.com, into ispconfig > sites > mydomain.com

    Here output dig manage.mydomain.com
    Code:
    ; <<>> DiG 9.11.3-1ubuntu1.9-Ubuntu <<>> manage.mydomain.com
    ;; global options: +cmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 37555
    ;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 1
    
    ;; OPT PSEUDOSECTION:
    ; EDNS: version: 0, flags:; udp: 65494
    ;; QUESTION SECTION:
    ;manage.mydomain.com.       IN   A
    
    ;; ANSWER SECTION:
    manage.mydomain.com.   6152   IN   A   185.224.xxx.xxx
    manage.mydomain.com.   6152   IN   A   185.244.xxx.xxx
    
    ;; Query time: 0 msec
    ;; SERVER: 127.0.0.53#53(127.0.0.53)
    ;; WHEN: Tue Oct 29 08:11:10 CET 2019
    ;; MSG SIZE  rcvd: 79
    
    
    Here output for dig mydomain.com (my local pc)
    Code:
    dig mydomain.com
    
    ; <<>> DiG 9.11.3-1ubuntu1.9-Ubuntu <<>> mydomain.com
    ;; global options: +cmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 56032
    ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
    
    ;; OPT PSEUDOSECTION:
    ; EDNS: version: 0, flags:; udp: 65494
    ;; QUESTION SECTION:
    ;mydomain.com.           IN   A
    
    ;; ANSWER SECTION:
    mydomain.com.       0   IN   A   185.224.xxx.xxx
    
    ;; Query time: 0 msec
    ;; SERVER: 127.0.0.53#53(127.0.0.53)
    ;; WHEN: Tue Oct 29 08:12:46 CET 2019
    ;; MSG SIZE  rcvd: 56
    
    into isconfig DNS server is disabled.
    I also try to reinstall entire vps and ispconfig, same results.
     
  7. Steini86

    Steini86 Active Member

    Why do you get different results for the nmap then? Is there a firewall inbetween? Any "malware scanner" messing up your connection?
    Post the difference of files /etc/apache2/sites-enables/mydomain.com and manage.mydomain (you can use diff command if you like)
     
  8. asdru

    asdru New Member

    Found a mistake into my local hosts, now i see all domain.
    thank to all
     
    till likes this.

Share This Page