Apache web Server Configuration

I have a Nextcloud 13 server working fine. But I have never configured my apache conf file as stipulated here: https://docs.nextcloud.com/server/13/admin_manual/installation/source_installation.html#apache-configuration-label

It says the following…

## Apache Web server configuration

On Debian, Ubuntu, and their derivatives, Apache installs with a useful configuration so all you have to do is create a /etc/apache2/sites-available/nextcloud.conf file with these lines in it, replacing the Directory and other filepaths with your own filepaths:

Alias /nextcloud “/var/www/nextcloud/” <Directory /var/www/nextcloud/> Options +FollowSymlinks AllowOverride All <IfModule mod_dav.c> Dav off </IfModule> SetEnv HOME /var/www/nextcloud SetEnv HTTP_HOME /var/www/nextcloud </Directory>

Then enable the newly created site:

a2ensite nextcloud.conf

How can my server work without this?

My default-ssl.conf says…

<IfModule mod_ssl.c>
	<VirtualHost _default_:443>
		ServerAdmin mymail
		ServerName mydomain.com

		DocumentRoot /var/www/html

and not much more…

Should I set up a new conf file???

Yes at best set up a new file in /etc/apache2/sites-available/nextcloud.conf and a2ensite it. In that file you put all your configuration, including the statements suggested in the documentation. You might even add a VirtualHost that does a redirection from http to https.

You might need to a2dissite your default config after that, and restart apache.

You also might need to move your nextcloud directory from /var/www/html to /var/www/nextcloud and adjust the path in your config.


I am preparing for manual installation.
As of “https://linuxize.com/post/how-to-install-apache-on-debian-10/” it is highly recommended to follow the standard naming convention for Apache Configuration File’s such as e.g. “…-available/sld.tld.conf”. This is opposing to NC Installation guide where a file named “nextcloud.conf” is suggested to use (or will be set up when installing manually, don’t know). Am i running into troubles when i’m using recommended standard.

I recognized "eehmke"s reply here. Is this always valuable? I’m actually confused and don’t know what to do :frowning:

thx for helping.

@besimux you can use nextcloud.conf, there is no problem .