Lost access to my wordpress site

March 13, 2019 334 views
WordPress Ubuntu 16.04

502 Bad Gateway
nginx/1.10.3 (Ubuntu)

Hi!

Things happen. Today i can't go inside my wordpress site. Trying to aply some correction found in similar questions, nginx responded in my Putty:

nginx: [alert] could not open error log file: open() "/var/log/nginx/error.log" failed (13: Permission denied)
2019/03/13 19:35:09 [warn] 9418#9418: the "user" directive makes sense only if t he master process runs with super-user privileges, ignored in /etc/nginx/nginx.c onf:1
2019/03/13 19:35:09 [emerg] 9418#9418: BIOnewfile("/etc/letsencrypt/live/arun. com.br/fullchain.pem") failed (SSL: error:0200100D:system library:fopen:Permissi on denied:fopen('/etc/letsencrypt/live/arun.com.br/fullchain.pem','r') error:200 6D002:BIO routines:BIOnewfile:system lib)
nginx: configuration file /etc/nginx/nginx.conf test failed

Well, i need help to fix this, a step to step guidance.

Thanks a lot.

2 comments
  • So, friends, i tried to restart sudo service php7.0-fpm restart

    Job for php7.0-fpm.service failed because the control process exited with error code. See "systemctl status php7.0-fpm.service" and "journalctl -xe" for details. .
    systemctl status php7.0-fpm.service
    ● php7.0-fpm.service - The PHP 7.0 FastCGI Process Manager
    Loaded: loaded (/lib/systemd/system/php7.0-fpm.service; enabled; vendor preset: enabled)
    Active: failed (Result: exit-code) since Wed 2019-03-13 23:19:54 UTC; 29s ago
    Process: 10107 ExecStart=/usr/sbin/php-fpm7.0 --nodaemonize --fpm-config /etc/php/7.0/fpm/php-fpm.conf (code=exited, status=254)
    Process: 10097 ExecStartPre=/usr/lib/php/php7.0-fpm-checkconf (code=exited, status=0/SUCCESS)
    Main PID: 10107 (code=exited, status=254)

  • Hi.

    A strange thing is happening.
    I gave a sudo systemctl restart nginx, followed by sudo service nginx restart, followed by sudo service php7.0-fpm restart and the site came back. But still i can't edit anything in the backend. If i try, the site goes back to 502 bad gateway. This i did two times.

    A hand, someone?

1 Answer

Greetings!

It sounds like something significant occurred on the server, to which I may not know the right answer without knowing what it was that occurred. I admit that I find it odd that restarting services worked, while this error is in the logs:

denied:fopen('/etc/letsencrypt/live/arun.com.br/fullchain.pem','r') error:200 6D002:BIO 

Regardless, I can only reconcile the two by ignoring that error and moving on to the website loading after restarting the services, so I will go ahead and move on to that point.

After everything is back up you noticed that you cannot edit anything in wp-admin, and that you receive a 502 Bad Gateway error when attempting to. In this case, I would have you run this over SSH:

tail -f /var/log/nginx/error.log

Then, while that remains open, go into your wp-admin and try to make a change so that the 502 error occurs. Look back to the SSH window, an error should appear in that log at the same time. What does it say? The answer to that is the path to the resolution.

Jarland

Have another answer? Share your knowledge.