Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


How to install ssl on nginx
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

How to install ssl on nginx

I am using a lnmp script, it seems that the default nginx directory is different from some tutorials on the web, so is the content of nginx.conf.
I don't know how to modify it.

BTW do I need to install openssl first?

Comments

  • mikhomikho Member, Host Rep

    what lnmp script are you using? Perhaps someone here can help you if we know some more information about your setup.

  • saintsaint Member

    I use this one https://github.com/tennfy/debian_lnmp_tennfy
    I've contacted the author but no reply at this time.
    I guest installing ssl on some oneclick lnmp stack script is different from step by step isntalled lnmp stack. The 'oneclick installer' may be removed some fuctions for less RAM usage.

  • BharatBBharatB Member, Patron Provider

    server {



    listen 443;



    ssl on;

    ssl_certificate /etc/ssl/your_domain_name.pem; (or bundle.crt)

    ssl_certificate_key /etc/ssl/your_domain_name.key;



    server_name your.domain.com;

    access_log /path/to/your/log/access.log;

    error_log /path/to/your/log/error.log;

    location / {

    root /path/to/your/web/root/;

    index index.html;



    }


    }

  • saintsaint Member

    Thank you, it seems that the installer script has no openssl included.

  • GoweGowe Member

    Most of lnmp scripts have openssl installed.You can check it with the command'openssl version'.
    And you can type 'nginx -t -c' to locate 'nginx.conf'.Besides,I advise you to install VPS control plane in place of lnmp scripts,such as vestacp,ZPanel and etc.They are more easy to control your VPS via web for you

    Thanked by 1saint
  • BharatBBharatB Member, Patron Provider
    edited March 2015

    @saint said:
    Thank you, it seems that the installer script has no openssl included.

    apt-get install openssl

    Thanked by 1saint
  • saintsaint Member

    @Gowe said:
    Most of lnmp scripts have openssl installed.You can check it with the command'openssl version'.

    'openssl version' shows
    OpenSSL 0.9.8o 01 Jun 2010

    And you can type 'nginx -t -c' to locate 'nginx.conf'.Besides,I advise you to install VPS control plane in place of lnmp scripts,such as vestacp,ZPanel and etc.They are more easy to control your VPS via web for you

    'nginx -t -c' shows
    nginx: option "-c" requires file name

    The vps RAM is only 128m, too small for control panels, So I have to use some lowendscript for lnmp stack.

    Thank you :)

  • GoweGowe Member

    Sorry ,I write by mistakes.
    You can type 'nginx -t',it will return the path of 'nginx.conf'. And 'vi' can edit the config file.After configuring ssl,type 'nginx -t' again,then it tells you whether there is errors in your config file.At last,use'nginx -s -reload' in order to relaunch nginx service.
    (In case of losing your original config file,do back it up with 'cp'.)

    Thanked by 1saint
  • GoweGowe Member

    By the way,if you intend to configure ssl correctly,you may need a ssl certificate.You can 'self-sign' a cert for testing or studying,or buy or get one from StartSSL.com free of charge.

    Thanked by 1saint
  • saintsaint Member

    @Gowe said:
    Sorry ,I write by mistakes.
    You can type 'nginx -t',it will return the path of 'nginx.conf'. And 'vi' can edit the config file.After configuring ssl,type 'nginx -t' again,then it tells you whether there is errors in your config file.At last,use'nginx -s -reload' in order to relaunch nginx service.
    (In case of losing your original config file,do back it up with 'cp'.)

    'nginx -t' shows
    nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
    nginx: configuration file /etc/nginx/nginx.conf test is successful

    this is my nginx.conf
    http://paste.ee/p/39KCy

    this is the tutorial nginx.conf
    http://paste.ee/p/4TyeG

    mine is different from it, it's weird!!!

  • saintsaint Member

    @Gowe said:
    By the way,if you intend to configure ssl correctly,you may need a ssl certificate.You can 'self-sign' a cert for testing or studying,or buy or get one from StartSSL.com free of charge.

    Yes, I've got a free one, it took me the linux noob a long time to figure how to use it, till now I haven't succeeded :(

Sign In or Register to comment.