Page 1 of 3 123 Last
  • Jump to page:
    #1
  1. Contributing User
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Jun 2003
    Location
    Thessaloniki
    Posts
    1,402
    Rep Power
    0

    Question Redirection of sub-domain to a wrong domain


    Hello, when ima trying to validate my virtual server "superhost.gr? iam receiving this
    Code:
    SSL website : The SSL certificate for this virtual server does not match superhost.gr or www.superhost.gr. Instead, it matches the hostnames : Nexus i don't know what exactly this mean but if i try to access my personal website as:
    
    http://superhost.gr it loads ok but instead i try to load it as:
    
    http://nexus.superhost.gr instead of being shown my actual website which is http://superhost.gr iam seeing one of the websites i host which is http://ypsilandio.gr
    Now, that i dont have this sub-server why the redirection goes to ypsilandio.gr and not to superhost.gr ?

    Could you please help me fix this issue? Why is this happening?

    Also let me show you part of httpd.conf regarding virtual hosts

    Code:
    [root@nexus ~]# grep -i '<virtualhost' /etc/httpd/conf/httpd.conf 
    # ports, instead of the default. See also the <VirtualHost>
    # <VirtualHost> definition.  These values also provide defaults for
    # any <VirtualHost> containers you may define later in the file.
    # All of these directives may appear inside <VirtualHost> containers,
    # If you do not specify an ErrorLog directive within a <VirtualHost>
    # logged here.  If you *do* define an error logfile for a <VirtualHost>
        # If you do not define any access logfiles within a <VirtualHost>
        # define per-<VirtualHost> access logfiles, transactions will be
    <VirtualHost 104.168.171.101:80>
    <VirtualHost 104.168.171.101:80>
    <VirtualHost 104.168.171.101:443>
    <VirtualHost 104.168.171.101:443>
    <VirtualHost 104.168.171.101:443>
    <VirtualHost 104.168.171.101:80>
    <VirtualHost 104.168.171.101:80>

    i host 4 websites, incliding my own:

    superhost.gr
    varsa.gr
    ypsulandio.gr
    kidsclubpaidika.gr

    and i see 4 entries of 80 and 443 listening

    my VPS server has only 1 ip address which is '104.168.171.101'

    What else i need to do to find where the problem is?
  2. #2
  3. Headless Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    16,971
    Rep Power
    9647
    The SSL cert you're using for superhost.gr is only valid for *.ypsilandio.gr. That also means it's not valid for https://ypsilandio.gr - the cert should cover both the www and non-www versions.

    It's also self-signed which means a browser will not trust it unless your computer has been configured to do so.

    So you're using the wrong cert. Check your virtualhost configuration.
  4. #3
  5. Contributing User
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Jun 2003
    Location
    Thessaloniki
    Posts
    1,402
    Rep Power
    0
    Hello requinix,

    Thanks for helping me out with this.

    Since youa re tellign me this is due to cert i have gone ahead and have de-activated and delete the self-signed certificate and rebooted the VPS but still the mistaken redirection exists.

    Please tell me what info should i post for you to check if there is anythign wrong.
    Perhaps i should attach the 'httpd.conf' file? Will that be of help?
  6. #4
  7. Contributing User
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Jun 2003
    Location
    Thessaloniki
    Posts
    1,402
    Rep Power
    0
    here is the 'httpd.conf' gile if it is of any help:

    https://drive.google.com/open?id=0B_...VhWRE50TjM4UWc
  8. #5
  9. Headless Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    16,971
    Rep Power
    9647
    The redirects aren't caused by the cert problem. You apparently have some configuration somewhere in there that is redirecting - look for that.
  10. #6
  11. Contributing User
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Jun 2003
    Location
    Thessaloniki
    Posts
    1,402
    Rep Power
    0
    i don't see any redirection within httpd.conf, nor i made it on purpose in the past.

    Could you please also take a look ont he file?
  12. #7
  13. Headless Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    16,971
    Rep Power
    9647
    PHP is doing the redirect, not Apache.

    I don't see any "nexus.superhost.gr" in the httpd.conf.
  14. #8
  15. Contributing User
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Jun 2003
    Location
    Thessaloniki
    Posts
    1,402
    Rep Power
    0
    PHP?! Really? How is that possbile?! I only code in Python, i never written anything on PHP on the server.

    FROM WHERE does PHP finds such directive to force redirect?
  16. #9
  17. Headless Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    16,971
    Rep Power
    9647
    You're using PHP.

    I don't know your site so I can't tell you where the redirect is happening.
  18. #10
  19. Contributing User
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Jun 2003
    Location
    Thessaloniki
    Posts
    1,402
    Rep Power
    0
    Originally Posted by requinix
    You're using PHP.

    I don't know your site so I can't tell you where the redirect is happening.


    Yes ypsilandio.gr is a wordpress site so it uses PHP. How did you come up with this gneral info on PHP running? How did you triggered it?

    BUT the redirection happens when someone asks http://nexus.superhost.gr hence ypsilandio.gr is loaded and not the other way around.

    How can i stop this redirection of happening? Whats causing this redirection?
    Is there any way i can find when/where it happens?
  20. #11
  21. Contributing User
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Jun 2003
    Location
    Thessaloniki
    Posts
    1,402
    Rep Power
    0
    I also got a response from VirtualMin Forum mentioning these:

    That doesn't contain the info we need to troubleshoot further, but I think it's just the common problem of having mixed <Virtualhost *:80> and <VirtualHost x.x.x.x:80> definitions. You must have either all *:80 or ip:80 configuration, or the behavior will be too tricky for mere mortals for figure out. That's what all that article is about; how can I make the article clearer that your VirtualHosts all need to either be defined by IPort or by *ort, but not both, and that both results in difficult to reason about behavior? (Behavior that people, including me, interpret as "the wrong site showing up".)

    But in my httpd.conf i use IP:80 and not *:80
  22. #12
  23. Headless Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    16,971
    Rep Power
    9647
    Let me be more clear:
    Originally Posted by requinix
    I don't see any "nexus.superhost.gr" in the httpd.conf.
    You don't have nexus.superhost.gr configured for any virtualhost. That means Apache will pick the first virtualhost for that IP address and port - and that's the ypsilandio.gr site.


    Originally Posted by Nik
    Yes ypsilandio.gr is a wordpress site so it uses PHP. How did you come up with this gneral info on PHP running? How did you triggered it?
    That query string is an easter egg for PHP sites that use certain configurations, and I noticed your site has that configuration.

    And it's not "general info" so relax.
  24. #13
  25. Contributing User
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Jun 2003
    Location
    Thessaloniki
    Posts
    1,402
    Rep Power
    0
    Originally Posted by requinix
    Let me be more clear:
    You don't have nexus.superhost.gr configured for any virtualhost. That means Apache will pick the first virtualhost for that IP address and port - and that's the ypsilandio.gr site.
    .
    By picking the first virtual host you mean that Apache will check its httpd.conf and display the first <virtualhost domain> directive it will see in it?

    Can i just somehow point nexus.superhost.gr to redirect to main domain which is superhost.gr ?
  26. #14
  27. Headless Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    16,971
    Rep Power
    9647
  28. #15
  29. Contributing User
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Jun 2003
    Location
    Thessaloniki
    Posts
    1,402
    Rep Power
    0
    Originally Posted by requinix
    Add it as a ServerAlias to that virtualhost.
    Yes it worked! Thank you! Didn't know that.

    Just out of curiocity if i weren't to use ServerAlias, what i would have needed to do in order for redirection to happen as before
    just as nexus.superhost.gr redirected by itself to ypsilandio.gr ?
Page 1 of 3 123 Last
  • Jump to page:

IMN logo majestic logo threadwatch logo seochat tools logo