It turned out to be a series of small mistakes on my behalf. My solution is posted here, but I'll repost it here as well.
This turned out to be a series of inaccuracies on my part. I'll post all the stuff I ran into in case anyone else has similar issues. I think this is about what happened:
1. Everything was set up correct initially, but I changed www.mysite.no
to localhost/var/www
instead of just localhost
.
2. Then I changed to a fresh installation of WordPress with a working (empty) database. The real database did not work (as would be expected).
3. I then updated the real database by switching localhost/var/www
to just localhost
. This did not work, however. At this point I had probably messed up something else. Also, it seems that the proper solution is to use the IP address of the server, at least in this case where I use the browser in another computer on the network.
4. Then, I created a new test database with all the data and changed www.mysite.no
to 192.168.1.2
, which is the IP address of my local server, and copied the WordPress files from the live server. This made the site work as expected. (As a side note I ran into some issues with "Failed to open stream: Permission denied". This was fixed by running sudo chmod -R 755 /var/www
.)
5. Now I had some trouble with permalinks (which is an entirely different issue). The .htaccess file was missing, so I copied it from the live server and re-saved the permalink settings at Admin --> Settings --> Permalinks. Then I switched AllowOverride None
to AllowOverride All
in /etc/apache2/sites-enabled/000-default
and ran sudo service apache2 restart
.
So this was a series of mistakes on my behalf. I am still a bit baffled that WordPress does not provide any error messages when the error is in the database URLs, however. Hope this can be of use to others.