问题描述:

yesterday i reconfigured my apache. On my server i have 3 domains. And 1 domain dont work now. if i want to go to my domain www.herrbockwurst.de it always brings me to www.hohndorf.com. I tested with wireshark and even there, if i want to connect to www.herrbockwurst.de the logs are never talking about herrbockwurst.de, just about hohndorf.com.

here i give you my vhosts:

<VirtualHost *:80>

#Normale Homepage

ServerName www.hohndorf.com

ServerAlias hohndorf.com

Redirect permanent / https://www.hohndorf.com/

CustomLog ${APACHE_LOG_DIR}/hohndorf.log combined

</VirtualHost>

<VirtualHost *:443>

SSLEngine on

SSLCertificateFile /etc/apache2/ssl/hohndorf/fullchain.pem

SSLCertificateKeyFile /etc/apache2/ssl/hohndorf/privkey.pem

SSLCertificateChainFile /etc/apache2/ssl/hohndorf/fullchain.pem

#Normale Homepage

ServerName www.hohndorf.com

ServerAlias hohndorf.com

DocumentRoot /var/www/hohndorf

CustomLog ${APACHE_LOG_DIR}/hohndorf.log combined

<Directory /var/www/hohndorf>

AllowOverride All

</Directory>

</VirtualHost>

<VirtualHost *:443>

SSLEngine on

SSLCertificateFile /etc/apache2/ssl/hohndorf/fullchain.pem

SSLCertificateKeyFile /etc/apache2/ssl/hohndorf/privkey.pem

SSLCertificateChainFile /etc/apache2/ssl/hohndorf/fullchain.pem

# Piwik

ServerName static.hohndorf.com

ServerAlias stats.hohndorf.com

DocumentRoot /var/www/piwik

CustomLog ${APACHE_LOG_DIR}/hohndorf.log combined

</VirtualHost>

<VirtualHost *:80>

# Piwik

ServerName static.hohndorf.com

ServerAlias stats.hohndorf.com

Redirect permanent / https://stats.hohndorf.com/

CustomLog ${APACHE_LOG_DIR}/hohndorf.log combined

</VirtualHost>

<VirtualHost *:443>

SSLEngine on

SSLCertificateFile /etc/apache2/ssl/hohndorf/fullchain.pem

SSLCertificateKeyFile /etc/apache2/ssl/hohndorf/privkey.pem

SSLCertificateChainFile /etc/apache2/ssl/hohndorf/fullchain.pem

ServerName www.hohndorf.com

ServerAlias hohndorf.com static.hohndorf.com stats.hohndorf.com

CustomLog ${APACHE_LOG_DIR}/hohndorf.log combined

</VirtualHost>

And here the other vhost

<VirtualHost *>

ServerName www.herrbockwurst.de

ServerAlias herrbockwurst.de

DocumentRoot /var/www/herrbockwurst

CustomLog ${APACHE_LOG_DIR}/herrbockwurst.log combined

<Directory /var/www/herrbockwurst>

AllowOverride All

</Directory>

</VirtualHost>

Have u any idea why i always get to hohndorf.com?

EDIT:

i did a trace with lynx wich show me the redirect. But for me it makes no sense why this redirects. the only redirect i got to this site is in the first vhost. but when i commend this out, it makes no change (or is the redirect stored in the session of the browser?).

HTParse: result:`herrbockwurst.de'

Composing Authorization for herrbockwurst.de:80/

HTAASetup_lookup: No template matched `' (so probably not protected)

HTTP: Not sending authorization (yet).

Writing:

GET / HTTP/1.0\r

Host: herrbockwurst.de\r

Accept: text/html, text/plain, text/sgml, text/css, application/xhtml+xml, */*;q=0.01\r

Accept-Encoding: gzip, compress, bzip2\r

Accept-Language: en\r

User-Agent: Lynx/2.8.9dev.8 libwww-FM/2.14 SSL-MM/1.4.1 GNUTLS/3.4.9\r

\r

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

Sending HTTP request.

HTTP: WRITE delivered OK

HTTP request sent; waiting for response.

HTTP: Trying to read 1535

HTTP: Read 540

HTTP: Rx: HTTP/1.1 301 Moved Permanently

HTTP: Scanned 2 fields from line_buffer

--- Talking HTTP1.

HTTP/1.1 301 Moved Permanently

StreamStack: Constructing stream stack for message/x-http-redirection to www/present ((null))

HTFormat: Looking up presentation for message/x-http-redirection to www/present

HTFormat: comparing text/* and message/x-http-redirection for half match

HTFormat: comparing text/* and message/x-http-redirection for half match

HTFormat: comparing text/* and message/x-http-redirection for half match

StreamStack: found weak wildcard match: www/present

FindPresentation: found exact match: message/x-http-redirection -> www/present

StreamStack: found exact match: message/x-http-redirection -> www/present

Stages *_getUCInfoStage 0:43:utf-8 1:-1: (2:-1:) 3:-1:

Stages *_setUCInfoStage 0:43:utf-8 1:-1: (2:43:utf-8) 3:-1:

Stages *_getUCInfoStage 0:43:utf-8 1:-1: 2:43:utf-8 (3:-1:)

Stages *_setUCInfoStage 0:43:utf-8 1:-1: 2:43:utf-8 (3:43:utf-8)

StreamStack: Returning "MIMEParser"

HTMIME: Date: Thu, 01 Dec 2016 14:16:17 GMT

Server: Apache/2.4.18 (Ubuntu)

Location: https://www.hohndorf.com/

Content-Length: 315

Connection: close

Content-Type: text/html; charset=iso-8859-1

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">

<html><head>

<title>301 Moved Permanently</title>

</head><body>

<h1>Moved Permanently</h1>

<p>The document has moved <a href="https://www.hohndorf.com/">here</a>.</p>

<hr>

<address>Apache/2.4.18 (Ubuntu) Server at herrbockwurst.de Port 80</address>

</body></html>

HTMIME: Got 'D' at beginning of line, checking for 'ate:'

HTMIME: PICKED UP Date: 'Thu, 01 Dec 2016 14:16:17 GMT'

HTMIME: Got 'S' at beginning of line, state now S

HTMIME: Was S, found E, state now SE'

HTMIME: Was SE, found R, checking for 'ver'

HTMIME: PICKED UP Server: 'Apache/2.4.18 (Ubuntu)'

HTMIME: Got 'L' at beginning of line, state now L

HTMIME: Was L, found O, checking for 'cation:'

HTMIME: PICKED UP Location: 'https://www.hohndorf.com/'

HTMIME: Got 'C' at beginning of line, state now C

HTMIME: Was C, found O, state now CO'

HTMIME: Was CO, found N, state now CON

HTMIME: Was CON, found T, checking for 'ent-'

HTMIME: in case CONTENT_

HTMIME: Was CONTENT_, found L, state now CONTENT_L

HTMIME: in case CONTENT_L

HTMIME: Was CONTENT_L, found E, checking for 'ngth:'

HTMIME: PICKED UP Content-Length: '315'

Converted to integer: '315'

HTMIME: Got 'C' at beginning of line, state now C

HTMIME: Was C, found O, state now CO'

HTMIME: Was CO, found N, state now CON

HTMIME: Was CON, found N, checking for 'ection:'

HTMIME: PICKED UP Connection: 'close'

HTMIME: Got 'C' at beginning of line, state now C

HTMIME: Was C, found O, state now CO'

HTMIME: Was CO, found N, state now CON

HTMIME: Was CON, found T, checking for 'ent-'

HTMIME: in case CONTENT_

HTMIME: Was CONTENT_, found T, state now CONTENT_T

HTMIME: in case CONTENT_T

HTMIME: Was CONTENT_T, found Y, checking for 'pe:'

HTMIME: PICKED UP Content-Type: 'text/html; charset=iso-8859-1'

Begin pumpData

...address{http://herrbockwurst.de/}

HTMIME: Extended MIME Content-Type is text/html;charset=iso-8859-1

Stages iso-8859-1*_getUCInfoStage (0:43:utf-8) 1:-1: 2:43:utf-8 3:43:utf-8

Stages iso-8859-1*_setUCInfoStage (0:0:iso-8859-1) 1:-1: 2:43:utf-8 3:43:utf-8

Stages iso-8859-1*_getUCInfoStage (0:0:iso-8859-1) 1:-1: 2:43:utf-8 3:43:utf-8

Stages iso-8859-1*_getUCInfoStage 0:0:iso-8859-1 1:-1: 2:43:utf-8 (3:43:utf-8)

Stages iso-8859-1*_setUCInfoStage 0:0:iso-8859-1 1:-1: 2:43:utf-8 (3:43:utf-8)

...pumpData finished reading header

...end of pumpData, copied 0 vs 315

HTCopy copied 0 actual, 315 limit

Data transfer complete

HTTP: Picked up location 'https://www.hohndorf.com/'

HTTP/1.1 301 Moved Permanently

HTAccess: status=399

HTAccess: 'http://herrbockwurst.de/' is a redirection URL.

HTAccess: Redirecting to 'https://www.hohndorf.com/'

相关阅读:
Top