در حال راه اندازی وب سرور nginx روی ubuntu 18.04 بودم که موقع ریست دادن سرویس انجین ایکس با خطای "journalctl -xe" مواجه شدم.
همانند آنچه که در log ها مشاهده میکنید برای ترابل شوت مشکل دستور journalctl را اجرا کردم که با خطای "Failed to start A high performance web server and a reverse proxy server" مواجه شدم.
بعد از کمی سرچ متوجه شدم که فایل تنظیمات nginx مشکل syntaxt ی دارد. برای اینکه متوجه بشم کدوم خط فایل default.conf انجین ایکسم مشکل داره از دستور nginx -t استفاده کردم، که متوجه شدم در آخرین خط یک "{" کم بود، که با اضافه کردن آن مشکلم برطرف شد.
کد PHP:
root@habili:~# systemctl restart nginx
Job for nginx.service failed because the control process exited with error code.
See "systemctl status nginx.service" and "journalctl -xe" for details.
کد PHP:
root@habili:~# journalctl -xe
-- Unit nginx.service has failed.
--
-- The result is RESULT.
Jul 12 13:14:48 habili systemd[1]: Starting A high performance web server and a reverse proxy server...
-- Subject: Unit nginx.service has begun start-up
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit nginx.service has begun starting up.
Jul 12 13:14:48 habili nginx[14721]: nginx: [emerg] unexpected end of file, expecting "}" in /etc/nginx/sites
Jul 12 13:14:48 habili nginx[14721]: nginx: configuration file /etc/nginx/nginx.conf test failed
Jul 12 13:14:48 habili systemd[1]: nginx.service: Control process exited, code=exited status=1
Jul 12 13:14:48 habili systemd[1]: nginx.service: Failed with result 'exit-code'.
Jul 12 13:14:48 habili systemd[1]: Failed to start A high performance web server and a reverse proxy server.
کد PHP:
root@habili:~# nginx -t
nginx: [emerg] unexpected end of file, expecting "}" in /etc/nginx/sites-enabled/default:92
nginx: configuration file /etc/nginx/nginx.conf test failed