Nextcloud in Unterordner

Woodz

Lieutenant
Registriert
Apr. 2009
Beiträge
721
Hallo.

Ich habe schon wieder ein Problem mit meiner Nextcloud Installation.
Ich möchte eigentlich, dass ich unter der IP meines Servers: http://192.168.1.150 die Webseite und unter http://192.168.1.150/nextcloud/ im Browser die Anmeldeseite für Nextcloud aufrufen kann. Nextcloud also unter einem Unterordner läuft.

Dazu hatte ich eigentlich Nextcloud in einen Unterordner installiert, aber nach der Installation von Nextcloud komme ich nun immer auf die Nextcloud-Anmeldeseite, egal ob mit oder ohne "/nextcloud/" nach der IP.

Hier sind mal Auszüge aus meinen Config Dateien:

Die Erste:
/var/www/nextcloud/config/config.php

<?php
$CONFIG = array (
'instanceid' => 'xxx',
'passwordsalt' => 'xxx',
'secret' => 'xxx',
'trusted_domains' =>
array (
0 => '192.168.1.150',
),
'datadirectory' => '/var/www/nextcloud/data',
'overwrite.cli.url' => 'http://192.168.1.150',
'dbtype' => 'mysql',
'version' => '13.0.5.2',
'dbname' => 'xxx',
'dbhost' => 'xxx',
'dbport' => '',
'dbtableprefix' => 'oc_',
'mysql.utf8mb4' => true,
'dbuser' => 'xxx',
'dbpassword' => 'xxx',
'installed' => true,
);


Die Zweite:
/etc/apache2/sites-enabled/nextcloud.conf:

<VirtualHost *:80>
ServerAdmin admin@example.com
DocumentRoot /var/www/nextcloud/
ServerName 192.168.1.150
ServerAlias 192.168.1.150

Alias /nextcloud "/var/www/nextcloud/"

<Directory /var/www/nextcloud/>
Options +FollowSymlinks
AllowOverride All
Require all granted
<IfModule mod_dav.c>
Dav off
</IfModule>
SetEnv HOME /var/www/nextcloud
SetEnv HTTP_HOME /var/www/nextcloud
</Directory>

ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>


Die Webseite liegt im Verzeichnis:
/var/www/html/

Es gibt einige Tutorial im Web, aber die beschäftigen sich nur damit, wie man Nextcloud ohne Unterordner erreicht, was für mich unverständlich ist, weil nach 2 Installationen für mich Nextcloud immer über die IP erreichbar ist.
 
Ist das dein einziger Host? Apache verwendet den ersten gefundenen Host auch als Default Host.
 
Es gibt im Ordner:
/etc/apache2/sites-enabled/

noch die conf-Datei:
000-default.conf

Mit folgendem Inhalt:


<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
#ServerName www.example.com

ServerAdmin webmaster@localhost
DocumentRoot /var/www/html

# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn

ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined

# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
</VirtualHost>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

Aber damit kann ich nicht so wirklich was anfangen. Ngnix kommt für mich eigentlich nicht in Frage. Performance Vorteile gibt es eigentlich nur beim Raspberry und das System ist bereits soweit aufgesetzt.
 
Bitte bette Auszüge deiner Configfiles in BB-Code der Form <CODE></CODE> ein!

Eine sehr einfach Möglichkeit wäre ja erst einmal die 000-default.conf zu beachet. Wenn du deine NC-Instant einfach nach /var/www/html/nextcloud geschoben hättest, wäre viel gewonnen. Dann wäre [..]/html dein Rootverzeichnis auf dem Webserver welches du via http://[ip]/ erreichen könntest und http://[ip]/nextcloud würde auf den NC Ordner auf dem Server zeigen (yeah!).
Gleichzeitig würde für NC auch gleich die sinnvolle default Config gelten.

Die nextcloud.conf für den Apache kann entsprechend kompakter ausfallen

Code:
<Directory /var/www/html/nextcloud/>
  Options +FollowSymlinks
  AllowOverride All

<IfModule mod_dav.c>
  Dav off
</IfModule>

SetEnv HOME /var/www/html/nextcloud
SetEnv HTTP_HOME /var/www/html/nextcloud

</Directory>

Wobei ich empfehle, dass du nur Elemente meiner Config übernimmst deren Sinn du verstehst. Ansonsten rennst du in die selben Probleme die du jetzt hast, indem du Anleitungen 1zu1 übernimmst, wobei du nicht zu verstehen scheinst was du dort tust.

Die [..]/nextcloud/config/config.php solltest du dir auch mal anschauen. Da vor allem die Zeile 'overwrite.cli.url' (und gleichmal nachschauen was die Zeile tut)
 
Meine erste NC Installation war im Ordner /var/www/html/nextcloud. Nur da hatte ich das gleiche Problem.
'overwrite.cli.url' => 'http://192.168.1.150', muesste zu 'overwrite.cli.url' => 'http://192.168.1.150/nextcloud' umbenannt werden?
 
Netter Humor. Gefällt mir. ;)

Also, ich habe jetzt den Nextcloudordner in [...]/html/ verschoben. Entsprechend die beiden Config-Dateien angepasst und es funktioniert.

Super! Ich danke vielmals für die Hilfe. War ja gar nicht so schwer :D.

Beste Grüße
 
Zurück
Oben