install Adminer on a Nginx server running Ubuntu OS on it

September 2, 2019 123 views
Nginx Ubuntu 18.04

I am trying to install Adminer as per the documentation in [https://gist.github.com/zloynemec/1e4680c4c9aa9cee8a6e#file-adminer_setup-sh](http://)

When I run the *service nginx start *command, I get the

Job for nginx.service failed because the control process exited with error code.
``` error

Running the ```systemctl status nginx.service```command shows the following logs. The url http://165.227.197.220/ and http://165.227.197.220/adminer both work but they do not show the Adminer login screen. What am I missing?

● nginx.service - A high performance web server and a reverse proxy server
   Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Mon 2019-09-02 22:45:19 UTC; 12s ago
     Docs: man:nginx(8)
  Process: 29238 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=1/FAILURE)
  Process: 29449 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=1/FAILURE)

systemd[1]: Starting A high performance web server and a reverse proxy server…
nginx[29449]: nginx: [emerg] open() "/etc/nginx/global/restrictions.conf" failed (2: No such file or directory) in /etc/nginx/sites-
nginx[29449]: nginx: configuration file /etc/nginx/nginx.conf test failed
systemd[1]: nginx.service: Control process exited, code=exited status=1
systemd[1]: nginx.service: Failed with result 'exit-code'.
systemd[1]: Failed to start A high performance web server and a reverse proxy server.
…skipping…
● nginx.service - A high performance web server and a reverse proxy server
   Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Mon 2019-09-02 22:45:19 UTC; 12s ago
     Docs: man:nginx(8)
  Process: 29238 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=1/FAILURE)
  Process: 29449 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=1/FAILURE)

systemd[1]: Starting A high performance web server and a reverse proxy server…
nginx[29449]: nginx: [emerg] open() "/etc/nginx/global/restrictions.conf" failed (2: No such file or directory) in /etc/nginx/sites-
nginx[29449]: nginx: configuration file /etc/nginx/nginx.conf test failed
systemd[1]: nginx.service: Control process exited, code=exited status=1
systemd[1]: nginx.service: Failed with result 'exit-code'.
systemd[1]: Failed to start A high performance web server and a reverse proxy server.

1 Answer

Hello,

It looks like that the restrictions.conf file is missing and this is why your config test is failing.

You need to either find the restrictions.conf file and upload it to your /etc/nginx/global/ folder, or you need to edit the nginx conf and remove or comment out this line:

    include        global/restrictions.conf;

Hope that this helps.
Regards,
Bobby

Have another answer? Share your knowledge.