Dragons Hobbies Forum

General Category => Blogs => Topic started by: Dragon on February 16, 2021, 11:51:03

Title: Setting Up Again on Ubuntu 20.04
Post by: Dragon on February 16, 2021, 11:51:03
I recently upgraded my laptop to Ubuntu 20.04 LTS. Unfortunately, it broke so much of what I had working that I wished I had stayed with Ubuntu 18.04 LTS. It probably was about time to upgrade again, but I don't usually have a much time to work on my side projects and I already had everything running fine for web development on my laptop at that point. I'm not sure what went wrong in the update but I couldn't get Apache to start anymore, MySQL wouldn't start anymore, I can't even get MySQL Workbench to open up to connect to a remote server, and even though NetBeans is still working, I have no dev server to test my web apps on now.

Today, I have some time, so I've found this tutorial specifically about setting up the webserver on Ubuntu 20.04 and I'll go through these steps.


One new thing that I don't remember coming across before was this command for finding out which IP addresses are used for the local webserver.
Code: [Select]
hostname -I
Title: Re: Setting Up Again on Ubuntu 20.04
Post by: Dragon on February 19, 2021, 23:37:19
After more crashes, I just decided to wipe out the whole machine and reinstall the Ubuntu 20.04 fresh.

I went through the above tutorials to setup everything with no problem. I was surprised that there was no mention of adding the domain name to the /etc/hosts file though. Pretty simple step to make it so that I can go to dh.local for my dev site.

Code: [Select]
sudo nano /etc/hosts
.....    dh.local
Press CTRL+X to exit and save changes.

That's it. Now opening my browser to dh.local works.

Trying to setup a local SSL cert for test purposes, I used another tutorial on that site.


Unfortunately, my that didn't work for my test domain: dh.local. It failed during Step 4. I'm not sure if that's specifically a restriction for domains that end with .local which seems understandable since that is a special tld (https://en.wikipedia.org/wiki/.local).
Title: Re: Setting Up Again on Ubuntu 20.04
Post by: Dragon on February 21, 2021, 15:39:54
While it didn't work out to setup SSL for my dev box, it did get me pointed to another place where I can setup SSL for free (90 days at a time) using Let's Encrypt. Up to this point, I've always left the SSL stuff to someone else - buying hosting packages that included it, etc. My goal for today though is to get SSL setup on my current website. Here are some of the sites that I'm going to be using today.


And when it comes time for renewal...
Title: Re: Setting Up Again on Ubuntu 20.04
Post by: Dragon on February 21, 2021, 19:29:29
All set with my new SSL cert and with a little htaccess adjustment, we're kicking this over to https://www.dragonshobbies.com, which should show you a lock in the address bar and also be confirmed through SSL Checkers like this: https://www.sslshopper.com/ssl-checker.html#hostname=www.dragonshobbies.com

Code: [Select]
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

By the way, I like this little bit of code for the .htaccess file because it works easily for whatever domain you're using, rather than specifying when I have more than one domain, which I do currently. (In addition to dragonshobbies.com (https://dragonshobbies.com), I have dragonhobbies.com (https://dragonhobbies.com), nathanieldragon.com (http://nathanieldragon.com), tycobandit.com (http://tycobandit.com), fartingcowsgame.com (https://fartingcowsgame.com), and fartingcowgame.com (https://fartingcowsgame.com). I used to own 6sided.com, but I stopped renewing that several years back and now I regret it - especially with being valued at $4599!)
Title: Re: Setting Up Again on Ubuntu 20.04
Post by: Dragon on February 21, 2021, 19:51:42
Here's one more site that I came across today that is helpful for finding those elusive "mixed content" elements that keep a page from being marked as fully secure. Sometimes it's easy to spot the broken images or something, but this will show all the issues on a given page and throw in some checks that aren't found using those built-in browser tools.

Title: Re: Setting Up Again on Ubuntu 20.04
Post by: Dragon on November 15, 2021, 01:20:31
Although I've been using sslforfree.com for a while now, it can only be renewed twice for free. Looking into some other options now, I came across letsencrypt.org (http://letsencrypt.org). And for those working on multiple websites on the same host, check out https://community.letsencrypt.org/t/certificate-for-multiple-websites/165435

Update: Those pages didn't provide enough info to get started without understanding more of the process. Digging around in there will eventually lead to other places, so here's another one to try:

https://community.letsencrypt.org/t/certsage-acme-client-version-1-2-0-easy-webpage-interface-optimized-for-cpanel-no-commands-to-type-root-not-required/164784 is another one that seems helpful regarding CertSage. "CertSage is especially helpful if you are using a shared hosting plan that does not allow root access, such as GoDaddy shared hosting."