Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> XAMPP - problem z VirtualHost, Bez znaczenia, co ustawiam, zawsze wyswietla pierwszy katalog
djgrin
post
Post #1





Grupa: Zarejestrowani
Postów: 15
Pomógł: 0
Dołączył: 13.05.2007

Ostrzeżenie: (0%)
-----


Witam.
Zmienilem serwer na XAMPPa (pod WinXP SP2) i chcialem ustawic sobie wirtualki: kilka adresow, ktore beda korzystac z roznych katalogow. Problem polega na tym, ze cokolwiek wpisze w httpd.conf, to apache jakby "widzi" tylko jeden - pierwszy wpis.
Aktualnie moj wpis w httpd.conf wyglada tak (chcialem na poczatek osiagnac cos takiego, ze test.pl wskazuje na katalog test, a localhost na htdocs):

NameVirtualHost *
<VirtualHost *>
DocumentRoot "C:\xampp\htdocs\test"
ServerName test.pl
</VirtualHost>
<VirtualHost _default_>
DocumentRoot "C:\xampp\htdocs"
</VirtualHost>
... i w tym momencie zawsze laduje mi sie strona w katalogu test (bez roznicy czy wpisze localhost czy test.pl).

Czy ktos moze mi powiedziec co robie zle? Moze jakis link do "manuala" albo rozwiazan podobnych problemow?
Z gory dzieki za kazda pomoc winksmiley.jpg.
PS. Oczywiscie w WINDOWS/system32/drivers/ets/hosts odpowiedni wpis poczynilem winksmiley.jpg...
Go to the top of the page
+Quote Post
krzyszbi
post
Post #2





Grupa: Zarejestrowani
Postów: 251
Pomógł: 13
Dołączył: 15.09.2005

Ostrzeżenie: (0%)
-----


hej
sam używam xampp-a i mi się podoba a mam poustawiane następujaco
httpd.conf
Kod
<Directory "E:/Krzysiek/www">
    Options Indexes FollowSymLinks Includes ExecCGI
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>

httpd-vhosts.conf
Kod
NameVirtualHost *:80

<VirtualHost *:80>
  ServerName localhost
  DocumentRoot "E:/www/localhost"
  <Directory "E:/www/localhost">
    AllowOverride All
    Order allow,deny
    Allow from all
  </Directory>
</VirtualHost>

<VirtualHost *:80>
ServerName local2
DocumentRoot "E:/www/local2"
  <Directory "E:/www/local2">
    AllowOverride All
    Order allow,deny
    Allow from all
  </Directory>
</VirtualHost>

<VirtualHost *:80>
ServerName local3
DocumentRoot "E:/www/local3"
  <Directory "E:/www/local3">
    AllowOverride All
    Order allow,deny
    Allow from all
  </Directory>
</VirtualHost>


no i pliki C:\WINDOWS\system32\drivers\etc\hosts
Kod
127.0.0.1       localhost
127.0.0.1       local2
127.0.0.1       local1

i u mnie działa jak nie będzie działało napisz co apach krzyczy a razem na pewno uruchomimy
ja mam waśnie wirtualki na localu i je sobie bardzo chwale


--------------------
Everything should be made as simple as possible, but not simpler. - A.Eainstein
Go to the top of the page
+Quote Post
gregxp
post
Post #3





Grupa: Zarejestrowani
Postów: 1
Pomógł: 0
Dołączył: 24.05.2009
Skąd: Radom

Ostrzeżenie: (0%)
-----


Cześć
mnie nie działa domena wpisana www.nazwa tzn zrobiłem tak jak w poście wyżej ale niestety nie działa mi nazwa jeśli ją wpisze http://www.nazwadomeny.pl a działa jak wpisze http://nazwadomeny.pl
Proszę o pomoc
Go to the top of the page
+Quote Post
webdice
post
Post #4


Developer


Grupa: Moderatorzy
Postów: 3 045
Pomógł: 290
Dołączył: 20.01.2007




W pliku hosts dodajesz:

Kod
127.0.0.1    nazwadomeny.pl
127.0.0.1    www.nazwadomeny.pl


Poza tym zainteresuj się zmienna konfiguracyjna ServerAlias, dla przykładu:

Kod
ServerAlias nazwadomeny.pl www.nazwadomeny.pl


Zresztą pisałem o tym artykuł na php.pl.
Go to the top of the page
+Quote Post
Armstrong
post
Post #5





Grupa: Zarejestrowani
Postów: 200
Pomógł: 40
Dołączył: 26.08.2009
Skąd: Kobiernice

Ostrzeżenie: (0%)
-----


a spróbuj:

Kod
<VirtualHost *:80>
   NameVirtualHost bliskomnie:80
    ServerName bliskomnie2
    DocumentRoot "F:/gargi/-webs/xampp/htdocs/blisko-mnie2"
</VirtualHost>


Gdyby nie zadziałało to pokaż logi apacha

Ten post edytował Armstrong 20.05.2010, 12:59:34


--------------------
// NOPE
Go to the top of the page
+Quote Post
f4ll3ns3raf1n
post
Post #6





Grupa: Zarejestrowani
Postów: 29
Pomógł: 0
Dołączył: 27.11.2009

Ostrzeżenie: (0%)
-----


po uruchomieniu serwera:
Kod
[Thu May 20 13:40:48 2010] [warn] _default_ VirtualHost overlap on port 80, the first has precedence
[Thu May 20 13:40:48 2010] [warn] _default_ VirtualHost overlap on port 80, the first has precedence
[Thu May 20 13:40:48 2010] [warn] _default_ VirtualHost overlap on port 80, the first has precedence
[Thu May 20 13:40:48 2010] [warn] _default_ VirtualHost overlap on port 80, the first has precedence
[Thu May 20 13:40:48 2010] [warn] NameVirtualHost bliskomnie2:80 has no VirtualHosts
[Thu May 20 13:40:49 2010] [warn] _default_ VirtualHost overlap on port 80, the first has precedence
[Thu May 20 13:40:49 2010] [warn] _default_ VirtualHost overlap on port 80, the first has precedence
[Thu May 20 13:40:49 2010] [warn] _default_ VirtualHost overlap on port 80, the first has precedence
[Thu May 20 13:40:49 2010] [warn] _default_ VirtualHost overlap on port 80, the first has precedence
[Thu May 20 13:40:49 2010] [warn] NameVirtualHost bliskomnie2:80 has no VirtualHosts
[Thu May 20 13:40:51 2010] [notice] Digest: generating secret for digest authentication ...
[Thu May 20 13:40:51 2010] [notice] Digest: done
[Thu May 20 13:40:51 2010] [notice] Apache/2.2.14 (Win32) DAV/2 mod_ssl/2.2.14 OpenSSL/0.9.8l mod_autoindex_color PHP/5.3.1 mod_apreq2-20090110/2.7.1 mod_perl/2.0.4 Perl/v5.10.1 configured -- resuming normal operations
[Thu May 20 13:40:51 2010] [notice] Server built: Nov 11 2009 14:29:03
[Thu May 20 13:40:51 2010] [notice] Parent: Created child process 7396
[Thu May 20 13:40:51 2010] [warn] _default_ VirtualHost overlap on port 80, the first has precedence
[Thu May 20 13:40:51 2010] [warn] _default_ VirtualHost overlap on port 80, the first has precedence
[Thu May 20 13:40:51 2010] [warn] _default_ VirtualHost overlap on port 80, the first has precedence
[Thu May 20 13:40:51 2010] [warn] _default_ VirtualHost overlap on port 80, the first has precedence
[Thu May 20 13:40:51 2010] [warn] NameVirtualHost bliskomnie2:80 has no VirtualHosts


po wywołaniu adresu doszło:
Kod
[Thu May 20 13:40:52 2010] [warn] _default_ VirtualHost overlap on port 80, the first has precedence
[Thu May 20 13:40:52 2010] [warn] _default_ VirtualHost overlap on port 80, the first has precedence
[Thu May 20 13:40:52 2010] [warn] _default_ VirtualHost overlap on port 80, the first has precedence
[Thu May 20 13:40:52 2010] [warn] _default_ VirtualHost overlap on port 80, the first has precedence
[Thu May 20 13:40:52 2010] [warn] NameVirtualHost bliskomnie2:80 has no VirtualHosts
[Thu May 20 13:40:53 2010] [notice] Digest: generating secret for digest authentication ...
[Thu May 20 13:40:53 2010] [notice] Digest: done
[Thu May 20 13:40:54 2010] [notice] Child 7396: Child process is running
[Thu May 20 13:40:54 2010] [notice] Child 7396: Acquired the start mutex.
[Thu May 20 13:40:54 2010] [notice] Child 7396: Starting 150 worker threads.
[Thu May 20 13:40:54 2010] [notice] Child 7396: Starting thread to listen on port 443.
[Thu May 20 13:40:54 2010] [notice] Child 7396: Starting thread to listen on port 80.
[Thu May 20 13:40:54 2010] [notice] Child 7396: Starting thread to listen on port 443.
[Thu May 20 13:40:54 2010] [notice] Child 7396: Starting thread to listen on port 80.




EDIT
ok, nasunąłeś mi rozwiązanie.
dodałem na samym początku pliku httpd-vhosts.conf linijke
Kod
NameVirtualHost *:80


i od tej pory bangla :-)

Ten post edytował f4ll3ns3raf1n 20.05.2010, 12:48:31
Go to the top of the page
+Quote Post
JoShiMa
post
Post #7





Grupa: Zarejestrowani
Postów: 1 374
Pomógł: 149
Dołączył: 1.03.2006

Ostrzeżenie: (0%)
-----


Cytat(krzyszbi @ 22.10.2007, 11:28:43 ) *
hej
sam używam xampp-a i mi się podoba a mam poustawiane następujaco
httpd.conf
Kod
<Directory "E:/Krzysiek/www">
    Options Indexes FollowSymLinks Includes ExecCGI
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>

httpd-vhosts.conf
Kod
NameVirtualHost *:80

<VirtualHost *:80>
  ServerName localhost
  DocumentRoot "E:/www/localhost"
  <Directory "E:/www/localhost">
    AllowOverride All
    Order allow,deny
    Allow from all
  </Directory>
</VirtualHost>

<VirtualHost *:80>
ServerName local2
DocumentRoot "E:/www/local2"
  <Directory "E:/www/local2">
    AllowOverride All
    Order allow,deny
    Allow from all
  </Directory>
</VirtualHost>

<VirtualHost *:80>
ServerName local3
DocumentRoot "E:/www/local3"
  <Directory "E:/www/local3">
    AllowOverride All
    Order allow,deny
    Allow from all
  </Directory>
</VirtualHost>


no i pliki C:\WINDOWS\system32\drivers\etc\hosts
Kod
127.0.0.1       localhost
127.0.0.1       local2
127.0.0.1       local1

i u mnie działa jak nie będzie działało napisz co apach krzyczy a razem na pewno uruchomimy
ja mam waśnie wirtualki na localu i je sobie bardzo chwale


A jak to zrobić w Windows7, gdzie nie ma pliku C:\WINDOWS\system32\drivers\etc\hosts?


--------------------
Go to the top of the page
+Quote Post
erix
post
Post #8





Grupa: Moderatorzy
Postów: 15 467
Pomógł: 1451
Dołączył: 25.04.2005
Skąd: Szczebrzeszyn/Rzeszów




Mam Windows7 i upycham ten plik tysiącami wpisów.


--------------------

ZCE :: Pisząc PW załączaj LINK DO TEMATU i TYLKO w sprawach moderacji :: jakiś błąd - a TREŚĆ BŁĘDU? :: nie ponaglaj z odpowiedzią via PW!
Go to the top of the page
+Quote Post
JoShiMa
post
Post #9





Grupa: Zarejestrowani
Postów: 1 374
Pomógł: 149
Dołączył: 1.03.2006

Ostrzeżenie: (0%)
-----


Czy mam rozumieć, że tworzysz sobie brakującą strukturę katalogów i dodajesz ten plik z odpowiednimi wpisami?


--------------------
Go to the top of the page
+Quote Post
erix
post
Post #10





Grupa: Moderatorzy
Postów: 15 467
Pomógł: 1451
Dołączył: 25.04.2005
Skąd: Szczebrzeszyn/Rzeszów




On tam jest standardowo, w Twoim systemie widocznie go nie ma (powód mi bliżej nieznany).


--------------------

ZCE :: Pisząc PW załączaj LINK DO TEMATU i TYLKO w sprawach moderacji :: jakiś błąd - a TREŚĆ BŁĘDU? :: nie ponaglaj z odpowiedzią via PW!
Go to the top of the page
+Quote Post
JoShiMa
post
Post #11





Grupa: Zarejestrowani
Postów: 1 374
Pomógł: 149
Dołączył: 1.03.2006

Ostrzeżenie: (0%)
-----


Cytat(erix @ 24.03.2011, 00:42:44 ) *
On tam jest standardowo, w Twoim systemie widocznie go nie ma (powód mi bliżej nieznany).


plik hosts znalazłam w dość dziwnej lokalizacji do której nie mam dostępu z żadnego poziomu.

Zatem uważasz, że powinnam sobie stworzyć to czego brakuje?


--------------------
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 20.08.2025 - 08:42