PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : VirtualHost im netzwerk nur über /etc/Hosts



Fab96
21.08.07, 12:25
Hi, habdas Problem das ich 3 Seiten im Netzwerk laufen lassen will.

einmal unter /srv/www sowie 2 andere, mein Problem ist nun das ich bis jetzt 2 VirtualHosts eingerichtet habe aber per Browser nicht auf die richtige Seite komme.

Was muss ich einstellen damit ich etwa über test.test die passende seite bekomme und über test auch die passende?
Hab schon gesucht aber irgendwie nicht das richtige gefunden.

Wie sollte eine hosts datei auf dem server aussehen damit dies klappt?
Bin da momentan etwas ratlos.

marce
21.08.07, 12:27
Die hosts-Datei des Servers sollte dabei recht egal sein - der Client muss die entsprechende Info mitliefern...

Sind's denn Name-Based oder Port/IP-Bases virt. Hosts?

Poste am besten doch einfach mal die Config...

Fab96
21.08.07, 12:42
So, kaum ruf ich um hilfe hab ich es gelöst.

Es ist NameBased, ich habe nun für default( htdocs (da.com)) ein virtualHost erstellt und im virtualHost der subdomain(marketing.da.com als beispiel) ein NameVirtualHost eingetragen mit der IP des Servers.
Nun funktioniert es, frage ist nur ob es so auch von außerhalb des netzwerkes klappen würde auf da.com zuzugreifen.

Fab96
21.08.07, 15:22
Aber eine andere frage hab ich nun leider doch noch

Ich habe nun einen weiteren VirtualHost der mit SSL läuft, worran könnte es liegen das ich die anderen 2 VirtualHosts erreiche aberdenmit SSL nicht ?
Er lädt und lädt und nichts passiert.

zyrusthc
21.08.07, 15:38
Aber eine andere frage hab ich nun leider doch noch

Ich habe nun einen weiteren VirtualHost der mit SSL läuft, worran könnte es liegen das ich die anderen 2 VirtualHosts erreiche aberdenmit SSL nicht ?
Er lädt und lädt und nichts passiert.

Du könntest den Eintrag hier einfach mal posten!
So können wir auch sehen was eventuell nicht richtig ist!

Greeez Oli

Fab96
21.08.07, 15:45
Du könntest den Eintrag hier einfach mal posten!
So können wir auch sehen was eventuell nicht richtig ist!

Greeez Oli

Mag sein, aber so lern ich weniger wen mir direkt gesagt werden würde wo der fehler ist, aber anonsten hast du schon recht.

hierdie accounting.conf, hab einige kommentare gelöscht damit es weniger ist, die anderen virtualhosts sind in anderen conf dateien.


<IfDefine SSL>
<IfDefine !NOSSL>

##
## SSL Virtual Host Context
##

<VirtualHost accounting.da.com:443>

# General setup for the virtual host
DocumentRoot "/srv/www/accounting"
ServerName accounting.da.com:443
#ServerAdmin webmaster@example.com
ErrorLog /var/log/apache2/error_log
TransferLog /var/log/apache2/access_log

# don't loose time with IP address lookups
HostnameLookups Off

# needed for named virtual hosts
UseCanonicalName On

# configures the footer on server-generated documents
ServerSignature On


# SSL Engine Switch:
# Enable/Disable SSL for this virtual host.
SSLEngine on

# SSL Cipher Suite:
# List the ciphers that the client is permitted to negotiate.
# See the mod_ssl documentation for a complete list.
SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSL v2:+EXP:+eNULL

# Server Certificate:
# Point SSLCertificateFile at a PEM encoded certificate. If
# the certificate is encrypted, then you will be prompted for a
# pass phrase. Note that a kill -HUP will prompt again. Keep
# in mind that if you have both an RSA and a DSA certificate you
# can configure both in parallel (to also allow the use of DSA
# ciphers, etc.)
SSLCertificateFile /etc/apache2/ssl.crt/accounting.crt
#SSLCertificateFile /etc/apache2/ssl.crt/server-dsa.crt

# Server Private Key:
# If the key is not combined with the certificate, use this
# directive to point at the key file. Keep in mind that if
# you've both a RSA and a DSA private key you can configure
# both in parallel (to also allow the use of DSA ciphers, etc.)
SSLCertificateKeyFile /etc/apache2/ssl.key/accounting.key
#SSLCertificateKeyFile /etc/apache2/ssl.key/server-dsa.key

# Server Certificate Chain:
# Point SSLCertificateChainFile at a file containing the
# concatenation of PEM encoded CA certificates which form the
# certificate chain for the server certificate. Alternatively
# the referenced file can be the same as SSLCertificateFile
# when the CA certificates are directly appended to the server
# certificate for convinience.
#SSLCertificateChainFile /etc/apache2/ssl.crt/ca.crt

# Certificate Authority (CA):
# Set the CA certificate verification path where to find CA
# certificates for client authentication or alternatively one
# huge file containing all of them (file must be PEM encoded)
# Note: Inside SSLCACertificatePath you need hash symlinks
# to point to the certificate files. Use the provided
# Makefile to update the hash symlinks after changes.
#SSLCACertificatePath /etc/apache2/ssl.crt
#SSLCACertificateFile /etc/apache2/ssl.crt/ca-bundle.crt

# Certificate Revocation Lists (CRL):
# Set the CA revocation path where to find CA CRLs for client
# authentication or alternatively one huge file containing all
# of them (file must be PEM encoded)
# Note: Inside SSLCARevocationPath you need hash symlinks
# to point to the certificate files. Use the provided
# Makefile to update the hash symlinks after changes.
#SSLCARevocationPath /etc/apache2/ssl.crl
#SSLCARevocationFile /etc/apache2/ssl.crl/ca-bundle.crl

# Client Authentication (Type):
# Client certificate verification type and depth. Types are
# none, optional, require and optional_no_ca. Depth is a
# number which specifies how deeply to verify the certificate
# issuer chain before deciding the certificate is not valid.
#SSLVerifyClient require
#SSLVerifyDepth 10


<Files ~ "\.(cgi|shtml|phtml|php3?)$">
SSLOptions +StdEnvVars
</Files>
<Directory "/srv/www/cgi-bin">
SSLOptions +StdEnvVars
</Directory>




SetEnvIf User-Agent ".*MSIE.*" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0


CustomLog /var/log/apache2/ssl_request_log ssl_combined

<Directory "/srv/www/accounting">

I MultiViews

Options Indexes FollowSymLinks


AllowOverride None


Order allow,deny
# Allow from 192.168.5.0/24
Allow from all
</Directory>
</VirtualHost>
</IfDefine>
</IfDefine>


wenn ich ohne ssl aufrufe klappt es(bekomme den default host)

zyrusthc
21.08.07, 15:50
Das ist aber die Allgemeine SSL Konfigurations für Virtual Hosts!
Ich dachte du hast einen eigenen vhost angelegt!?

Existiert das Zertifikat den?
Was wird in den Logs geschrieben wenn du die Seite aufrufst?

Fab96
21.08.07, 15:56
hab ich ja auch,hab nur die beiden templates miteinnader mehr oder weniger verküpft

wenn ich die seite per ssl aufrufe sagt er mir garnix,´.
und Zertifikat ist erstellt, lokal hab ich es auch angenommen da ging es ja anscheind troz dem folgendem im error log:


[Tue Aug 21 15:41:23 2007] [error] Init: Unable to read pass phrase [Hint: key introduced or changed before restart?]
[Tue Aug 21 15:41:23 2007] [error] SSL Library Error: 218710120 error:0D094068:asn1 encoding routines:d2i_ASN1_SET:bad tag
[Tue Aug 21 15:41:23 2007] [error] SSL Library Error: 218529960 error:0D0680A8:asn1 encoding routines:ASN1_CHECK_TLEN:wrong tag
[Tue Aug 21 15:41:23 2007] [error] SSL Library Error: 218595386 error:0D07803A:asn1 encoding routines:ASN1_ITEM_EX_D2I:nested asn1 error
[Tue Aug 21 15:41:23 2007] [error] SSL Library Error: 218734605 error:0D09A00D:asn1 encoding routines:d2i_PrivateKey:ASN1 lib
[Tue Aug 21 15:41:50 2007] [warn] RSA server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Tue Aug 21 15:41:50 2007] [warn] RSA server certificate CommonName (CN) `FZ' does NOT match server name!?
[Tue Aug 21 15:41:51 2007] [warn] RSA server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Tue Aug 21 15:41:51 2007] [warn] RSA server certificate CommonName (CN) `FZ' does NOT match server name!?
[Tue Aug 21 15:41:51 2007] [notice] Apache/2.2.0 (Linux/SUSE) configured -- resuming normal operations


Dies kann aber daran liegen das ich das Yast modul mal getestet hab, könnt eventuell hinhauen mit der zeit



192.168.5.136 - - [21/Aug/2007:16:00:42 +0200] "GET / HTTP/1.1" 304 -

steht im access log wenn ich lokal zugreife.

zyrusthc
21.08.07, 16:01
Versuche es einfach mal ganz schlicht mit diesem VHost!

<VirtualHost accounting.da.com:443>
DocumentRoot /srv/www/accounting
ServerName accounting.da.com:443
<Directory "/srv/www/accounting">
allow from all
Options +Indexes
</Directory>
SSLEngine on
SSLCertificateFile /etc/apache2/ssl.crt/accounting.crt
SSLCertificateKeyFile /etc/apache2/ssl.key/accounting.key
</VirtualHost>


Greeez Oli

Fab96
21.08.07, 16:06
Das gleiche, aber die Fehler von oben sind es wohl, sollt wohl nochmal das Zertifikat neumachen da der fehler beim starten des apache immer kommt, wie ich eben rausfand.

marce
21.08.07, 16:13
wie startest Du denn den Apache?

Fab96
21.08.07, 19:31
mit rcapache2 start oder eben reload oder restart, je nachdem was nötig ist

marce
21.08.07, 19:33
... und start-ssl ist in dem Script aktiviert?

Fab96
21.08.07, 19:35
gute frage, bei apache2ctl oder wie das heißt gibt es kein startssl mehr laut ausgabe.
Aber SSL sollt ja aktiviert sein wenn ich Lokal das Zertifikat akzeptieren kann, nur eben nicht von einem rechner ausdem Netzwerk.