Answer the question
In order to leave comments, you need to log in
Correct vhosts setting?
Hi all. There is Ubuntu Server 12.04, Apache is installed on it. There are several sites that are stored in /var/www/{site_name}/htdocs. There are Apache configs in the sites-available directory. Well, and entries in /etc/hosts like 127.0.1.* {site_name}.
When I run this server in Virtual Box, the system resolves the name of the server itself, i.e. I can access the browser not by IP, but by hostname (in this case ubs ) and get to the default site in the /var/www directory. But I didn’t manage to make it so that the names of virtual hosts were resolved, so that on my working machine I didn’t have to write a line like 192.168.1.100 ubs site1.ubs site2.ubs in /etc/hosts for each host.
What should be done? How to force DNS to resolve virtual host names so they are accessible from the outside? I understand that if the name of the server itself is resolved, then there is a DNS server?
Answer the question
In order to leave comments, you need to log in
No, in this case you are referring to the computer by its name, and it can only have one. Options for solving the problem:
1. The simplest thing is to register all your virtual hosts in /etc/hosts (%windir%\system32\drivers\etc\hosts).
2. Install on the DNS server (the same bind9), set up your domains in it and use this DNS server on the working computer.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question