Nextcloud, problem with auto-redirect and main directory


I have been playing with Nextcloud for a while, and I installed it on my VPS few days ago. Everything seems to work perfectly, but the problem starts when I want to install other service - in my case it would be Ampache.

Basic info:

  • Apache (engine) with HTTPS,

  • VPS,

  • Nextcloud beta 13.

What is Ampache?

Ampache is a spotify-like service which let’s you stream your music directly from your server.

What is my problem?

The point is that I want to install Ampache alongside Nextcloud. I installed Nextcloud in /var/www/html/ directory, I didn’t create the subdirectory /nextcloud in /var/www/. So, when I access my server through domain (it’s not my real domain, its only purpose is to show what I want to achieve): “”, it redirects me directly to Nextcloud. Ok, that’s fine, that is what I want, but I also want to install Ampache to work alongside Nextcloud. I want Ampache to access it through a subdirectory: “”.

Everything seems to be real easy to do, but it doesn’t work how I want to do so. When I created a directory /ampache in /var/www and when I uploaded a random HTML file (just to see if it’ll work) into this directory, I tried to test if it would open the random HTML file. It doesn’t seem to work, it always redirects me to Nextcloud.

What I ask you to help me with?

I would be extremely glad if you explained me what the cause of my problem is, and how to solve it.

I think that something is up with .htaccess file, but I am not sure. I also think that config.php might be helpful, but I know nothing. I do not want Nextcloud to work in a subdirectory, I redirected my subdomain on purspose, so that I can access Nextcloud without writing the directory after the domain.
I hope you understand what my problem is, and I will be grateful to any of you, who can help me.

Thank you, again!

This is not a Nextcloud issue, but more of an Apache configuration issue. It sounds like you simply need to configure a new virtual host in Apache to point to wherever you installed Ampache (in my case I have /var/www/nextcloud and also /var/www/ampache).
Generally this means creating a new file in /etc/apache2/sites-available, then symlinking to that file in /etc/apache2/sites-enabled, and restarting Apache. You might have a web interface for making these changes with your VPS like webmin or something similar…