Jokohama
By:
Jokohama

Wordpress multisite is down after upgrade Ubuntu to 16.04

March 24, 2017 902 views
WordPress Ubuntu 16.04

So I was using an One-click-Wordpress on Ubuntu 14.04 from 2015. I converted it to multisite in 2016 and still running fine with 5 sites total (with different domains).

Problems came yesterday when I decied to do an do-release-upgrade to upgrade to Ubuntu 16.04. Without any active droplet snapshot. Yes, that was awful.

After the upgrade, my sites are still down. I sent a DigitalOcean support ticket to get me through some droplet check. Then I checked apache2 service and it was not running caused by syntax errror 'php_flag'. And so I reinstalled php and check some other LAMP stack related stuffs.

After a while, my sub-sites are back online, as I can access them via their own domain. But I cannot access my main site, the original domain. And so I cant backup things from there.

These are the symptoms:

  1. Access my-main-domain (through cloudflare) get only a blank page with code 500 error.
  2. Access my-droplet-ip and I got redirect to http://my-main-domain/wp-signup.php?new=my-droplet-ip
  3. My sub-sites still running.

I thinks this is is some multisites config got messed up after the upgrade but do not know how to solve the problem. So I appreciate any help from the community, thank you very much.

4 Answers

@Jokohama

Can you post the output of:

tail -20 /var/log/apache2/error.log

That's Apaches error log which should provide more details on what's going on. You can also expand on that and change -20 to -50 to increase the number of lines that get echoed out. From there, do a quick copy and paste to a code block (to keep formatting and make it easier to scan) and we can try to help out.

  • Ah okay, this is part of the log. Hope it will be helpful:

    [Fri Mar 24 20:41:17.842963 2017] [mpm_prefork:notice] [pid 20364] AH00163: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations
    [Fri Mar 24 20:41:17.843023 2017] [core:notice] [pid 20364] AH00094: Command line: '/usr/sbin/apache2'
    [Fri Mar 24 23:33:26.072635 2017] [mpm_prefork:notice] [pid 20364] AH00169: caught SIGTERM, shutting down
    [Fri Mar 24 23:33:36.558239 2017] [mpm_prefork:notice] [pid 802] AH00163: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations
    [Fri Mar 24 23:33:36.560571 2017] [core:notice] [pid 802] AH00094: Command line: '/usr/sbin/apache2'
    [Fri Mar 24 23:42:10.668579 2017] [mpm_prefork:notice] [pid 802] AH00169: caught SIGTERM, shutting down
    [Fri Mar 24 23:42:11.836061 2017] [mpm_prefork:notice] [pid 2418] AH00163: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations
    [Fri Mar 24 23:42:11.836159 2017] [core:notice] [pid 2418] AH00094: Command line: '/usr/sbin/apache2'
    [Sat Mar 25 00:07:32.810363 2017] [mpm_prefork:notice] [pid 2418] AH00169: caught SIGTERM, shutting down
    [Sat Mar 25 00:38:03.917591 2017] [mpm_prefork:notice] [pid 3753] AH00163: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations
    [Sat Mar 25 00:38:03.917715 2017] [core:notice] [pid 3753] AH00094: Command line: '/usr/sbin/apache2'
    [Sat Mar 25 00:40:36.705718 2017] [mpm_prefork:notice] [pid 3753] AH00169: caught SIGTERM, shutting down
    [Sat Mar 25 00:40:37.855901 2017] [mpm_prefork:notice] [pid 3888] AH00163: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations
    [Sat Mar 25 00:40:37.855998 2017] [core:notice] [pid 3888] AH00094: Command line: '/usr/sbin/apache2'
    [Sat Mar 25 00:48:18.271667 2017] [mpm_prefork:notice] [pid 3888] AH00169: caught SIGTERM, shutting down
    [Sat Mar 25 00:48:19.374034 2017] [mpm_prefork:notice] [pid 4015] AH00163: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations
    [Sat Mar 25 00:48:19.374117 2017] [core:notice] [pid 4015] AH00094: Command line: '/usr/sbin/apache2'
    [Sat Mar 25 01:08:39.003732 2017] [mpm_prefork:notice] [pid 4015] AH00169: caught SIGTERM, shutting down
    [Sat Mar 25 01:08:40.176331 2017] [mpm_prefork:notice] [pid 4884] AH00163: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations
    [Sat Mar 25 01:08:40.176426 2017] [core:notice] [pid 4884] AH00094: Command line: '/usr/sbin/apache2'
    
    
    • @Jokohama

      Well, the logs aren't showing anything abnormal. That looks like Apache has been restarted numerous times, so unless there's more when increasing the output of tail, then Apache is or appear to be okay.

      Since you're using WordPress, the next thing I'd check is your .htaccess file. Just to test, I'd make a local backup, and then delete the file from your server. Now try to access your site again and see if it works. If it does, the issue is with the .htaccess file.

      Removing the .htaccess file will break permalinks and such, though more often than not, an issue in the .htaccess file can cause issues that aren't directly logged, so lets check that.

      • Hi, I just test the site without .htaccess and it made no changes.
        One thing I just discover is that /etc/apache2/sites-enabled is empty. Is this related to the problem?

        • @Jokohama

          That could definitely be one issue if Apache is setup to pull from that directory instead of ./sites-available.

          You can run sudo a2ensite sitename.conf to auto-create the configuration file in the ./sites-enabled directory where sitename.conf is the configuration file that controls your site. You'd then want to restart Apache for the changes to take effect.

          • I did the sudo a2ensite 000-default.conf, restarted Apache and saw the 000-default.conf file in ./sites-available
            And then my site got code 403 for do not have permission to access.
            I add these lines into that file

            ServerName server1.example.com
            <Directory /var/www/html/>
            AllowOverride All
            </Directory>
            

            and tried delete or keep the .htaccess

            Still 403, maybe I broke more things..

@Jokohama

If you would, please post you configuration for the site that you're having the issue with so we can take a closer look at it.

I took a break and tried to move the wordpress multisite to another droplet.
I created new Ubuntu 16.04 droplet, fresh installed Wordpress, activated multisite, pointed domain to the new Wordpress. It was running fine. But after overwrite it with old data and sql with phpmyadmin, the same blank page happened.

So.. is there anyway to export data and import to new wpsite without access to the wp-admin?

  • @jtittle Couldn't this be a PHP issue, since that has probably been upgraded to 7.0, which might be causing some issues in a theme or plugin? Activate WP_DEBUG temporarily perhaps?

    @Jokohama Remember to use the @ sign to notify people - otherwise we might miss a reply.
    When you say "overwrite it with old data", do you mean the entire /wp-content or some sub-folders of it, or something else?

    • @hansen ah I overwrite all wordpress file except wp-config.php and .htaccess

      Oh this could be PHP7 issue.. I dont know how to check theme compability though.

    • @Jokohama @hansen

      It could very well be an issue with PHP. We'd need to look at the logs again and see if any specific data is being logged that could relate. I know WordPress works on PHP 7.0/7.1, as I've setup quite a few instances myself, though that doesn't mean that all plugins/themes work.

      The only way to really tell, other than if the theme author specifically states so, would be to check the logs and see if Apache is logging an error, or turn debugging on and see if that displays any specific errors.

@jtittle @hansen
Thanks guys, my theme was from 2014 so I think it has some parts that are incompatible with PHP7.
I did restore an ubuntu 14.04 and transfer data in. After some config, my multisite now works fine.
I will upgrade to ubuntu 16.04 later, after changing theme.

Have another answer? Share your knowledge.