Skocz do zawartości
Zaloguj się, aby obserwować  
Kacper Sieradziński

Problem Z Vhostami

Polecane posty

Opis problemu

 

Działa to tak, że *.domena.pl jest przekierowane na /var/www/. Ustawiam zatem vhosta, żeby mieć pewność, że wszystko ok to robie to w możliwie mało skomplikowany sposób, tzn.

 

<VirtualHost xx.xxx.xx.xx:80>

ServerAdmin webmaster@subdomena.domena.pl

ServerName subdomena.domena.pl

ServerAlias www.subdomena.domena.pl subdomena.domena.pl

DocumentRoot /home/user/public_html;

 

<Directory /home/user/public_html/>

# httpd dmn entry PHP support BEGIN.

# httpd dmn entry PHP support END.

Options -Indexes Includes FollowSymLinks MultiViews

AllowOverride All

Order allow,deny

Allow from all

</Directory>

</VirtualHost>

 

 

Jednak wpis subdomena.domena.pl dalej przekierowuje cały ruch do /var/www/

 

oba dnsy mam skonfigurowane na jednym ip, udalo mi sie podpiac domeny, jednak w deamon.logu wyswietla mi sie blad

 

refresh: unexpected rcode (SERVFAIL) from master

 

zagoglowalem za tym i po wpisaniu

 

named -g -d 5

 

wyswietla mi sie

 

04-Jan-2008 19:12:31.834 mgr_gethash

04-Jan-2008 19:12:31.834 req_send: request 0x80c39b0

04-Jan-2008 19:12:31.834 dns_request_createvia: request 0x80c39b0

04-Jan-2008 19:12:31.834 req_senddone: request 0x80c39b0

04-Jan-2008 19:12:31.835 client xx.xx.xx.xx#2134: UDP request

04-Jan-2008 19:12:31.835 client xx.xx.xx.xx#2134: using view '_default'

04-Jan-2008 19:12:31.835 client xx.xx.xx.xx#2134: request is not signed

04-Jan-2008 19:12:31.835 client xx.xx.xx.xx#2134: recursion available

04-Jan-2008 19:12:31.835 client xx.xx.xx.xx#2134: query

04-Jan-2008 19:12:31.836 client xx.xx.xx.xx#2134: error

04-Jan-2008 19:12:31.836 client xx.xx.xx.xx#2134: send

04-Jan-2008 19:12:31.836 client xx.xx.xx.xx#2134: sendto

04-Jan-2008 19:12:31.836 client xx.xx.xx.xx#2134: senddone

04-Jan-2008 19:12:31.836 client xx.xx.xx.xx#2134: next

04-Jan-2008 19:12:31.837 client xx.xx.xx.xx#2134: endrequest

04-Jan-2008 19:12:31.837 client @0x80da538: udprecv

04-Jan-2008 19:12:31.837 req_response: request 0x80c39b0: success

04-Jan-2008 19:12:31.837 req_cancel: request 0x80c39b0

04-Jan-2008 19:12:31.838 req_sendevent: request 0x80c39b0

04-Jan-2008 19:12:31.838 refresh_callback: zone sec.gargamel.eu.org/IN: enter

04-Jan-2008 19:12:31.838 dns_request_getresponse: request 0x80c39b0

04-Jan-2008 19:12:31.838 zone sec.xxx.xxx/IN: refresh: unexpected rcode (SERVFAIL) from master 89.171.60.49#53 (source 0.0.0.0#0)

04-Jan-2008 19:12:31.838 dns_request_destroy: request 0x80c39b0

04-Jan-2008 19:12:31.839 req_destroy: request 0x80c39b0

04-Jan-2008 19:12:31.839 requestmgr_detach: 0x80f8ff0: eref 1 iref 0

 

Nie wiem o co chodzi w tym pierwszym błędzie(czy to błąd?).

 

named-checkconf
nie wypluwa zadnych bledow.

 

Bardzo dziękuje za wszelką pomoc,

Kacper Sieradziński

Udostępnij ten post


Link to postu
Udostępnij na innych stronach

Skoro ta druga domena wyświetla /var/www/html/ to znaczy, że DNS działa (kieruje na odpowiedni IP). Tylko sam virtualhost nie działa.. skoro IP jak wnioskuje jest ten sam dla obu stron to powinieneś mieć włączone NameVirtualhosts a nie pokazałeś tego we fragmencie konfiguracji.. Może tu leży problem?

Udostępnij ten post


Link to postu
Udostępnij na innych stronach

Czyli teraz masz w przyblizeniu taki setup:

NameVirtualhost XXX.XXX.XXX.XXX:80

<Virtualhost XXX.XXX.XXX.XXX:80>

ServerName subdomena.domena.pl

</Virtualhost>

 

Tak? Co mówią logi apache? Może w error_log znajdziesz jakiś warning na temat NameVirtualhost podczas uruchamiania?

Udostępnij ten post


Link to postu
Udostępnij na innych stronach
NameVirtualHost moj.zewn.nr.ip

<VirtualHost xx.xxx.xx.xx:80>

ServerAdmin webmaster@subdomena.domena.pl

ServerName subdomena.domena.pl

ServerAlias www.subdomena.domena.pl subdomena.domena.pl

DocumentRoot /home/user/public_html;

 

<Directory /home/user/public_html/>

# httpd dmn entry PHP support BEGIN.

# httpd dmn entry PHP support END.

Options -Indexes Includes FollowSymLinks MultiViews

AllowOverride All

Order allow,deny

Allow from all

</Directory>

</VirtualHost>

 

Error logi sledze caly czas :

 

[Tue Jan 01 00:00:06 2008] [notice] Apache/2.2.3 (Debian) PHP/5.2.0-8+etch7 configured -- resuming normal operations

[Tue Jan 01 13:28:06 2008] [error] [client 84.80.66.165] client sent HTTP/1.1 request without hostname (see RFC2616 section 14.23): /w00tw00t.at.ISC.SANS.DFind:)

[Tue Jan 01 20:06:06 2008] [notice] caught SIGTERM, shutting down

[Tue Jan 01 20:06:08 2008] [notice] Apache/2.2.3 (Debian) PHP/5.2.0-8+etch7 configured -- resuming normal operations

[Wed Jan 02 00:00:04 2008] [notice] caught SIGTERM, shutting down

[Wed Jan 02 00:00:06 2008] [notice] Apache/2.2.3 (Debian) PHP/5.2.0-8+etch7 configured -- resuming normal operations

[Thu Jan 03 00:00:04 2008] [notice] caught SIGTERM, shutting down

[Thu Jan 03 00:00:06 2008] [notice] Apache/2.2.3 (Debian) PHP/5.2.0-8+etch7 configured -- resuming normal operations

[Thu Jan 03 06:07:53 2008] [error] [client 66.249.66.140] File does not exist: /var/www/robots.txt

[Thu Jan 03 20:30:53 2008] [notice] caught SIGTERM, shutting down

[Thu Jan 03 20:30:56 2008] [notice] Apache/2.2.3 (Debian) PHP/5.2.0-8+etch7 configured -- resuming normal operations

[Thu Jan 03 20:32:06 2008] [notice] caught SIGTERM, shutting down

[Thu Jan 03 20:32:09 2008] [notice] Apache/2.2.3 (Debian) PHP/5.2.0-8+etch7 configured -- resuming normal operations

[Thu Jan 03 20:33:34 2008] [notice] caught SIGTERM, shutting down

[Thu Jan 03 20:33:36 2008] [notice] Apache/2.2.3 (Debian) PHP/5.2.0-8+etch7 configured -- resuming normal operations

[Thu Jan 03 20:33:43 2008] [error] [client 78.131.192.2] File does not exist: /var/www/fgg

[Thu Jan 03 20:36:06 2008] [notice] caught SIGTERM, shutting down

[Thu Jan 03 20:36:09 2008] [notice] Apache/2.2.3 (Debian) PHP/5.2.0-8+etch7 configured -- resuming normal operations

[Thu Jan 03 21:23:31 2008] [notice] caught SIGTERM, shutting down

[Thu Jan 03 21:23:33 2008] [notice] Apache/2.2.3 (Debian) PHP/5.2.0-8+etch7 configured -- resuming normal operations

[Thu Jan 03 21:26:51 2008] [notice] caught SIGTERM, shutting down

[Thu Jan 03 21:26:53 2008] [notice] Apache/2.2.3 (Debian) PHP/5.2.0-8+etch7 configured -- resuming normal operations

[Fri Jan 04 00:00:03 2008] [notice] caught SIGTERM, shutting down

[Fri Jan 04 00:00:06 2008] [notice] Apache/2.2.3 (Debian) PHP/5.2.0-8+etch7 configured -- resuming normal operations

[Fri Jan 04 09:54:29 2008] [error] [client 62.148.0.148] client sent HTTP/1.1 request without hostname (see RFC2616 section 14.23): /w00tw00t.at.ISC.SANS.DFind:)

Udostępnij ten post


Link to postu
Udostępnij na innych stronach
NameVirtualHost moj.zewn.nr.ip

<VirtualHost xx.xxx.xx.xx:80>

Glowy nie dam, ale zdaje sie, ze powinno byc NameVirtualHost xx.xxx.xx.xx:80.

Udostępnij ten post


Link to postu
Udostępnij na innych stronach

Dokładnie, tak jak napisałem wyżej - adres(y) IP podawany NameVirtualHost określa na jakich adresach nasłuchiwać połączeń, które będą obsługiwane przez virtualhosty. Toteż adres ten musi być tym samym jaki jest podany w dyrektywie <virtualhost>.

Udostępnij ten post


Link to postu
Udostępnij na innych stronach
tested, not working
Working, tylko cos zle robisz :)

 

Ew. mozesz sprobowac tego (przynajmniej unikniemy smiesznego maskowania xx.xx.xx.xx / moj.zewn.nr.ip, ktore na pewno nie pomaga w zlokalizowaniu problemu :)):

NameVirtualHost *:*

<VirtualHost _default_:*>
ServerName domena.pl
(...)
</VirtualHost>

Udostępnij ten post


Link to postu
Udostępnij na innych stronach

whohow, to działa :)

wróciłem do :80, ale reszta musi pozostać taka jak mi podałeś. Czy to przeszkodzi w późniejszym wykorzystywaniu vhostów?

 

____

zbyt wczesna euforia

 

 

NameVirtualHost *:80

 

<VirtualHost _default_:80>

ServerAdmin webmaster@kacper.mypress.pl

ServerName kacper.mypress.pl

ServerAlias kacper.mypress.pl

DocumentRoot /home/kacperek/public_html/

</VirtualHost>

 

Teraz wszystkie vhosty przekierowywane są pod home/kacperek/public_html/

Udostępnij ten post


Link to postu
Udostępnij na innych stronach
whohow, to działa :)
Fajnie. Jestes pewien, ze wczesniej xx.xx.xx.xx == moj.zewn.nr.ip == Twoj.faktyczny.adres.IP? :)

 

wróciłem do :80, ale reszta musi pozostać taka jak mi podałeś. Czy to przeszkodzi w późniejszym wykorzystywaniu vhostów?
Nie.

Udostępnij ten post


Link to postu
Udostępnij na innych stronach
zbyt wczesna euforia

 

Teraz wszystkie vhosty przekierowywane są pod home/kacperek/public_html/

A poprawiles wszystkie dyrektywy <VirtualHost/> czy tylko ta jedna?

Udostępnij ten post


Link to postu
Udostępnij na innych stronach
A poprawiles wszystkie dyrektywy <VirtualHost/> czy tylko ta jedna?
tylko jedną miałem, teraz wygląda to tak :
NameVirtualHost *:80	<VirtualHost _default_:80>		ServerAdmin admin@mypress.pl		ServerName mypress.pl		ServerAlias mypress.pl		DocumentRoot /var/www/	</VirtualHost>	<VirtualHost _default_:80>		ServerAdmin webmaster@kacper.mypress.pl		ServerName kacper.mypress.pl		ServerAlias kacper.mypress.pl		DocumentRoot /home/kacperek/public_html/	</VirtualHost>

Przekierowuje cały ruch na vhost ktora jest najwyzejA nie! moja wina.Dzięki wielkie za pomoc. Można zamknąć :)

Udostępnij ten post


Link to postu
Udostępnij na innych stronach
:)

 

to mały jest offtop, ale czy Jan 4 21:27:32 Gargamel named[23950]: zone sec.mypress.pl/IN: refresh: unexpected rcode (SERVFAIL) from master 89.171.60.49#53 (source 0.0.0.0#0)

 

tez moze byc winne ze wzgledu na to, ze ma problem z tym ip? normalnie jak pinguje mypress.pl to mi wskazuje to ip, ktore wpisuje.. jaki moze byc inny powod tego?

 

===

wpisalem w named 127.0.0.1 w obu miejscach gdyie jest ip i tez wali ten blad

Udostępnij ten post


Link to postu
Udostępnij na innych stronach
to mały jest offtop, ale czy Jan 4 21:27:32 Gargamel named[23950]: zone sec.mypress.pl/IN: refresh: unexpected rcode (SERVFAIL) from master 89.171.60.49#53 (source 0.0.0.0#0)
Wyglada na to, ze synchronizacja pomiedzy primary a secondary nie przechodzi. Mam wrazenie, czy z jakis (zlych!) powodow ustawiles strefy master i slave na tym samym hoscie?

 

tez moze byc winne ze wzgledu na to, ze ma problem z tym ip? normalnie jak pinguje mypress.pl to mi wskazuje to ip, ktore wpisuje.. jaki moze byc inny powod tego?
...to nie moze byc odpowiedzialne za Twoje problemy z Apache :)

Udostępnij ten post


Link to postu
Udostępnij na innych stronach

Zaloguj się, aby skomentować

Będziesz mógł dodać komentarz po zalogowaniu się



Zaloguj się
Zaloguj się, aby obserwować  

×