SSL installation on LEMP 16.04 and Wordpress

February 26, 2017 478 views
LEMP Ubuntu 16.04

I have followed the following tutorial on securing NGINX on Ubuntu 16.04.

https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-16-04

Once I finished installing Let's Encrypt SSL and when I try to connect to my wordpress website it shows the digital ocean "Please log into your droplet via SSH to configure your LEMP installation". How do I remove this and get to my wordpress website? I read that deleting the index.html should work but when I delete it I then get a 403 Forbidden Access

2 Answers

@greensociety

To find out what errors are being logged, we can run the command below. It'll output the last 20 lines of the NGINX error log which should give us an idea of what's going on.

tail -20 /var/log/nginx/error.log

If you can post that output to a code block, we can troubleshoot from there.

2017/02/26 10:48:05 [notice] 2477#2477: signal process started
2017/02/26 20:54:59 [emerg] 6887#6887: unexpected end of file, expecting "}" in /etc/nginx/sites-enabled/default:110
2017/02/26 20:59:10 [crit] 6932#6932: *148 SSL_do_handshake() failed (SSL: error:14094085:SSL routines:ssl3_read_bytes:ccs received early) while SSL handshaking, client: 64.41.200.107, server: 0.0.0.0:443
2017/02/26 20:59:10 [crit] 6932#6932: *149 SSL_do_handshake() failed (SSL: error:14094085:SSL routines:ssl3_read_bytes:ccs received early) while SSL handshaking, client: 64.41.200.107, server: 0.0.0.0:443
2017/02/26 21:05:16 [error] 6932#6932: *204 directory index of "/var/www/html/" is forbidden, client: 96.xx.xx.xx, server: _, request: "GET / HTTP/2.0", host: "[redacted]"
2017/02/26 21:05:56 [error] 6932#6932: *204 directory index of "/var/www/html/" is forbidden, client: 96.xx.xx.xx, server: _, request: "GET / HTTP/2.0", host: "[redacted]"
2017/02/26 21:05:57 [error] 6932#6932: *204 directory index of "/var/www/html/" is forbidden, client: 96.xx.xx.xx, server: _, request: "GET / HTTP/2.0", host: "[redacted]"
2017/02/26 21:05:58 [error] 6932#6932: *204 directory index of "/var/www/html/" is forbidden, client: 96.xx.xx.xx, server: _, request: "GET / HTTP/2.0", host: "[redacted]"
2017/02/26 21:08:30 [notice] 7001#7001: signal process started
2017/02/26 21:13:26 [notice] 7081#7081: signal process started

I checked the default server configuration file and everything checks out so not to sure why its giving me that error. Ran the sudo nginx -t code and syntax is okay and test is successful. Hopefully this can get resolved.

edited by warrington
  • It seems like you got it working?
    When I visit your domain, it automatically redirects to HTTPS and shows the WordPress.
    Just in case someone else might have the same issue, what did you fix to resolve this?

    • PHP In the server block was comment which I had to uncomment and also add index.php next to the index under the # add index.php to the list if you are using PHP

              index index.php index.html index.htm index.nginx-debian.html;
      
      
         location ~ \.php$ {
                      include snippets/fastcgi-php.conf;
      
                      # With php7.0-cgi alone:
              #       fastcgi_pass 127.0.0.1:9000;
                      # With php7.0-fpm:
                      fastcgi_pass unix:/run/php/php7.0-fpm.sock;
              }
      
      
Have another answer? Share your knowledge.