ich habe einen Apach2-Server am laufen. Dort drauf läuft eine nextcloud-Instanz. Aber auch Phpmyadmin und pihole. Die beiden letzt sollen nur lokal erreichbar sein. Daher habe ich jeweils eine eigen conf-Datei angelegt.
Leider komme ich auch aus dem lokalen Netz und auch vom Server selbst im Browser nicht auf die Verzeichnisse. 403 Forbidden. Irgendwo ist eine Kleinigkeit falsch.
001-nextcloud.conf:
- Code: Select all
<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port t$
# 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 #######
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/nextcloud
# 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
RewriteEngine on
RewriteCond %{SERVER_NAME} = ######
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
001-nextcloud-le-ssl.conf
- Code: Select all
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerName #######
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/nextcloud
<IfModule mod_headers.c>
Header always set Strict-Transport-Security "max-age=15768000; $
Header set Referrer-Policy "strict-origin-when-cross-origin"
# Prevent MIME based attacks
Header set X-Content-Type-Options "nosniff"
Header always set X-Frame-Options "SAMEORIGIN"
</IfModule>
SSLEngine on
SSLCipherSuite EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH
SSLProtocol All -SSLv2 -SSLv3 -TLSv1 -TLSv1.1
SSLHonorCipherOrder On
<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
Satisfy Any
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/####/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/####/privkey.pem
</VirtualHost>
</IfModule>
phpmyadmin.conf:
- Code: Select all
<VirtualHost *:80>
ServerName phpmyadmin
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/phpmyadm/
<Directory /var/www/html/phpmyadm/>
Require host localhost
Require host 127.0.0.1
Require ip 192.168.178
# Require all granted
# Require all denied
</Directory>
ErrorLog /var/log/apache2/error.log
CustomLog /var/log/apache2/access.log combined
ServerSignature On
</VirtualHost>
Bei Zugriff auf phpmyadm steht dann dies im error.log:
- Code: Select all
[Sat Jan 15 16:10:58.816383 2022] [authz_core:error] [pid 9136] [client ::1:36946] AH01630: client denied by server configuration: /var/www/html/nextcloud/phpmyadm
[Sat Jan 15 16:10:59.024628 2022] [authz_core:error] [pid 9136] [client ::1:36946] AH01630: client denied by server configuration: /var/www/html/nextcloud/favicon.ico, referer: http://localhost/phpmyadm
Ich habe leider noch keinen Durchblick, wo der Fehler ist. Es ist aber offensichtlich, dass er zu /var/www/html/nextcloud/phpmyadm will. Das ist aber falsch, er müsste zu /var/www/html/phpmyadm. Und das mit dem favicon ist auch irdendwie seltsam
Wenn ich im phpmyadm.conf alle Require auskommentiere und Require all granted einfüge geht es, freilich mit Zugriff von überall her, was ich ja nicht will.
Vielen Dank
Grüße Martin