From 1e06063a10549c2bc113e2496d32ed901d9f186f Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Sat, 31 Jul 2021 07:57:19 -0400 Subject: nextcloud fixes. close #101, close #100 --- nextcloud.html | 48 +++++++++++++++++++++--------------------------- 1 file changed, 21 insertions(+), 27 deletions(-) diff --git a/nextcloud.html b/nextcloud.html index a49b93e..ea039f8 100644 --- a/nextcloud.html +++ b/nextcloud.html @@ -17,8 +17,6 @@

logoNextcloud is a free and open source solution for cloud storage. However it can also do other things, such as manage your email, notes, calender, tasks, and can even connect to the Fediverse (think Mastodon and Pleroma). Pretty much every service that Google has to offer has a much better alternative as a Nextcloud app and this is a must-have for anyone wanting to get away from Google services but still wants a traditional cloud experience (in the likes of Google Services, anyways).

Instructions

-

First, we need to obtain a shell prompt by ssh-ing (remote machines or local machines) or just logging in (local machines). A traditional ssh might look like this if the domain you wished to ssh into is landchad.net:

-
ssh root@landchad.net

We should upgrade the system and then install packages that we might need. Run the following command:

apt-get full-upgrade -y && sudo apt-get install mariadb-server php-mysql php php-gd php-mbstring php-dom php-curl php-zip php-simplexml php-xml php-fpm -y

Next, we need to set up our SQL database by running a Secure Installation and creating the tables that will store data that Nextcloud will need. Run the following command:

@@ -40,9 +38,9 @@ EXIT;

Now we need to configure PHP. Let's start my making sure that the PHP user is set to www-data and if that is not the case, add the www-data user if needed and set the correct variable in nginx.conf. Make sure this line is at the beginning of /etc/nginx/nginx.conf.

user www-data;

Check for the www-data user by running id -u www-data. If a number is output from that command, then the www-data user exists. If not. add the user simply by running useradd www-data

-

Next, we need to ensure that we have SSL certificates generated for your website. If you have not already done this, refer to this guide. Although having SSL for your site is not required, it is highly recommended that you have it or you will risk attackers being able to steal passwords and data.

+

Next, we need to ensure that we have SSL certificates generated for your website. If you have not already done this, refer to this guide.

In /etc/nginx/sites-available/ we need to make a new configuration for Nextcloud (example: /etc/nginx/sites-available/nextcloud). Create it and open it, modify, and add the following lines:

-
upstream php-handler {
+        
upstream php-handler {
     server unix:/var/run/php/php7.4-fpm.sock;
     server 127.0.0.1:9000;
 }
@@ -50,19 +48,17 @@ EXIT;
server { listen 80; listen [::]:80; - server_name yourwebsite.com; + server_name example.org; return 301 https://$server_name$request_uri; } server { - - # If you have SSL ready for your website (DO NOT use Nextcloud without HTTPS, you will risk data leaks including passwords and files), use these lines: listen 443 ssl http2; listen [::]:443 ssl http2; - server_name yourwebsite.com; - ssl_certificate /etc/ssl/nginx/yourwebsite.com.crt; - ssl_certificate_key /etc/ssl/nginx/yourwebsite.com.key; + server_name example.org; + ssl_certificate /etc/letsencrypt/live/example.org/cert.pem ; + ssl_certificate_key /etc/letsencrypt/live/example.org/privkey.pem ; root /var/www; @@ -172,16 +168,16 @@ systemctl enable mariadb systemctl start mariadb

Reload the nginx service:

systemctl reload nginx
-

Now we need to head to Nextcloud's web interface. Go to your web browser and go to your website, but go to the subdirectory "nextcloud" instead. For example, if your domain is landchad.net and you have set up HTTPS then go to https://landchad.net/nextcloud. This will launch the configuration wizard.

+

Now we need to head to Nextcloud's web interface. Go to your web browser and go to your website, but go to the subdirectory "nextcloud" instead. Go to https://example.org/nextcloud. This will launch the configuration wizard.

Congratulations, you have set up your own Nextcloud instance.

@@ -190,13 +186,13 @@ systemctl start mariadb

Now you may be wondering: What do I do now? Here are some suggestions:

Enjoy your cloud services in freedom.

@@ -205,8 +201,6 @@ systemctl start mariadb

Written by Matthew "Madness" Evan

- - -- cgit v1.2.3