Problem mit subdomains

Debian macht sich hervorragend als Web- und Mailserver. Schau auch in den " Tipps und Tricks"-Bereich.
Antworten
joejoe87577
Beiträge: 2
Registriert: 27.12.2016 18:21:04

Problem mit subdomains

Beitrag von joejoe87577 » 27.12.2016 18:29:07

Hallo zusammen,

ich habe einen apache2 auf dem Owncloud läuft. Jetzt wollte ich eine neue Anwendung unter einer subdomain hinzufügen.
Ordnerstruktur in /var/www:
  • /owncloud <-- Owncloud Installation
    /Codiad <-- Neue Anwedung
Mein Domain Name hab ich durch example.org ersetzt.
Meine default-ssl.conf

Code: Alles auswählen

<VirtualHost code.example.org:443>
		ServerAdmin webmaster@localhost

		DocumentRoot /var/www/Codiad
		<Directory /var/www/Codiad>
			Options Indexes FollowSymLinks MultiViews			
		</Directory>
		#LogLevel info ssl:warn

		ErrorLog ${APACHE_LOG_DIR}/error.log
		CustomLog ${APACHE_LOG_DIR}/access.log combined
		#Include conf-available/serve-cgi-bin.conf
		SSLEngine on
		SSLCertificateFile    /etc/letsencrypt/live/example.org/fullchain.pem
		SSLCertificateKeyFile /etc/letsencrypt/live/example.org/privkey.pem
		#SSLCertificateChainFile /etc/apache2/ssl.crt/server-ca.crt
		#SSLCACertificatePath /etc/ssl/certs/
		#SSLCACertificateFile /etc/apache2/ssl.crt/ca-bundle.crt
		#SSLCARevocationPath /etc/apache2/ssl.crl/
		#SSLCARevocationFile /etc/apache2/ssl.crl/ca-bundle.crl
		#SSLVerifyClient require
		#SSLVerifyDepth  10
		#SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire
		<FilesMatch "\.(cgi|shtml|phtml|php)$">
				SSLOptions +StdEnvVars
		</FilesMatch>
		<Directory /usr/lib/cgi-bin>
				SSLOptions +StdEnvVars
		</Directory>
		BrowserMatch "MSIE [2-6]" \
				nokeepalive ssl-unclean-shutdown \
				downgrade-1.0 force-response-1.0
		# MSIE 7 and newer should be able to use keepalive
		BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown
	</VirtualHost>
	<VirtualHost _default_:443>
		ServerAdmin webmaster@localhost

		DocumentRoot /var/www/owncloud
		<Directory /var/www/owncloud>
			Options Indexes FollowSymLinks MultiViews
			AllowOverride All
			Order allow,deny
			allow from all
		</Directory>
		#LogLevel info ssl:warn

		ErrorLog ${APACHE_LOG_DIR}/error.log
		CustomLog ${APACHE_LOG_DIR}/access.log combined
		#Include conf-available/serve-cgi-bin.conf
		SSLEngine on
		SSLCertificateFile    /etc/letsencrypt/live/example.org/fullchain.pem
		SSLCertificateKeyFile /etc/letsencrypt/live/example.org/privkey.pem
		#SSLCertificateChainFile /etc/apache2/ssl.crt/server-ca.crt
		#SSLCACertificatePath /etc/ssl/certs/
		#SSLCACertificateFile /etc/apache2/ssl.crt/ca-bundle.crt
		#SSLCARevocationPath /etc/apache2/ssl.crl/
		#SSLCARevocationFile /etc/apache2/ssl.crl/ca-bundle.crl
		#SSLVerifyClient require
		#SSLVerifyDepth  10
		#SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire
		<FilesMatch "\.(cgi|shtml|phtml|php)$">
				SSLOptions +StdEnvVars
		</FilesMatch>
		<Directory /usr/lib/cgi-bin>
				SSLOptions +StdEnvVars
		</Directory>
		BrowserMatch "MSIE [2-6]" \
				nokeepalive ssl-unclean-shutdown \
				downgrade-1.0 force-response-1.0
		# MSIE 7 and newer should be able to use keepalive
		BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown

	</VirtualHost>
Mein Problem ist jetzt, dass die subdomain code.example.org nicht auf den Ordner "/var/www/Codiad" verweist, sondern mich auf "/var/www/owncloud" leitet. Per HTTP läuft alles, weil da nichts anderes drauf gebunden ist. Die DNS Einträge passen, sowohl von extern als auch von intern.
Auch die Rechte für die Ordner sind richtig auf www-data gesetzt.

Da ich leider kein wirklicher Kenner von Linux bin (bin froh das Owncloud sauber läuft :D ) wäre ich über eine verständliche Erklärung was ich falsch mache froh.

Grüße

DeletedUserReAsG

Re: Problem mit subdomains

Beitrag von DeletedUserReAsG » 27.12.2016 20:21:43

Schau‘ dir mal die ServerName-Direktive an – wahrscheinlich suchst du eher das, anstelle des Hostnamens in den VirtualHosts.

joejoe87577
Beiträge: 2
Registriert: 27.12.2016 18:21:04

Re: Problem mit subdomains

Beitrag von joejoe87577 » 27.12.2016 20:44:40

Das war es, danke.
Nachdem ich den Domainnamen für code.example.org entfernt habe und die Servernamen entsprechend gesetzt hab, funktioniert es.

Antworten