Getting Internal Server Error internally and externally after updating the local IP on my Nextcloud Server (Ubuntu 20.04.2 LTS)

I recently updated the subnet of my network from a 191.168.1.x to 10.0.0.x and in turn had to update my IP on my Ubuntu server hosting Nextcloud. That is the only change that I made and the server had been working without incident prior. The login page comes up normally but once the credentials are entered I get the dreaded ‘Internal Server Error’ page

The server was unable to complete your request.

If this happens again, please send the technical details below to the server administrator.

More details can be found in the server log.

Technical details

  • Remote Address: 10.x.x.x
  • Request ID: z3Jy1WSuQmjU2lqPHT5T

I have checked the logs at
/var/logs/apache2/error.log
/var/www/nextcloud/data/nextcloud.log

And there is nothing of note in either log. I’m sure this is something basic that I am overlooking but what else do I need to change in Nextcloud/Apache/PHP if I update the IP address of the local Nextcloud server? Or what is a good place to check for additional logs to determine what is broken due to the IP change?

What does your Apache site config look like?

Also make sure you update the server IP in /etc/hosts.

My etc/host had my loopback which was working before, so no direct IP info
127.0.0.1 localhost
127.0.1.1 nextcloud

After checking nextcloud.error log I am now seeing some PHP errors. I am showing 7.4 and 8.0 installed but there is no .conf file in 7.4 and a www.conf in 8.0 under the pool.d folder. I am running php version 8.0.3 and as far as I know nothing should’ve changed, just a standard reboot and then an IP address change.

Here is the nextcloud.error log

[Wed Feb 01 16:39:02.134168 2023] [proxy:error] [pid 1236] (2)No such file or directory: AH02454: FCGI: attempt to connect to Unix domain socket /run/php/php8.0-fpm.sock () failed
[Wed Feb 01 16:39:02.134259 2023] [proxy_fcgi:error] [pid 1236] [client 10.0.0.1:51899] AH01079: failed to make connection to backend: httpd-UDS
[Wed Feb 01 16:39:02.163569 2023] [proxy:error] [pid 1238] (2)No such file or directory: AH02454: FCGI: attempt to connect to Unix domain socket /run/php/php8.0-fpm.sock (
) failed
[Wed Feb 01 16:39:02.163686 2023] [proxy_fcgi:error] [pid 1238] [client 10.0.0.1:51902] AH01079: failed to make connection to backend: httpd-UDS
[Wed Feb 01 16:39:03.858502 2023] [proxy:error] [pid 1237] (2)No such file or directory: AH02454: FCGI: attempt to connect to Unix domain socket /run/php/php8.0-fpm.sock () failed
[Wed Feb 01 16:39:03.858584 2023] [proxy_fcgi:error] [pid 1237] [client 10.0.0.1:54709] AH01079: failed to make connection to backend: httpd-UDS
[Wed Feb 01 16:39:04.285401 2023] [proxy:error] [pid 1238] (2)No such file or directory: AH02454: FCGI: attempt to connect to Unix domain socket /run/php/php8.0-fpm.sock (
) failed
[Wed Feb 01 16:39:04.285463 2023] [proxy_fcgi:error] [pid 1238] [client 10.0.0.11:61524] AH01079: failed to make connection to backend: httpd-UDS
[Wed Feb 01 17:36:52.646827 2023] [proxy_fcgi:error] [pid 1682] (70008)Partial results are valid but processing is incomplete: [client 10.0.0.1:57162] AH01075: Error dispatching request to : (reading input brigade)
[Thu Feb 02 01:56:41.915783 2023] [proxy_fcgi:error] [pid 5825] (70008)Partial results are valid but processing is incomplete: [client 10.0.0.1:56447] AH01075: Error dispatching request to : (reading input brigade)

Here are my two apache config files, default and ssl

nextcloud.conf

<VirtualHost *:80>
DocumentRoot “/var/www/nextcloud”
ServerName nextcloud.domain.com

    ErrorLog ${APACHE_LOG_DIR}/nextcloud.error
    CustomLog ${APACHE_LOG_DIR}/nextcloud.access combined

    <Directory /var/www/nextcloud/>
        Require all granted
        Options FollowSymlinks MultiViews
        AllowOverride All

       <IfModule mod_dav.c>
           Dav off
       </IfModule>

    SetEnv HOME /var/www/nextcloud
    SetEnv HTTP_HOME /var/www/nextcloud
    Satisfy Any

   </Directory>

RewriteEngine on
RewriteCond %{SERVER_NAME} =nextcloud.domain.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]

Nextcloud-le-ssl.conf

SSLStaplingCache shmcb:/var/run/apache2/stapling_cache(128000) Protocols h2 http/1.1 DocumentRoot "/var/www/nextcloud" ServerName nextcloud.domain.com
    ErrorLog ${APACHE_LOG_DIR}/nextcloud.error
    CustomLog ${APACHE_LOG_DIR}/nextcloud.access combined

    <Directory /var/www/nextcloud/>
        Require all granted
        Options FollowSymlinks MultiViews
        AllowOverride All

       <IfModule mod_dav.c>
           Dav off
       </IfModule>

    SetEnv HOME /var/www/nextcloud
    SetEnv HTTP_HOME /var/www/nextcloud
    Satisfy Any

   </Directory>

Include /etc/letsencrypt/options-ssl-apache.conf
SSLUseStapling on
Header always set Strict-Transport-Security “max-age=31536000”
SSLCertificateFile /etc/letsencrypt/live/nextcloud.domain.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/nextcloud.domain.com/privkey.pem

I’ll also include my config.php under my nextcloud/config folder

‘instanceid’ => ‘',
‘passwordsalt’ => '',
‘secret’ => '
’,
‘trusted_domains’ =>
array (
0 => ‘nextcloud.domain.com’,
1 => ‘10.0.x.x’
),
‘datadirectory’ => ‘/mnt/data/nextcloud’,
‘dbtype’ => ‘mysql’,
‘version’ => ‘24.0.1.1’,
‘overwrite.cli.url’ => ‘https://nextcloud.domain.com’,
‘dbname’ => ‘nextcloud’,
‘dbhost’ => ‘localhost’,
‘dbport’ => ‘’,
‘dbtableprefix’ => ‘oc_’,
‘mysql.utf8mb4’ => true,
‘dbuser’ => ‘nextcloudadmin’,
‘dbpassword’ => ‘****************’,
‘installed’ => true,
‘default_phone_region’ => ‘US’,
‘mail_smtpmode’ => ‘smtp’,
‘mail_smtpsecure’ => ‘tls’,
‘mail_sendmailmode’ => ‘smtp’,
‘mail_from_address’ => ‘nextcloud’,
‘mail_domain’ => ‘domain.com’,
‘mail_smtpauth’ => 1,
‘mail_smtpauthtype’ => ‘LOGIN’,
‘mail_smtphost’ => ‘smtp.office365.com’,
‘mail_smtpport’ => ‘587’,
‘mail_smtpname’ => ‘nextcloud@domain.com’,
‘mail_smtppassword’ => ‘**************’,
‘memcache.distributed’ => ‘\OC\Memcache\Redis’,
‘memcache.local’ => ‘\OC\Memcache\Redis’,
‘memcache.locking’ => ‘\OC\Memcache\Redis’,
‘filelocking.enabled’ => ‘true’,
‘redis’ =>
array (
‘host’ => ‘localhost’,
‘port’ => 6379,
‘timeout’ => 0.0,
),
‘maintenance’ => false,
‘ldapIgnoreNamingRules’ => false,
‘ldapProviderFactory’ => ‘OCA\User_LDAP\LDAPProviderFactory’,
‘twofactor_enforced’ => ‘true’,
‘twofactor_enforced_groups’ =>
array (
0 => ‘GRP_Nextcloud’,
),
‘twofactor_enforced_excluded_groups’ =>
array (
),
‘updater.release.channel’ => ‘stable’,
‘theme’ => ‘’,
‘loglevel’ => 4,
‘app_install_overwrite’ =>
array (
0 => ‘occweb’,
),
);

I’ve upgraded to php 8.1 using the following guide
https://www.cloudbooklet.com/how-to-install-or-upgrade-php-8-1-on-ubuntu-20-04/

I’m no longer getting php errors, as a matter of fact I’m not getting much in the way of errors from the logs in
/var/log/apache2/errror.log
/var/log/apache2/nextcloud.error

Site still opens up fine to the login page but as soon as credentials are entered I get the ‘internal server error’ page still.

I checked the mariadb to make sure it was running, accessible and that my nextcloud database was still in it and accessible.

Not sure what else I’m missing at this point.

Did you ever resolve this @rdt ? I’ve randomly starting hitting the exact same issue and have no idea why (I’m running 3 other Nextclouds on basically the exact same environments and they are all working fine)