G
G
gera72021-11-28 14:57:11
linux
gera7, 2021-11-28 14:57:11

Why is there no transition to the domain name of the virtual host, but only by IP?

Raised a web server, successfully navigated by host IP:
61a36c7312b5a716321131.png

1. Created the testdomain directory
61a36d0077cb9015844004.png

2. Created a virtual host
61a36d7d9bfe1198000753.png

file Activated the file using the a2ensite command, disabled the default site, no errors
61a36dd471b87947327506.png

Restarted the server, but when switching to http://testdomain/, a google request goes to www6 .testdomain.com
61a36e4b36a78472758148.png

What am I doing wrong?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
B
BorLaze, 2021-11-28
@BorLaze

A host is one thing, but a host's domain name is another.
You either need to set up a DNS server, in which you specify that testdomain is located at 192.168.1.193, or (which is much easier) specify
192.168.1.193 testdomain in /etc/hosts It will work, of
course, it will only be on the machine where it is registered.

D
Dmitry Aleksandrov, 2021-11-28
@jamakasi666

dns And records are forgotten.

A
Alexander Karabanov, 2021-11-28
@karabanov

The config specifies testdomain , and in the browser you are trying to open www6.testdomain.com .
testdomain won't resolve naturally, so put it in /etc/hosts and navigate to testdomain in your browser

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question