apache is currently configured on 1 site, how to expand virtual hosts? I added to htppd.conf:

<VirtualHost *:80> ServerName mysite.ru ServerAlias www.mysite.ru DocumentRoot www/vhosts/mysite.ru/httpdocs ErrorLog logs/mysite.ru-error.log</VirtualHost> 

naturally created the vhosts folder in the www folder, then in the vhosts created the folder-site mysite.ru and in it httpdocs, in which the index file lies, now going to mysite.ru in the browser opens a site from the Internet, of course this is all due to hosts, which I fixed by adding 127.0.0.1 mysite.ru, but restarting apache and going back to mysite.ru, the browser unloads me in general mainsite.ru, i.e. index of the file that is in the www folder.

The question is - what else does he need so that he accepts virtual hosts?

  • What OS ??? - Artem
  • Windows XP - CapK

1 answer 1

 Listen 127.0.0.1:80NameVirtualHost 127.0.0.1:80<VirtualHost 127.0.0.1:80># локальный адрес ServerName mysite.ru ServerAlias www.mysite.ru DocumentRoot "c:/.../www/vhosts/mysite.ru/httpdocs"# указать полный путь ErrorLog logs/mysite.ru-error.log</VirtualHost> 

Try to describe "vhost" more precisely.

  • thanks, dei but the full path decides! - CapK
  • Oh, I hurried, now other hosts open as mysite.ru - CapK
  • Add the same virtual host for mainsite.ru. - FreeTimer