SSL with openssl made everything stop working

jeremyy44

New Member
Credits
189
So basiclky yesterday I tried to use a self signed ssl using openssl but since creating it using the command

sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/private/apache-selfsigned.key -out /etc/ssl/certs/apache-selfsigned.crt

most of myy things like nextcloud and cockpit are not working anymore so I would like to deactivate the ssl certificate but couldnt find anything online to help me.
Could someone help me with this?
Im on Ubuntu Server 20.04
 


f33dm3bits

Gold Member
Gold Supporter
Credits
25,640
What do you mean not working anymore, what happens when you go to your website now, maybe share a screenshot of what you see? What were you using before you installed the self signed key and certificate?
 

jeremyy44

New Member
Credits
189
This is what happen when trying with nextcloud with both my second nic ip adresse which is what I mainly use and my main ip adresse.
And same thing with cockpit
 

Attachments

f33dm3bits

Gold Member
Gold Supporter
Credits
25,640
What does your apache vhost configuration look like for nextcloud?
 

jeremyy44

New Member
Credits
189
I didnt use apache to setup nextcloud in fact apache isnt installed on my box.
The problems all started with the ssl command which brought what I explained earlyer.
But if even without apache installed I can acces that file im not sure how.
 

f33dm3bits

Gold Member
Gold Supporter
Credits
25,640
I was assuming you were using apache because apache being in the cert and key name the only thing that command did was generate a key and created a self signed certificated. If that happened to be the same name of an already existing certificate and key that command will have over written it and you will need to restore the original files from a backup.
 

jeremyy44

New Member
Credits
189
Alright and what if I dont have a backup of these file?
BEcause its the first time I ever used a ssl and all I did was create it with the command I didnt even configure any of my services to use it.
So idk if I even had a old file with that same name
 

f33dm3bits

Gold Member
Gold Supporter
Credits
25,640
If you weren't using an ssl configuration before in your website it's not all of a sudden going to be activated with that command because it needs to be configured for each website separately. What does your webserver configuration look like? Also what are do messages are you getting in your webserver's nextcloud log files?
 

jeremyy44

New Member
Credits
189
Well for some reason turns out cockpit was uninstalled and many more services were too like snapd for exemple had to reinstall them so I guess Nextcloud was too.
Yesterday I tried to apt remove openssl in hope that it would remove the ssl and the after that is when it all stopped working could uninstalling open ssl remove a bunch a services?
 

f33dm3bits

Gold Member
Gold Supporter
Credits
25,640
Was nextcloud installed using snapd?
 

jeremyy44

New Member
Credits
189
It was yeah which it why I assumed it wasnt using apache because that also wasnt installed but now that I think about it its a bit dumb to assume
 

f33dm3bits

Gold Member
Gold Supporter
Credits
25,640
I have no experience with snaps so can't help you with that but maybe someone else can. So the situation is you ran that command, your nextcloud and other websites stopped working. Then you found out snapd, cockpit and other services had been removed(probably because they too were snaps?), then you reinstalled them and now you are getting an error message("Connection refused" when you try to reach your nextcloud website?
 

jeremyy44

New Member
Credits
189
Yeah well actually I was getting the error message becaus eeverything was uninstalled for idk what reason but now I reinstalled everything and it seems to be going ok the only thing is my nextcloud directory was erase same with all the plugins so basicly a fresh install but aside from that it seems to be working
 

f33dm3bits

Gold Member
Gold Supporter
Credits
25,640
I looked up how installing nextcloud using snaps works, it seems you have to use special commands to either use a self signed or letsencrypt certificate.
Code:
sudo nextcloud.enable-https self-signed
sudo nextcloud.enable-https lets-encrypt
My guess the same may go for other snaps or something like that, I would look up to see if you can find any other information about setting up ssl for those snaps. That's the only advice I can give, hope that helps ;) If not maybe someone else on the forums that has experience with snaps will be able to help you out.
 
$100 Digital Ocean Credit
Get a free VM to test out Linux!


Top