I have Nextcloud running on my Debian Server using apache2.
I have the problem, that Nextcloud is accessible with the server ip, but not with the domain (A Name). There’s the default apache page.
I’ve added the domain to the trusted domains, but has not helped.!
IP- Adress:
have you checked your settings for apache? you can set there whether it should bind/listen to a specific address. And don’t forget to restart the service after you changed some settings (i have made this mistake and searched hours why apache wasn’t the way working it supposed to work )
maybe you can post your configuration here (of course change domains etc. to something neutral)? Especially your configuration for your virtual host would be interesting to know
the config for Nextcloud seems alright, but i meant the configuration for your virtual host in apache. For example mine looks like this:
<VirtualHost 192.168.174.129:80>
### YOUR SERVER ADDRESS ###
# ServerAdmin admin@example.com
# ServerName example.com
# ServerAlias subdomain.example.com
### SETTINGS ###
<FilesMatch "\.php$">
SetHandler "proxy:unix:/run/php/php7.2-fpm.nextcloud.sock|fcgi://localhost"
</FilesMatch>
DocumentRoot /var/www/nextcloud
<Directory /var/www/nextcloud>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
Satisfy Any
</Directory>
<IfModule mod_dav.c>
Dav off
</IfModule>
<Directory "/mnt/ncdata">
# just in case if .htaccess gets disabled
Require all denied
</Directory>
# The following lines prevent .htaccess and .htpasswd files from being
# viewed by Web clients.
<Files ".ht*">
Require all denied
</Files>
# Disable HTTP TRACE method.
TraceEnable off
# Disable HTTP TRACK method.
RewriteEngine On
RewriteCond %{REQUEST_METHOD} ^TRACK
RewriteRule .* - [R=405,L]
SetEnv HOME /var/www/nextcloud
SetEnv HTTP_HOME /var/www/nextcloud
</VirtualHost>
You can easily edit this with Webmin (not something for hardcore Linux fans but I like it) or by editing the config file with the Terminal at /etc/apache2/sites-available (https://wiki.ubuntuusers.de/Apache/Virtual_Hosts/)
In my config for the Virtual Host I tell the server to listen to the IP 192.168.174.129, but you can change that to listen to every address by replacing the address with a *
ok, my first guess would be to change the ServerName to your domain (cloud.example.com), it looks like you are using an IP. I’m no expert for apache but this could be the reason why its only working when you type in the IP
second thoughts, are you using apache as a proxy? Is this for spreed.me?
Otherwise you need to make sure that your domain resolves to your IP (maybe add in /etc/hosts?)
When you use your domain, it opens /var/www/html/index.html
When you use your ip, it opens /var/www/nextcloud/index.php
(according to the info you gave)
You have to look for a conffile where documentroot is set to /var/www/html. Change it to /var/www/nextcloud
I’m not Apache expert either…
@MeiRos good idea, maybe there is a virtual host where this other documentroot is set. Although the config @max18 has given looks right and it is listening to all adresses. It seems strange to me when apache is choosing an other virtual host/and other documentroot for the domain
EDIT: maybe there is one configured especially for the domain, that would make sense
One other question:
How can i add a second v host?
For example, Nextcloud on port 80 and a other webserver (impressum…) on port 81. NOW i need the default page on this port xD