Score:0

Unable to reach site via apache virtual host

no flag

I am trying a lot by configuring my apache configuration to have virtual hosts for external and internal use. The public virtual host is used for nextcloud and the internal virtual host should be for internal web hosting.

The configuration was done according to the the following instruction, but I can't reach my website (testsite/): https://www.digitalocean.com/community/tutorials/how-to-set-up-apache-virtual-hosts-on-ubuntu-18-04-de

The virtual configuration of testsite.conf is:

<VirtualHost *:80>
   ServerName testsite
   DocumentRoot /var/www/testsite

<Directory "/var/www/testsite">
    AllowOverride None
    Require all granted
</Directory>

 ErrorLog ${APACHE_LOG_DIR}/testsite.log
</VirtualHost>

The configuration of /etc/hosts is:

127.0.0.1       localhost
::1             ip6-localhost ip6-loopback
ff02::1         ip6-allnodes
ff02::2         ip6-allrouters

127.0.1.1       raspberrypi
127.0.0.1       testsite

I get the following error message in the browser: "Website is not reachable DNS_PROBE_FINISHED_NXDOMAIN"

Does anyone has an idea what I'm doing wrong or what I can change in my configuration? I have tried a lot, but nothing works....

in flag
Are you trying to connect to the test site from a browser on the server or on a different machine? What is the address you’re putting into the browser?
piuser avatar
no flag
I am trying to connect from another machine. The address is "http:/testsite/"
in flag
Have you defined `testsite` on that other machine? The error you are reporting has nothing to do with Apache, but the browser’s inability to determine where the destination is
piuser avatar
no flag
No I haven't done this. That could be the problem. I want to access from my Windows PC the website and in the background there is a FritzBox. Where should I define it? I have also Webmin and miniDlna and both are accessible from different clients in the same network with the IP of the PI and a specific Port. Should I define it on the PI or the FritzBox?
in flag
If you have an internal DNS provider that all your machines use, that would be the most logical place to define it. If you do not, then there are numerous ways to approach the problem, with some being drastically simpler than others. Either way, Windows is off topic for this site.
piuser avatar
no flag
So the virtual host configuration itself is working on the server machine. But what are the steps to make it reachable from all the clients in the same network?
in flag
All clients on the network need to understand where “testsite” points to. That is a topic that is outside of the scope of the question, though.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.