Answer the question
In order to leave comments, you need to log in
How to make the site open by ip?
There is a server, Apache. It is necessary that when you enter the server ip in the address bar, the site located in the /tom folder opens, the folder is located at the root. The site is in this folder. Here it is necessary that when you enter the ip, the site opens. I don't understand how to do this. There is SSH and FTP access.
CentOs7
Answer the question
In order to leave comments, you need to log in
you don’t need to do this, because you will have a mirror of the site that will fall into the index like the main one, and for SEO it’s not good at all, rather, on the contrary, you need to glue the IP to the main site, but it’s better not to open access via IP at all.
And so a little theory
. Since the demon hangs on 1 port and 1 ip, and it can have more than 1 sites
, the question arises how the web server understands which site to give because all the input data is the same and which folder it does not know to climb into.
To do this, the web server crawls into the request of the client browser and takes the name of the site to which it applied.
and on the basis of $_SERVER['HTTP_REFERER']
looks for it in the configs, if it finds a match, it substitutes the desired config.
If not, then it falls into the Default
nginx example
listen 80 default_server;
listen [::]:80 default_server;
listen 111.111.111:80;
<VirtualHost 111.111.111:82>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question