Question

How to do SSL certification in my website?

Posted April 8, 2020 233 views
Nginx

I have tried ssl certification using nginx method, I have checked config by using sudo nginx -t and it is ok(successful)

Then I restatred nginx service by using sudo service nginx restart this command and it is giving error for that.

Job for nginx.service failed because the control process exited with error code.
See "systemctl status nginx.service" and "journalctl -xe" for details.

How should I proceed in SSL certification? I want https, please guide me!

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.

×
1 answer

Hi there @krishnannavadia ,

If you would like to debug this, take a look at the output above. You should run the systemctl command would you like to get some more information.

For example, when the service is running normally you would see this:

# systemctl status nginx.service
● nginx.service - nginx - high performance web server
   Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; vendor preset: disabled)
   Active: active (running) since Thu 2020-04-09 13:48:50 UTC; 1s ago
     Docs: http://nginx.org/en/docs/
  Process: 26490 ExecStop=/bin/kill -s TERM $MAINPID (code=exited, status=0/SUCCESS)
  Process: 26524 ExecStart=/usr/sbin/nginx -c /etc/nginx/nginx.conf (code=exited, status=0/SUCCESS)
 Main PID: 26525 (nginx)
   CGroup: /system.slice/nginx.service
           ├─26525 nginx: master process /usr/sbin/nginx -c /etc/nginx/nginx.conf
           ├─26526 nginx: worker process
           ├─26527 nginx: worker process
           ├─26528 nginx: worker process
           ├─26529 nginx: worker process
           ├─26530 nginx: worker process
           ├─26531 nginx: worker process
           ├─26532 nginx: worker process
           ├─26533 nginx: worker process
           ├─26534 nginx: cache manager process
           └─26535 nginx: cache loader process

If not, you might see errors and you can debug the issues this way:

# systemctl status nginx.service
● nginx.service - nginx - high performance web server
   Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; vendor preset: disabled)
   Active: active (running) since Thu 2020-04-09 13:48:50 UTC; 1s ago
     Docs: http://nginx.org/en/docs/
  Process: 26490 ExecStop=/bin/kill -s TERM $MAINPID (code=exited, status=0/SUCCESS)
  Process: 26524 ExecStart=/usr/sbin/nginx -c /etc/nginx/nginx.conf (code=exited, status=0/SUCCESS)
 Main PID: 26525 (nginx)
   CGroup: /system.slice/nginx.service
           ├─26525 nginx: master process /usr/sbin/nginx -c /etc/nginx/nginx.conf
           ├─26526 nginx: worker process
           ├─26527 nginx: worker process
           ├─26528 nginx: worker process
           ├─26529 nginx: worker process
           ├─26530 nginx: worker process
           ├─26531 nginx: worker process
           ├─26532 nginx: worker process
           ├─26533 nginx: worker process
           ├─26534 nginx: cache manager process
           └─26535 nginx: cache loader process

Apr 09 13:48:50 domain.com nginx[26524]: nginx: [warn] the "ssl" directive is deprecated, use the "listen ... ssl" directive instead in /etc/nginx/conf.d/...l.conf:148
Apr 09 13:48:50 domain.com nginx[26524]: nginx: [warn] the "ssl" directive is deprecated, use the "listen ... ssl" directive instead in /etc/nginx/conf.d/...ssl.conf:9
Apr 09 13:48:15 domain.com systemd[1]: nginx.service: control process exited, code=exited status=1
Apr 09 13:48:15 domain.com systemd[1]: Failed to start nginx - high performance web server.
Apr 09 13:48:15 domain.com systemd[1]: Unit nginx.service entered failed state.
Apr 09 13:48:15 domain.com systemd[1]: nginx.service failed.

Submit an Answer