1

OS: Ubuntu 19.10

I'm playing around with Apache so I can learn how to configure it, so I installed it via apt-get and took a look at the config directories.

I also am vaguely aware that with Apache on macOS all the default addresses end with a .local TLD, so I tried navigating to my box in a web browser using its hostname and the .local TLD, i.e. http://mybox.local/. And it worked, I see the apache default page.

But looking at the apache config files and virtual host config, nowhere is this server name defined. So I looked up as best I could how this extension is configured, and I found this page saying the avahi-daemon is responsible and how to work the config.

I changed the server settings to a different TLD, eg '.blarg' and I restarted the avahi service - which doesn't work, even with an Apache service reload, yet somehow the .local TLD still works, even after a reboot.

This leads me to believe either I'm restarting the wrong service, or avahi isn't responsible for the .local extension. Anyone care to point me in the right direction?

  • Apologies, I've posted and realised I've been spelling avahi incorrectly. – liquidus219 Mar 19 at 16:25
  • Hello, the avahi-daemon has nothing to do with the Apache's configuration. It just tells to the other computers in your LAN the IP of the current computer and that's it. Something more if you can access mybox.local via the browser by the help of avahi-daemon in most cases you wont access some-sub-domain.mybox.local, in this case you need to setup a local DNS server, or just can edit the hosts files of the other LAN computers... – pa4080 Mar 19 at 16:46
  • I would suggest you to read the following two answers of mine in order to understand how Apache's configuration works: 1. Creating additional Virtual Host on Apache2 and 2. How to set a domain to IP address. – pa4080 Mar 19 at 16:46
  • @pa4080 That sounds more like what I'm after, I was just confused because altering the config for avahi did nothing. – liquidus219 Mar 19 at 16:49
  • According to my experience, for a bit more experienced user the avachi-daemon brings nothing :) So I have't spent any time yet in order to understand how exactly it works and could be reconfigured. – pa4080 Mar 19 at 16:50
1

There's no magic going on, really.

What you have is a fresh installation to Apache. So, by default, any request on port 80 to your machine will show you the default apache welcome page.

For example, the following would work as well:

  • http://127.0.0.1/
  • http://localhost/

If you need to add another domain, you need to point that domain to your machine. The simplest way to do that on a development machine is to edit the /etc/hosts file and a new entry.

Open the file with an editor and add the following line (change mybox.something to whatever you want):

127.0.0.1   mybox.something

After you do that, just open http://mybox.something in your browser and it should work.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.