I am need for a little help regarding Apache. I had an successful running nextcloud instance for a while. Few days ago stupid me decided to install pihole on the same server where nextcloud is running. That was a stupid mistake. After getting rid of pihole my nextcloud wasn’t available anymore. After some time I figured out Apache wasn’t configured correctly anymore. After messing around with active sites and active configs I got it to the point that a .php was displayed in plain text.
My nextcloud.conf
VirtualHost *:80>
ServerAdmin master@localhost.com
DocumentRoot /var/www/nextcloud/
ServerName mydomain
ServerAlias www.mydomain
Alias /nextcloud "/var/www/nextcloud/"
<Directory /var/www/nextcloud/>
Options +FollowSymlinks
AllowOverride All
Require all granted
<IfModule mod_dav.c>
Dav off
</IfModule>
SetEnv HOME /var/www/nextcloud
SetEnv HTTP_HOME /var/www/nextcloud
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
RewriteEngine on
RewriteCond %{SERVER_NAME} =www.mydomain [OR]
RewriteCond %{SERVER_NAME} =mydomain
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
I am a bit on a dry path here where I dont know what to do expect wiping the machine and starting from scratch. Any help appreciated. If further information is needed let me know.
Big thanks in advance!
Could it be that Lighttpd is runnung instead of Apache?
PiHole install’s Lighttpd by default. I am running Apache, Nextcloud and PiHole on the same machine too.
Have a look at: /etc/pihole/SetupVars.conf
and see if LIGHTPD_enabled=false
Then remove Lighttpd.
That is a start.
Is apache2 running? I assume that you use RaspberryOs. So check:
sudo systemctl status apache2
@Bartman2
Yes. You are right. Lighttpd came with PiHole and was running on port 80 same as apache. But I got rid of lighttdp and pihole. After that I am now stuck in the situation mentioned above. Apache2 is running.
@lothar try this : sudo apt reinstall php libapache2-mod-php php-gd php-json php-mysql php-curl php-mbstring php-intl php-imagick php-xml php-zip php-mysql php-bcmath php-gmp php-apcu ( delete modules you not use and add the others wich are not in the line)
@Mageunic
Hm, reinstalling was succesful. But the php is still being displayed in plain text. Any further ideas? seems like I have to nuke the machine.