zeraphie
Goto Top

Apache Server Vhost Datei

Hallo Administratoren/innen,

ich bin eigentlich nur Entwickler und brauche daher mal eure Hilfe zu einer Vhost Datei eines Ubuntu Servers.

Hoffe ich bin hier richtig und ihr könnt mir helfen. Also ich brauch eine Vhost datei, die erstmal per SSL geschützt ist, dies klappt auch.

Wenn ich jetzt aber www.beta.xxx.de aufrufe komme ich zur www.xxx.de seite es steht aber noch www.beta.xxx.de da. Könnte man nicht eine weiterleitung zu https://www.beta.xxx.de machen? Das dies auch direkt richtig in der adressleiste angezeigt wird?

Also mein bisherhiger Versuch sieht so aus: Gibt es da verbesserungsvorschläge und könnt ihr mir tipps geben die Probleme zubeheben die ich da habe?

<VirtualHost *:443>
ServerAdmin support@xxx.de

DocumentRoot /var/www/xxx.de
<Directory />
Options FollowSymLinks
AllowOverride all
</Directory>
<Directory /var/www/xxx.de>
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order allow,deny
allow from all
</Directory>

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>

ErrorLog /var/log/apache2/error.log

                  1. Possible values include: debug, info, notice, warn, error, crit,
                  2. alert, emerg.
LogLevel warn
CustomLog /var/log/apache2/access.log combined

Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>

SSLEngine On
SSLCertificateFile /etc/apache2/mycert/server.crt
SSLCertificateKeyFile /etc/apache2/mycert/server.key

</VirtualHost>

<VirtualHost *:443>
ServerName subs.xxx.de
ServerAlias *.xxx.de
UseCanonicalName Off
VirtualDocumentRoot /var/www/%-3+
SSLEngine On
SSLCertificateFile /etc/apache2/mycert/server.crt
SSLCertificateKeyFile /etc/apache2/mycert/server.key
CustomLog /var/www/access.log common
ErrorLog /var/www/error.log
<Directory />
Options FollowSymLinks
</Directory>
</VirtualHost>

Content-Key: 252162

Url: https://administrator.de/contentid/252162

Printed on: April 23, 2024 at 13:04 o'clock

Member: Zeraphie
Zeraphie Oct 20, 2014 at 08:28:42 (UTC)
Goto Top
Kann mir keiner helfen? oder habe ich mich einfach undeutlich ausgedrückt und keiner versteht mein problem?
Member: Ithariel
Ithariel Oct 24, 2014 at 14:16:15 (UTC)
Goto Top
Mach einfach nen Redirect im HTTP vHost:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^/(.*) https://domain.tld/$1
</IfModule>
Redirect / https://domain.tld/

Den Part in IfModule kannst du auch einfach in ne .htaccess schmeißen ;)