How to access Nginx error logs?
I had a particularly outdated ubuntu distribution (12.10) and was beginning the process to update sequentially to 16.04. Yesterday, I successfully updated from 12.10->13.10->14.04 using the Ubuntu old releases archive and this tutorial from Digital Ocean. I didn’t have to change the kernel, because our droplet was using grubloader v2.0.
Excited at the success of updating, I used do-release-upgrade to move from 14.04 to 16.04 and, while the distribution was updated successfully, I immediately ran into 502 errors (nginx /1.4.6) after updating. I am new to all of this, so I did the release upgrade from 14.04 to 16.04 in the exact same way as the 13.10->14.04 upgrade.
When I try to access the nginx error logs, I get a “Permission denied” reading. First question: How do I access the error logs? Second question (dependent on what the error logs might or might not show): has anyone run into this problem when updating from 14.04->16.04? Also, I restored my droplet back to 12.10 and updated back to 14.04 and I am now running into the same 502 errors, despite the 14.04 update working fine previously.
Here is the “Permission denied” code:
Welcome to Ubuntu 14.04.5 LTS (GNU/Linux 3.13.0-143-generic i686) * Documentation: https://help.ubuntu.com/ New release '16.04.4 LTS' available. Run 'do-release-upgrade' to upgrade to it. Last login: Wed Mar 21 12:34:48 2018 from c-73-205-79-49.hsd1.fl.comcast.net root@foss:~# lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 14.04.5 LTS Release: 14.04 Codename: trusty root@foss:~# /var/log/nginx/error.log -bash: /var/log/nginx/error.log: Permission denied root@foss:~#
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.×