Setting up SSL for Nextcloud on Lighttpd [Resolved]

Hi Guys,

I have just found DietPI and love it, so thank you for building a great product so far.

I have DP set up and running Nextcloud:
SSH Server : Dropbear
File Server : None
Log System : DietPi-Ramlog #1
Webserver Preference : Lighttpd <--------

Could somebody talk me through setting up SSL for it please. I am currently using a no-IP free account to direct webtraffic to the Raspi (disabled at router and only using local till i can impliment SSL).
I have read other comments on here in the forum regarding SSL and Nextcloud ,but they are not using “Lightpd” as the webserver.

Is there a way to do this? Please help and thank you for your time in advance.

p.s yes i have seen this but its not working i guess i need to make a key and stick the location for it somewhere. https://dietpi.com/forum/t/nextcloud-http-strict-transport-security-hsts/1180/1

lighttpd doesn’t support .htaccess files like Apache httpd does. That’s where the “light” in “lighttpd” comes into play.

https://stackoverflow.com/questions/3654765/apache-htaccess-file-on-lighttpd

Guess you need apache2 as preferred…might need to uninstall nextcloud before switching over to apache2…make sure you do a backup first! :wink:

Hi.

Try the following instructions
https://github.com/galeone/letsencrypt-lighttpd
I used it once on a raspi zero and worked fine.

Regarding using Apache …on single board computers i usually prefer nginx over Apache. From my experience things can get a bit a out of control with Apache , specially if you use Nextcloud to sync with computers . Stuff like 100% cpu usage all the time resulting in heat issues. Never had a single problem with nginx

Thank you guys I will look into these two.

Hi NutsAboutPI,

there is not too much you need to hack around. The LetsEnrcrypt/CertBot implementation of DietPi fully supports Lighttpd since some versions.
Just install CertBot via “dietpi-software”, then start “dietpi-letsencrypt”, select HTTPS redirection and/or HSTS (would recommend both directly, if you open personal data via Nextcloud to the web), enter your domain and info and go.
Automatic certificate renewal etc. is included.
That .htaccess is not supported by Lighttpd has not much to do with “Light”, but with the fact that the use of .htaccess is a ~unique feature of Apache’s mpm-prefork + mod-php implementation. No other webserver supports this, as far as I know, they instead can use .user.ini as alternative possibility for folder specific PHP settings. Nextcloud also ships a .user.ini besides its .htaccess file to natively support different webserver or Apache with disabled .htaccess support.

Lighttpd uses the dedicated php-fpm (FastCGI) server as PHP connector, the same with Nginx and this is the way it would be also recommended for large scale Apache2 servers (high traffic, unlike what you are able to handle via SBC), using it’s mpm-worker or mpm-event module to access dedicated php-fpm.