philippgr
Posts: 8
Joined: Sun Apr 22, 2018 3:49 pm

Nextcloud on apache 2

Mon Apr 30, 2018 4:12 pm

Hello all,

I am pretty new to the Pi (have not done much with it since I got it besides Kodi) (and am a beginner in this world. However, I am on a journey to abandon google universe. More tricky than I thought tbh.

I have decided to setup nextcloud on the Pi with a Seagate 2tb external hdd. I am pretty sure I am using a revision 10 (B+) for this.
It is running a very recent (within last month) version of Stretch. I am following this guide: https://pimylifeup.com/raspberry-pi-nextcloud-server/
I only diverted from it once so far and that was when installing php7. What is included in the suggested commands was missing some packages so I installed php7 with the command from here instead: http://unixetc.co.uk/2016/11/20/simple- ... pberry-pi/

Upon doing that I got it up and running in the local network. The last thing I did was setting up the SSL certificate. (Note: I want to use my own domain but I could not work out what to do, instead of following the tutorial so I was going ahead with it anyways as given in the former link.)

Sorry about this being wordy. Now my question: after setting up the ssl and restarting apache2 I tried again to reach the installation in my local network. However, whilst I can reach apache2 through my browser https is crossed out in red and /nextcloud is giving out an http 500 error.

Has anyone got an idea why this could be?

Thank you for your help in advance.
Philipp

latimeria
Posts: 258
Joined: Sat Jan 31, 2015 1:47 pm

Re: Nextcloud on apache 2

Tue May 01, 2018 2:14 pm

try this project https://github.com/nextcloud/nextcloudpi
I think you will be happy with many "pre-compiled" options

philippgr
Posts: 8
Joined: Sun Apr 22, 2018 3:49 pm

Re: Nextcloud on apache 2

Thu May 03, 2018 7:52 pm

latimeria wrote:
Tue May 01, 2018 2:14 pm
try this project https://github.com/nextcloud/nextcloudpi
I think you will be happy with many "pre-compiled" options
Thank you. I will have a look at those.

However, I would also like to learn a lot more. Are you suggesting this is too difficult a project to complete? Will I need too much help from others?

If you are happy to help me with this step I would like to try to do it myself.
Thank you

nobbit
Posts: 106
Joined: Sun Sep 25, 2011 5:51 pm

Re: Nextcloud on apache 2

Fri May 04, 2018 10:37 am

Setting up SSL can sometimes be a bit of a pain. It's really hard to guess at what could have gone wrong without a lot more information.

First, though:
1) Can you access /nextcloud through ordinary http? If you can't, try to solve that problem first :)
2) You get the "https" "crossed out in red" as you say. This may be completely normal since you're using a self-signed certificate. Click the padlock icon next to "https" in the address bar and see if you can get more info about the supposed error. It's possible that it's just a warning about a self-signed cert. Either way, get as much info from that as possible.

From your pi you can also run the following to get more info about your SSL connection:
openssl s_client -connect localhost:443 -showcerts

I'd like to leave the googleverse too, so this project is of interest to me. Tell me how it goes and how you eventually get out of gmail! :D

philippgr
Posts: 8
Joined: Sun Apr 22, 2018 3:49 pm

Re: Nextcloud on apache 2

Sun May 13, 2018 8:12 pm

nobbit wrote:
Fri May 04, 2018 10:37 am
Setting up SSL can sometimes be a bit of a pain. It's really hard to guess at what could have gone wrong without a lot more information.

First, though:
1) Can you access /nextcloud through ordinary http? If you can't, try to solve that problem first :)
2) You get the "https" "crossed out in red" as you say. This may be completely normal since you're using a self-signed certificate. Click the padlock icon next to "https" in the address bar and see if you can get more info about the supposed error. It's possible that it's just a warning about a self-signed cert. Either way, get as much info from that as possible.

From your pi you can also run the following to get more info about your SSL connection:
openssl s_client -connect localhost:443 -showcerts

I'd like to leave the googleverse too, so this project is of interest to me. Tell me how it goes and how you eventually get out of gmail! :D
Thank you. I will try to do this tomorrow night. just wanted to let you know I am committed to this (but not the only project on)...

Google, yes. I have spent so much time researching this. I do a lot of collaborative work online and am looking at functionality and reliability. Collabora (on the PI) is something that I have not looked into yet but will once the drive is online. Is there anything in particular you are interested in?

Speak soon.
Philipp

cpc464
Posts: 187
Joined: Tue Jul 08, 2014 5:10 pm
Contact: Website

Re: Nextcloud on apache 2

Sun May 13, 2018 9:01 pm

Hi Philipp. I am the author of the unixetc..co.uk article quoted in your original post. This might or might not be helpful, but I have just published a new article on how to convert a RPi/Apche based website from http to https. It is designed to be simple and uses a free digital certificate from Let's Encrypt.

http://unixetc.co.uk/2017/06/04/using-a ... eb-server/

Jim
Unix engineer since 1989

philippgr
Posts: 8
Joined: Sun Apr 22, 2018 3:49 pm

Re: Nextcloud on apache 2

Mon May 14, 2018 7:52 pm

nobbit wrote:
Fri May 04, 2018 10:37 am

2) You get the "https" "crossed out in red" as you say. This may be completely normal since you're using a self-signed certificate. Click the padlock icon next to "https" in the address bar and see if you can get more info about the supposed error. It's possible that it's just a warning about a self-signed cert. Either way, get as much info from that as possible.
OMG... that is what it is. How embarrassing. The original tutorial stated something regarding the browser not trusting it and I still did not realise when I then put it in... :roll:

Well, thanks for that.
Hi Philipp. I am the author of the unixetc..co.uk article quoted in your original post. This might or might not be helpful, but I have just published a new article on how to convert a RPi/Apche based website from http to https. It is designed to be simple and uses a free digital certificate from Let's Encrypt.
Thank you for this as well. And thanks for the original post I am working with to some extent.

I have made some progress tonight. I am currently waiting for cloudflare to see the DNS changes I did to my site.
If I make those changes to the top level domain will they apply to all subdomains as well? (I want to use drive.mydomain.co.uk)?

Thank you.
Philipp

nobbit
Posts: 106
Joined: Sun Sep 25, 2011 5:51 pm

Re: Nextcloud on apache 2

Fri May 18, 2018 10:26 am

philippgr wrote:
Mon May 14, 2018 7:52 pm
nobbit wrote:
Fri May 04, 2018 10:37 am

2) You get the "https" "crossed out in red" as you say. This may be completely normal since you're using a self-signed certificate. Click the padlock icon next to "https" in the address bar and see if you can get more info about the supposed error. It's possible that it's just a warning about a self-signed cert. Either way, get as much info from that as possible.
OMG... that is what it is. How embarrassing. The original tutorial stated something regarding the browser not trusting it and I still did not realise when I then put it in... :roll:

Well, thanks for that.
Awesome! One less thing to worry about :D
philippgr wrote:
Mon May 14, 2018 7:52 pm
Hi Philipp. I am the author of the unixetc..co.uk article quoted in your original post. This might or might not be helpful, but I have just published a new article on how to convert a RPi/Apche based website from http to https. It is designed to be simple and uses a free digital certificate from Let's Encrypt.
Thank you for this as well. And thanks for the original post I am working with to some extent.

I have made some progress tonight. I am currently waiting for cloudflare to see the DNS changes I did to my site.
If I make those changes to the top level domain will they apply to all subdomains as well? (I want to use drive.mydomain.co.uk)?

Thank you.
Philipp
The DNS only cares about top-level domains. I.e. any browser going to anything.mydomain.co.uk will only ask the DNS for the IP of mydomain.co.uk. Then it'll go ahead and ask your server where "anything" can be found on your domain. In essence, when you've bought the domain name mydomain.co.uk you can set up as many subdomains below that as you wish without and DNS changes.

philippgr
Posts: 8
Joined: Sun Apr 22, 2018 3:49 pm

Re: Nextcloud on apache 2

Sat May 19, 2018 11:24 am

[quoteThe DNS only cares about top-level domains. I.e. any browser going to anything.mydomain.co.uk will only ask the DNS for the IP of mydomain.co.uk. Then it'll go ahead and ask your server where "anything" can be found on your domain. In essence, when you've bought the domain name mydomain.co.uk you can set up as many subdomains below that as you wish without and DNS changes.][/quote]

Thank you very much. How does cloudfare then know that a certain subdomain is supposed to go to a certain server? Do they not all point at the server of the top level domain then? This relates to my enquiry below, thanks.

I am currently trying to move forward with this. I am using this to get the dynamic DNS up and running:
https://pimylifeup.com/raspberry-pi-port-forwarding/

I chose to go down the cloudfare path and my domain is online in cloudfare. I finished everything including step 8 in the DDNS via cloudfare section. I also tried different scenarios for step 9. There are various types of DNS entries for my top level domain in there. I tried any combination of deactivating the proxies. However, when going to the site via a browser it says that the website cannot be found.
Nextcloud is still running well in the local network. The subdomain exists and points to cloudfare.
I also tried to use the zone ID from cloudfare instead of the domain name. the zone/domain entry in ddclient I tried with and without http(s):// - also tried this with the subdomain in the line underneath zone=

In some posts I read one had to do something with ones router. is that correct? Or is the connection between domain provider and cloudfare not ok (it says it is online in cloudfare and the top level domain works)? Or could my question above have something to do with it? Does DDcllient write into the DNS on cloudfare (if yes, does it write into the AAAA type or the A type)?

Thank you very much for your help. I feel like I am close to the end. nextcloud is working well in the local network.

Best wishes,
Philipp

philippgr
Posts: 8
Joined: Sun Apr 22, 2018 3:49 pm

Re: Nextcloud on apache 2

Tue May 29, 2018 6:17 pm

Dear all,

I am still trying to do this. Just to keep this updated:

I just checked the port that was created, it is open (used a tester).
I tried to access it via my externalip:port - with https it says it send an invalid response, (cannot provide a secure connection)
I tried to access via http and there it says that IP address took too long too respond

Any help is much appreciated.

Philipp

philippgr
Posts: 8
Joined: Sun Apr 22, 2018 3:49 pm

Re: Nextcloud on apache 2

Sat Jun 09, 2018 11:23 am

Hello,

new update. Am still trying to figure this out (yes, I don't have much time so work on this every couple of weeks). However, I am also stubborn and keen to succeed. Nobbit has kindly sent me some questions/guidance in a DM. Here my reply to him that shows where I am currently at:

In the local network I am not actually using the port. I am using https://192.168.1.240/nextcloud/
It does not trust the certificate but I can still get on...
Just tried: http://192.168.1.240:80/ - That redirects to https (as planned) and gets me to the apache2 page
Also tried: https://192.168.1.240:443 - also gets me to the apache2 page on LAN

https://192.168.1.240:443/nextcloud/ gets me onto the nextcloud service in LAN

Ok. Port forwarding. I had followed this tutorial:
https://pimylifeup.com/raspberry-pi-port-forwarding/

I created this port on the router. See screenshot here: http://www.evernote.com/l/ANy0AjDKeM1O4 ... wPE6Njic8/

I then go to http://whatismyip.com on the raspberrypi (using the browser). It tells me my IPv4.

When I use that IP + port 80 on a port checker it tells me that the port is open. The thread on the forum tells you which port checker I used... cannot recall just now.

If I put http://IP:80 in a browser from outside my LAN then nothing happens.

I just created a new port 443. See here how it looks on the router: http://www.evernote.com/l/ANytqngTqfFHG ... CnMyVSLIY/

I tried to navigate to that port from outside my LAN using https://externalIP:443 and again, it tells me that the connection timed out.

I tried this from the RPI that also is the server (not sure if correct).
nobbit wrote:
Sat Jun 02, 2018 8:56 pm
Code: Select all

wget http://yourdomainoripaddress
It also tells me failed: connection timed out. It then tries again.

I then tried this from the PI terminal as well:
nobbit wrote:
Sat Jun 02, 2018 8:56 pm

openssl s_client -connect yourdomainoripaddress:443 -showcerts
That resulted in the following:

1996002720:error:0200206E:system library:connect:Connection timed out:../crypto/bio/b_sock2.c:108:
1996002720:error:2008A067:BIO routines:BIO_connect:connect error:../crypto/bio/bconnect:errno=110

I have tried to google that but I do not find something that is immediately relevant... sorry.

Please, anyones help would be appreciated. I actually have quite a bit time today and will be back later to check if anyone has been able to help.
Thank you very much.
Philipp

Return to “Networking and servers”

Who is online

Users browsing this forum: No registered users and 13 guests