#16
  1. 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.

    And it's not "general info" so relax.
    So you are saying that if i go to superhost.gr domain's DNS records and add lets say nikos.superhost.gr as an entry then apache will redirect nikos.superhost.gr => ypsilandio.gr too because the latter is the firtst virtualhost to be found withing httpd.conf ?
  2. #17
  3. Headless Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    16,966
    Rep Power
    9647
    Originally Posted by Nik
    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 ?
    What?

    Originally Posted by Nik
    So you are saying that if i go to superhost.gr domain's DNS records and add lets say nikos.superhost.gr as an entry then apache will redirect nikos.superhost.gr => ypsilandio.gr too because the latter is the firtst virtualhost to be found withing httpd.conf ?
    Yes. It doesn't actually have anything to do with DNS - any request for a hostname that isn't configured will go to the default virtualhost.
  4. #18
  5. Contributing User
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Jun 2003
    Location
    Thessaloniki
    Posts
    1,402
    Rep Power
    0
    Originally Posted by requinix
    What?


    Yes. It doesn't actually have anything to do with DNS - any request for a hostname that isn't configured will go to the default virtualhost.
    I see now!
    So even if i haven't set it as such, 'ypsilandio.gr' is the configured default virtualhost for Apache? But how!? i haven't set it as such.

    If that is the case then how can i set 'superhost.gr' which is my primary domain as the default virtualhost?
  6. #19
  7. Headless Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    16,966
    Rep Power
    9647
    The "default" is the first one Apache finds, generally.

    You don't really need to worry about which host acts as the default as long as all the hostnames going to that server are represented with virtualhosts. That was the problem with your setup: not that Apache was serving the wrong site but that you didn't have the super site setup.
  8. #20
  9. Contributing User
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Jun 2003
    Location
    Thessaloniki
    Posts
    1,402
    Rep Power
    0
    Originally Posted by requinix
    The "default" is the first one Apache finds, generally.

    You don't really need to worry about which host acts as the default as long as all the hostnames going to that server are represented with virtualhosts. That was the problem with your setup: not that Apache was serving the wrong site but that you didn't have the super site setup.
    So, i need to declare each hostname i want to use

    1. by adding a respective DNS Record Entry for that hostname of the domain
    2. Adding ServerAlias of that hostname to the the domain i want to be defaulted into.

    Correct?

    But in general, if i want all requests for hostnames that exist or hostanmes that do NOT exist to be defaulted to main 'superhost.gr'
    what directives should i use?

    for example:

    nikos.superhost.gr
    giorgos.superhost.gr
    kostas.superhost.gr
    petros.superhost.gr
    dimitris.superhost.gr

    etc,

    1. i need to create a DNS Record entry for each hostname to the domain zone i want

    2, can i avoid creating ServerAlias foe each and every host, even for the one i dont have?
    Last edited by Nik; May 29th, 2017 at 06:52 AM.
  10. #21
  11. Headless Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    16,966
    Rep Power
    9647
    1. A DNS record lets other people access your site. If you want them to do that then you need one.
    2. ServerAlias is for other hostnames besides the main one. Like you'd have a ServerName for Example Domain and a ServerAlias for example.com (or vice versa).

    If you want all subdomains of superhost.gr to go to that site then use a single ServerAlias with a wildcard. Take a guess as to what you would write.
  12. #22
  13. Contributing User
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Jun 2003
    Location
    Thessaloniki
    Posts
    1,402
    Rep Power
    0
    Originally Posted by requinix
    1. A DNS record lets other people access your site. If you want them to do that then you need one.
    2. ServerAlias is for other hostnames besides the main one. Like you'd have a ServerName for Example Domain and a ServerAlias for example.com (or vice versa).

    If you want all subdomains of superhost.gr to go to that site then use a single ServerAlias with a wildcard. Take a guess as to what you would write.
    ServerAlias *.superhost.gr

    i presume.

    that will work for hostname that do exist(they have DNS records in existance) and also for hostnames that do not exist as DNS records?
  14. #23
  15. Headless Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    16,966
    Rep Power
    9647
    Apache doesn't care about DNS.

    Please spend some time learning about what DNS actually is.
  16. #24
  17. Contributing User
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Jun 2003
    Location
    Thessaloniki
    Posts
    1,402
    Rep Power
    0
    Just one last thing please and thank you for your patience.

    Do i have to create a seperate entry for every hostname a user can try i.e. somehostname.superhost.gr

    apache accepts wildcard to redirect to main domain.

    But what happens to DNS ?
  18. #25
  19. Headless Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    16,966
    Rep Power
    9647
  20. #26
  21. Contributing User
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Jun 2003
    Location
    Thessaloniki
    Posts
    1,402
    Rep Power
    0
    Originally Posted by requinix
    DNS can do wildcard subdomains too.
    Thank you i will try to cover all possible domains a user might request

    1. by adding DNS wildcard to DNS record
    2. by adding wildcard to virtual host.

    and i hope it will work
  22. #27
  23. Contributing User
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Jun 2003
    Location
    Thessaloniki
    Posts
    1,402
    Rep Power
    0
    Actually i just trif wildcard both in DNS and httpd.conf and restarted services.

    nexus.superhost.gr does work

    but i.e nikos.superhost.gr does not redirect to superhost.gr

    shouldn't it since i used wildcard as subdomain in superhost.gr' DNS records?
  24. #28
  25. Headless Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    16,966
    Rep Power
    9647
    Apache has not suddenly started caring about DNS since the last time I told you it did not.

    Apache and ServerName/ServerAlias only get the right virtualhost involved. If you don't have any URL rewriting in your httpd.conf that would be responsible for this then there must be something in the application doing it.
  26. #29
  27. Contributing User
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Jun 2003
    Location
    Thessaloniki
    Posts
    1,402
    Rep Power
    0
    Originally Posted by requinix
    Apache has not suddenly started caring about DNS since the last time I told you it did not.

    Apache and ServerName/ServerAlias only get the right virtualhost involved. If you don't have any URL rewriting in your httpd.conf that would be responsible for this then there must be something in the application doing it.
    I do not have any rewriting rules within my httpd.conf.
    which application would that be?

    Are you sure addind wildcard in DNS is enough to make this work? he is my superhost DNS Zone

    Code:
    $ttl 38400
    @	IN	SOA	ns1.superhost.gr. root.ns1.superhost.gr. (
    			1482957888
    			10800
    			3600
    			604800
    			38400 )
    superhost.gr.	IN	A	104.168.171.101
    www.superhost.gr.	IN	A	104.168.171.101
    ftp.superhost.gr.	IN	A	104.168.171.101
    m.superhost.gr.	IN	A	104.168.171.101
    webmail.superhost.gr.	IN	A	104.168.171.101
    admin.superhost.gr.	IN	A	104.168.171.101
    autoconfig.superhost.gr.	IN	A	104.168.171.101
    autodiscover.superhost.gr.	IN	A	104.168.171.101
    localhost.superhost.gr.	IN	A	127.0.0.1
    ns1.superhost.gr.	IN	A	104.168.171.101
    ns2.superhost.gr.	IN	A	104.168.171.101
    superhost.gr.	IN	NS	ns1.superhost.gr.
    superhost.gr.	IN	NS	ns2.superhost.gr.
    mail.superhost.gr.	IN	A	104.168.171.101
    mail.superhost.gr.	IN	AAAA	2607:5501:1000:1ef::692b
    superhost.gr.	IN	MX	5 mail.superhost.gr.
    superhost.gr.	IN	TXT	"v=spf1 a mx a:superhost.gr ip4:104.168.171.101 ?all"
    *.superhost.gr.	IN	A	104.168.171.101
    *.superhost.gr.	IN	AAAA	2607:5501:1000:1ef::692b

    last 2 entries is for every possible sub-domain given by a user for both IPv4 and IPv6.

    and withing http.conf i have

    ServerAlias *.superhost.gr
  28. #30
  29. Headless Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    16,966
    Rep Power
    9647
    Originally Posted by Nik
    I do not have any rewriting rules within my httpd.conf.
    Yes you do. You have a bunch of them. Do you not understand what URL rewriting is?

    Originally Posted by Nik
    which application would that be?
    How should I know? It's your site.

    Originally Posted by Nik
    Are you sure addind wildcard in DNS is enough to make this work?
    I am sure of what I said. Indeed, the DNS does seem to be set up correctly and I am getting to some sort of site which has time-warped me back to the '90s.

IMN logo majestic logo threadwatch logo seochat tools logo