Вроде заработал апач, проблема в том что файл index.php локалхоста, перебивает код с сайта test.ru в котором также есть index.php. Изменив index.php локалхоста, если запустить test.ru будет равносильно что запустил лохалхост, хоть код index.php сайта test.ru другой чем сайта localhost. Что делать?
Вот такие настройки, может что сменить нужно? Код (Text): # Virtual Hosts # # Required modules: mod_log_config # If you want to maintain multiple domains/hostnames on your # machine you can setup VirtualHost containers for them. Most configurations # use only name-based virtual hosts so the server doesn't need to worry about # IP addresses. This is indicated by the asterisks in the directives below. # # Please see the documentation at # <URL:http://httpd.apache.org/docs/2.4/vhosts/> # for further details before you try to setup virtual hosts. # # You may use the command line option '-S' to verify your virtual host # configuration. # # VirtualHost example: # Almost any Apache directive may go into a VirtualHost container. # The first VirtualHost section is used for all requests that do not # match a ServerName or ServerAlias in any <VirtualHost> block. # <VirtualHost *:80> ServerName test.ru DocumentRoot "D:/server/super-php" ServerAlias www.test.ru www.clown.ru ErrorLog "D:/server/super-php/error.log" CustomLog "D:/server/super-php/access.log" </VirtualHost>
Я установил новый апач 2.4, все работает, только test.ru запускает то что в локалхост-файле, а не то что в тест.ру. Что делать? Добавлено спустя 33 минуты 18 секунд: Читает только так сайт http://test.ru/test.ru/www/ но если ввести просто тест.ру не хочет, в каком месте нужно подправить?
вы конфиг-то написали для хоста? судя по всему вы жертва денвера или подобного продукта который сам пишет конфиг виртуальных хостов согласно иерархии каталогов. чистая установка апача ничего не знает про это. все руками. так надежнее. если сделать apache2ctl -S можно увидеть с какими хостами из каких конфигов работает ваш сервер
Я все скачивал с офиц, не денвер, все по отдельности В каталоге D:/server/super-php у меня лежат сайты . В папке super-php у меня лежит файл index.php и отдельно другая, внутри папка test.ru,а в ней папка www в которой index.php Код (Text): # Virtual Hosts # # Required modules: mod_log_config # If you want to maintain multiple domains/hostnames on your # machine you can setup VirtualHost containers for them. Most configurations # use only name-based virtual hosts so the server doesn't need to worry about # IP addresses. This is indicated by the asterisks in the directives below. # # Please see the documentation at # <URL:http://httpd.apache.org/docs/2.4/vhosts/> # for further details before you try to setup virtual hosts. # # You may use the command line option '-S' to verify your virtual host # configuration. # # VirtualHost example: # Almost any Apache directive may go into a VirtualHost container. # The first VirtualHost section is used for all requests that do not # match a ServerName or ServerAlias in any <VirtualHost> block. # <VirtualHost *:80> ServerAdmin localhost@admin ServerName localhost ServerAlias "localhost" "www.localhost" DocumentRoot "D:/server/super-php" ErrorLog "D:/server/www/error.log" CustomLog "D:/server/www/access.log" </VirtualHost> <VirtualHost *:80> ServerName test.ru DocumentRoot "D:/server/super-php" ServerAlias www.test.ru www.clown.ru ErrorLog "D:/server/super-php/error.log" CustomLog "D:/server/super-php/access.log" </VirtualHost> Вот так указал, файл localhost запускается с тем кодом который нужно,а сайт test.ru запускается только если ввести http://www.test.ru/test.ru/www/ что делать?