S
S
sitev_ru2016-01-27 11:12:28
PHP
sitev_ru, 2016-01-27 11:12:28

How to specify the root of the local site?

My site works on Apache like this: 127.0.0.1/mysite.ru/www
How to access my site locally, for example, like this: mysite.ru.local ???

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey Nemiro, 2016-01-27
@sitev_ru

Specify mysite.ru.local in the site configuration file:

<VirtualHost 127.0.0.1:80>
  DocumentRoot /home/mysite.ru/www
  ServerName mysite.ru.local
  # ServerAlias mysite.ru
  # ...все остальное...
</VirtualHost>

In order for the site to open in the browser at the specified address, you can register it in the hosts file .
Under Linux, see the /etc/hosts file .
Under Windows, see C:\Windows\System32\drivers\etc\hosts .
(with administrator rights)
In the hosts file you need to specify the hostname and IP of the server. For example:
Instead of .local , it is better to use another zone, because there can be problems with .local . It can be just mysite , or mysite.serverName .

N
newobj, 2016-01-27
@newobj

set up hosts

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question