Question

Lost access to my wordpress site

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: BIO_new_file(“/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:BIO_new_file: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.

Subscribe
Share

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?

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)


Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

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.

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