I installed the NCP image to the SD card on my Raspberry Pi 2B a long while ago, added Let’s Encrypt, and everything is working fine and wonderful. But I was wondering if I could add another website to Apache.
E.g., right now the NCP install is at https://mywebsite.com/, which redirects to https://mywebsite.com/login because I have prettyURL on. Is it possible to have another website at https://mywebsite.com/secondsite/ ? I don’t mind having the nextcloud install on https://mywebsite.com/nextcloud/.
I have been fiddling with it, and haven’t gotten anywhere. To my knowledge I should be able to edit /etc/apache2/sites-available/nextcloud.conf and change the DocumentRoot /var/www/nextcloud to DocumentRoot /var/www buuuuut that’s where my knowledge of apache stops. I don’t know how to deal with the redirect that’s going on. When I change that line, https://mywebsite.com/nextcloud/ redirects to https://mywebsite.com/nextcloud/login and gives a File not found page. If you need me to pastebin anything I am more than happy to.
So I took a guess at what could fix this… I had to turn off prettyURL. Now I can access both /nextcloud/ and /secondsite/.
Again, my knowledge of apache is very limited. It’s definitely not a big deal to have prettyURL off, but that’s what was causing it. I guess that script isn’t intelligent enough to deal with this use case. I wouldn’t mind having it back on AND having the second site folder, but beggars and choosers, ah well.
Though now I’m worried what bugs will creep in down the line with this change. Will Let’s Encrypt not like it? That’s a question for another time though.