Results 1 to 9 of 9

Thread: Cannot connect to named based virtual host

  1. #1

    Default Cannot connect to named based virtual host

    Hi, I've set up two sites on apache2 named based virtual host on opensuse leap 15.1. I think they have been set up correctly as I can access them from localhost. However, when I try to access them from another machine on the local network, by entering server name in address bar, they cannot be reached. If I were to enter the static address of the wireless card in the address bar the first site can be reached.
    There is clearly a name resolution problem. I do not know how to resolve this problem. Can somebody point me in the right direction. I have tried to solve issue by modifying DNS configuration, in Yast2, but if I enter public DNS such as Google's 8.8.8.8 it does not solve problem plus I cannot access internet from localhost. The router is hyperoptic ZTE H298N. I wonder if anyone could help me. All suggestions would be greatly appreciated.

  2. #2
    Join Date
    Jun 2008
    Location
    Groningen, Netherlands
    Posts
    20,679
    Blog Entries
    14

    Default Re: Cannot connect to named based virtual host

    DId you add the ip address and hostname to the /etc/hosts file?
    Are we talking about a FQDN?

    DNS will only help without a FQDN if you run a local DNS server and add the server's hostname.
    Last edited by Knurpht; 12-Feb-2020 at 19:44.
    ° Appreciate my reply? Click the star and let me know why.

    ° Perfection is not gonna happen. No way.

    http://en.opensuse.org/User:Knurpht
    http://nl.opensuse.org/Gebruiker:Knurpht

  3. #3

    Default Re: Cannot connect to named based virtual host

    Quote Originally Posted by Knurpht View Post
    DId you add the ip address and hostname to the /etc/hosts file?
    Are we talking about a FQDN?

    DNS will only help without a FQDN if you run a local DNS server and add the server's hostname.
    Hello, Thank you for your reply.
    Yes, ip address and hostname were added to
    /etc/hosts file.
    I am not using FQDN. I am only using dNS domain name for ServerName, as in somewebsite.com

  4. #4
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    26,237

    Default Re: Cannot connect to named based virtual host

    Quote Originally Posted by raydona View Post
    Hello, Thank you for your reply.
    Yes, ip address and hostname were added to
    /etc/hosts file.

    You mean the /etc/hosts of the "another machine on the local network"?
    Henk van Velden

  5. #5

    Default Re: Cannot connect to named based virtual host

    Quote Originally Posted by hcvv View Post
    You mean the /etc/hosts of the "another machine on the local network"?[/LEFT]
    For machine that has openSUSE with apache server installed and a wireless card, in
    /etc/hosts file I have added static ip address of wireless card and server name. I am trying to access that apache server from a windows 10 machine that does not have any server running.

  6. #6
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    28,572
    Blog Entries
    15

    Default Re: Cannot connect to named based virtual host

    Quote Originally Posted by raydona View Post
    For machine that has openSUSE with apache server installed and a wireless card, in
    /etc/hosts file I have added static ip address of wireless card and server name. I am trying to access that apache server from a windows 10 machine that does not have any server running.
    Hi
    Unless you have a real FQDN out on the internet, or a local DNS server, easiest way is to use the static ip address or add it to the windows hosts file Windows/System32/drivers/etc/hosts.txt, need to run the likes on notepad as Administrator. Format is the same as Linux, ip address fqdn fqdn -s.

    Code:
    XXX.XXX.XXX.XXX somehost.some.domain somehost
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  7. #7
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    26,237

    Default Re: Cannot connect to named based virtual host

    Quote Originally Posted by raydona View Post
    For machine that has openSUSE with apache server installed and a wireless card, in
    /etc/hosts file I have added static ip address of wireless card and server name. I am trying to access that apache server from a windows 10 machine that does not have any server running.
    So not on the client system?

    How do you think that a client system can resolve a host name (FQDN) when it
    • can not find it using DNS;
    • does neither has it itself in it's /etc/host file (or what the equivalent may be in Windows)?

    Even systems are not clairvoyant.
    Henk van Velden

  8. #8
    Join Date
    Jun 2008
    Location
    Auckland, NZ
    Posts
    21,245
    Blog Entries
    1

    Default Re: Cannot connect to named based virtual host

    Assuming a Windows 10 host, you might try using Bonjour/Avahi name resolution via mDNS. For example, I can reach a Linux host on my LAN using 'https://nas01.local' or my CUPS server 'https://linux-server01.local:631'
    openSUSE Leap 15.1; KDE Plasma 5

  9. #9
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    12,151
    Blog Entries
    2

    Default Re: Cannot connect to named based virtual host

    Quote Originally Posted by raydona View Post
    Hi, I've set up two sites on apache2 named based virtual host on opensuse leap 15.1. I think they have been set up correctly as I can access them from localhost. However, when I try to access them from another machine on the local network, by entering server name in address bar, they cannot be reached. If I were to enter the static address of the wireless card in the address bar the first site can be reached.
    There is clearly a name resolution problem. I do not know how to resolve this problem. Can somebody point me in the right direction. I have tried to solve issue by modifying DNS configuration, in Yast2, but if I enter public DNS such as Google's 8.8.8.8 it does not solve problem plus I cannot access internet from localhost. The router is hyperoptic ZTE H298N. I wonder if anyone could help me. All suggestions would be greatly appreciated.
    If I were to interpret what you wrote exactly which I highlighted in red , that's your problem.

    So, the question is...
    Did you actually access your websites by either either an ip address bound to an address starting with 127.0.0.x, or a named instance bound to a localhost address?
    If you did that, the named instance would not be accessible from another machine because those IP addresses are specially reserved to be accessible only from the same machine.

    The solution should be to bind your named instances to a "network address" which is different from a "localhost address"
    A common class C network address starts with and has the numbers and with "x" and "y" some other number.
    Code:
    192.168.x.y
    BTW - You can install a YaST Module which can help you set up your Apache webserver properly... You can either use YaST Software Manager or zypper to install the following package
    Code:
    yast2-http-server
    Beginner Wiki Quickstart - https://en.opensuse.org/User:Tsu2/Quickstart_Wiki
    Solved a problem recently? Create a wiki page for future personal reference!
    Learn something new?
    Attended a computing event?
    Post and Share!

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •