[Nextcloudpi] Running Apache2 server and Nextcloud in parallel


I have my data on my NextCloudpi (running on a nextcloudbox and a raspberry pi) and I wanted to be able to run a general purpose webserver in addition, without breaking the NextCloud installation.

I’ve added a /etc/apache2/sites-enabled/www.conf file, with something like that in it:

<IfModule mod_ssl.c>
Listen 80
Listen 5555 https
Listen 443

  <VirtualHost *:5555>
    DocumentRoot /var/www/html
    CustomLog /var/log/apache2/access.log combined
    ErrorLog  /var/log/apache2/error.log
    SSLEngine on
    SSLCertificateFile      /etc/ssl/certs/ssl-cert-snakeoil.pem
    SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key

It works so far, I can reach my html file with https://nextcloudpi.local:5555/

The problem is php is not working. I’ve enabled it with sudo a2enmod php7.0

but even a simple phpinfo won’t display.

Are there some configurations in nextcloudpi which prevent php and apache to work together (because there are already some builtin for example), and might I break my nextcloud if I try to go further?

nextcloud is in PHP, there is nothing weird preventing php with NCP

Apache and PHP work together perfectly. Is /var/www/html the home of your phpinfo.php file? Is this the home of your nextcloud installation?
Perhaps you should add

<Directory /var/www/html/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted

Are there any error messages in the apache error.log?


It seems I had setup everything correctly. Just my phpinfo file had a deprecated / erroneous element in it, which prevented php7 to interpret it. In addition, my wiki wasn’t fully compatible with php7, which also rendered into a blank page. I’ve noticed that by turning the errors / warnings on in my php.ini file.

Everything seems to work perfectly now, thank you! The solution was to use virtual hosts for this kind of settings.