Форум программистов
 

Восстановите пароль или Зарегистрируйтесь на форуме, о проблемах и с заказом рекламы пишите сюда - alarforum@yandex.ru, проверяйте папку спам!

Вернуться   Форум программистов > Скриптовые языки программирования > PHP
Регистрация

Восстановить пароль
Повторная активизация e-mail

Купить рекламу на форуме - 42 тыс руб за месяц

Ответ
 
Опции темы Поиск в этой теме
Старый 10.03.2013, 21:53   #11
super-php
Пользователь
 
Регистрация: 07.03.2013
Сообщений: 37
По умолчанию

Вроде заработал апач, проблема в том что файл index.php локалхоста, перебивает код с сайта test.ru в котором также есть index.php. Изменив index.php локалхоста, если запустить test.ru будет равносильно что запустил лохалхост, хоть код index.php сайта test.ru другой чем сайта localhost. Что делать?
super-php вне форума Ответить с цитированием
Старый 10.03.2013, 22:35   #12
vasek123
Заблокирован
 
Регистрация: 21.11.2008
Сообщений: 4,986
Сообщение

Цитата:
Сообщение от super-php Посмотреть сообщение
Вроде заработал апач, проблема в том что файл index.php локалхоста, перебивает код с сайта test.ru в котором также есть index.php. Изменив index.php локалхоста, если запустить test.ru будет равносильно что запустил лохалхост, хоть код index.php сайта test.ru другой чем сайта localhost. Что делать?
Не совсем понятно, что вы имеете в виду... Вы в адресной строке браузера при заходе на локальный сервак что пишете? Файл hosts редактировали?
vasek123 вне форума Ответить с цитированием
Старый 10.03.2013, 22:52   #13
super-php
Пользователь
 
Регистрация: 07.03.2013
Сообщений: 37
По умолчанию

Я имею ввиду что если ввести http://localhost/ или ввести http://test.ru/ отображает то же самое, хоть в тест.ру другой файл индекс. Вот файл хостс:
Код:
# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
#      102.54.94.97     rhino.acme.com          # source server
#       38.25.63.10     x.acme.com              # x client host

# localhost name resolution is handled within DNS itself.
#	127.0.0.1       localhost
#	::1             localhost
# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
#      102.54.94.97     rhino.acme.com          # source server
#       38.25.63.10     x.acme.com              # x client host

# localhost name resolution is handled within DNS itself.
#	127.0.0.1       localhost
#	::1             localhost
    127.0.0.1 test.ru
    127.0.0.1 www.test.ru
    127.0.0.1 clown.ru
super-php вне форума Ответить с цитированием
Старый 10.03.2013, 23:06   #14
vasek123
Заблокирован
 
Регистрация: 21.11.2008
Сообщений: 4,986
Сообщение

Добавь в файл

PHP код:
127.0.0.1 localhost 
Кстати, виртуальные хосты настраивали?
vasek123 вне форума Ответить с цитированием
Старый 10.03.2013, 23:38   #15
super-php
Пользователь
 
Регистрация: 07.03.2013
Сообщений: 37
По умолчанию

После добавления все равно не помогло. Виртуальные хосты настроены так:
Код:
# 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>
super-php вне форума Ответить с цитированием
Старый 11.03.2013, 00:28   #16
super-php
Пользователь
 
Регистрация: 07.03.2013
Сообщений: 37
По умолчанию

Читает только так сайт http://test.ru/test.ru/www/ но если ввести просто тест.ру не хочет, в каком месте нужно подправить?
super-php вне форума Ответить с цитированием
Старый 11.03.2013, 01:28   #17
vasek123
Заблокирован
 
Регистрация: 21.11.2008
Сообщений: 4,986
Сообщение

Цитата:
Сообщение от super-php Посмотреть сообщение
Код:
# 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>
Мдя... Как все запущенно...

Вы хоть раз в жизни пытались что то изучить или все надеетесь на форум?

Добавьте следующее:

Код:
Добавить <VirtualHost *:80>
     ServerAdmin localhost@admin
     ServerName localhost
     ServerAlias localhost
     DocumentRoot "D:/server/www"
     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>
Вы хотя бы определитесь для начала где будете хранить сайты в директории www или super-php

p.s. Извините, но, у меня складывается ощущение что вы думать вообще разучились...

Последний раз редактировалось vasek123; 11.03.2013 в 01:50.
vasek123 вне форума Ответить с цитированием
Старый 12.03.2013, 23:09   #18
super-php
Пользователь
 
Регистрация: 07.03.2013
Сообщений: 37
По умолчанию

В каталоге D:/server/super-php у меня лежат сайты . В папке super-php у меня лежит файл index.php и отдельно другая, внутри папка test.ru,а в ней папка www в которой index.php
Код:
# 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/ что делать?
super-php вне форума Ответить с цитированием
Старый 12.03.2013, 23:26   #19
vasek123
Заблокирован
 
Регистрация: 21.11.2008
Сообщений: 4,986
Сообщение

Цитата:
Сообщение от super-php Посмотреть сообщение
Вот так указал, файл localhost запускается с тем кодом который нужно,а сайт
test.ru запускается только если ввести http://www.test.ru/test.ru/www/ что делать?
Так чего ты хотел? Все верно... Просто, если тебе так уж надо, создай несколько каталогов на super-php и уж туда потом помещай файлы которые надо тестировать а index.php из super-php удали на хрен.

Последний раз редактировалось vasek123; 13.03.2013 в 01:28.
vasek123 вне форума Ответить с цитированием
Ответ


Купить рекламу на форуме - 42 тыс руб за месяц

Опции темы Поиск в этой теме
Поиск в этой теме:

Расширенный поиск


Похожие темы
Тема Автор Раздел Ответов Последнее сообщение
mod_rewrite: все на index.php без www и index.php TrydORgolik PHP 2 18.02.2013 18:19
Windows Forms. Index в ListBox Metaron C# (си шарп) 1 26.05.2012 18:19
Index.php Holyman WordPress и другие CMS 3 05.04.2012 19:30
index.php 77777777 PHP 4 28.03.2012 15:49