Default Apache page

Hi,

I’ve just installed Nextcloud on my VPS using Debian 10, and a plain LAMP stack. I’ve not bought a domain name, so I’m only using a self-signed SSL certificate on my installation (and I’m forcing SSL via the Virtual host 000-default.conf). Everything works fine except for the issue of that when I navigate to my server IP, I’m greeted by the default apache page. I’ve tried to force the path in the
default-ssl.conf, to use DocumentRoot /var/www/html/nextcloud but when I add the nextcloud to the end of the line I get a 500 server error. Is there another way to rewrite the virtual hosts files, or force a redirection to the nextcloud installation.

Here’s a small version of my default-ssl.conf file:

<IfModule mod_ssl.c>
        <VirtualHost _default_:443>
                ServerAdmin *MY EMAIL*
                ServerName *MY URL*

                DocumentRoot /var/www/html

        </VirtualHost>
</IfModule>

On another note, does one need to use the nextcloud.conf (located in: /etc/apache2/sites-available) that the nextcloud documentation sates that one should create? I’ve just used the 000-default.conf and the default-ssl.conf, so could I just delete the nextcloud.conf file or is used by nextcloud somehow otherwise?

then your apache config is ok. more or less. because error 500 means that your backend is not ok. that is php, db and/or redis.

let’s say one should follow one the many howtos or the manual itself.
which one did you follow?

Hi @krullmizter!
here is a part of my configuration of apache:

apache config 80

<VirtualHost *:80>
DocumentRoot /var/www/html/nextcloud/
ServerName xxxx

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

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

RewriteEngine on
RewriteCond %{SERVER_NAME} =xxxx
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]

apache config 443
<IfModule mod_ssl.c>
<VirtualHost *:443>
     DocumentRoot /var/www/html/nextcloud/
     ServerName xxxxxx

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

     ErrorLog ${APACHE_LOG_DIR}/error.log
     CustomLog ${APACHE_LOG_DIR}/access.log combined
Header always set Strict-Transport-Security "max-age=15552000; includeSubDomains"



SSLCertificateFile /etc/letsencrypt/live/xxxx/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/xxxx/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>
</IfModule>

after create this file you need to disable 000-default.conf :
sudo a2dissite 000-default.conf
sudo a2ensite file.conf
don’t forget to activate modules of apache :
sudo a2enmod rewrite
sudo a2enmod headers
sudo a2enmod env
sudo a2enmod dir
sudo a2enmod mime
sudo a2enmod ssl
sudo systemctl restart apache2