Author Topic: Setting Up Again on Ubuntu 20.04  (Read 5414 times)

Dragon

  • Administrator
  • Platinum Level
  • *****
  • Posts: 4865
  • Have you played my board game?
    • Rival Troops
Setting Up Again on Ubuntu 20.04
« 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.

https://www.digitalocean.com/community/tutorials/initial-server-setup-with-ubuntu-20-04
https://www.digitalocean.com/community/tutorials/how-to-install-the-apache-web-server-on-ubuntu-20-04
https://www.digitalocean.com/community/tutorials/ufw-essentials-common-firewall-rules-and-commands
https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu-20-04

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
« Last Edit: February 19, 2021, 23:33:13 by Dragon »
"Hello IT. Have you tried turning it off and on again? ... OK, well, the button on the side. Is it glowing?... Yeah, you need to turn it on. Err, the button turns it on. Yeah, you do know how a button works, don't you? No, not on clothes." - Roy (The IT Crowd)

Dragon

  • Administrator
  • Platinum Level
  • *****
  • Posts: 4865
  • Have you played my board game?
    • Rival Troops
Re: Setting Up Again on Ubuntu 20.04
« Reply #1 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
.....
127.0.0.1    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.

https://www.digitalocean.com/community/tutorials/how-to-secure-apache-with-let-s-encrypt-on-ubuntu-20-04

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.
« Last Edit: February 19, 2021, 23:51:47 by Dragon »
"Hello IT. Have you tried turning it off and on again? ... OK, well, the button on the side. Is it glowing?... Yeah, you need to turn it on. Err, the button turns it on. Yeah, you do know how a button works, don't you? No, not on clothes." - Roy (The IT Crowd)

Dragon

  • Administrator
  • Platinum Level
  • *****
  • Posts: 4865
  • Have you played my board game?
    • Rival Troops
Re: Setting Up Again on Ubuntu 20.04
« Reply #2 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.

https://www.sslforfree.com/
https://www.ssllabs.com/ssltest/analyze.html?d=dragonhobbies.com

And when it comes time for renewal...
https://manage.sslforfree.com/dashboard
« Last Edit: May 12, 2021, 21:49:56 by Dragon »
"Hello IT. Have you tried turning it off and on again? ... OK, well, the button on the side. Is it glowing?... Yeah, you need to turn it on. Err, the button turns it on. Yeah, you do know how a button works, don't you? No, not on clothes." - Roy (The IT Crowd)

Dragon

  • Administrator
  • Platinum Level
  • *****
  • Posts: 4865
  • Have you played my board game?
    • Rival Troops
Re: Setting Up Again on Ubuntu 20.04
« Reply #3 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, I have dragonhobbies.com, nathanieldragon.com, tycobandit.com, fartingcowsgame.com, and fartingcowgame.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!)
"Hello IT. Have you tried turning it off and on again? ... OK, well, the button on the side. Is it glowing?... Yeah, you need to turn it on. Err, the button turns it on. Yeah, you do know how a button works, don't you? No, not on clothes." - Roy (The IT Crowd)

Dragon

  • Administrator
  • Platinum Level
  • *****
  • Posts: 4865
  • Have you played my board game?
    • Rival Troops
Re: Setting Up Again on Ubuntu 20.04
« Reply #4 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.

https://www.whynopadlock.com/
"Hello IT. Have you tried turning it off and on again? ... OK, well, the button on the side. Is it glowing?... Yeah, you need to turn it on. Err, the button turns it on. Yeah, you do know how a button works, don't you? No, not on clothes." - Roy (The IT Crowd)

Dragon

  • Administrator
  • Platinum Level
  • *****
  • Posts: 4865
  • Have you played my board game?
    • Rival Troops
Re: Setting Up Again on Ubuntu 20.04
« Reply #5 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. 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://www.digitalocean.com/community/tutorials/how-to-secure-apache-with-let-s-encrypt-on-ubuntu-18-04

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."
« Last Edit: January 02, 2022, 13:38:39 by Dragon »
"Hello IT. Have you tried turning it off and on again? ... OK, well, the button on the side. Is it glowing?... Yeah, you need to turn it on. Err, the button turns it on. Yeah, you do know how a button works, don't you? No, not on clothes." - Roy (The IT Crowd)

Dragon

  • Administrator
  • Platinum Level
  • *****
  • Posts: 4865
  • Have you played my board game?
    • Rival Troops
Re: Setting Up Again on Ubuntu 20.04
« Reply #6 on: April 02, 2022, 14:30:45 »
Another customization that I've used before is for NetBeans. I've tried many dark colored themes, but my favorite in NetBeans is the Darcula Theme (pay attention to the spelling - this isn't Dracula). It doesn't appear to be included with the Available Plugins anymore, but still is available on GitHub at https://github.com/Revivius/nb-darcula.
« Last Edit: April 04, 2022, 16:51:52 by Dragon »
"Hello IT. Have you tried turning it off and on again? ... OK, well, the button on the side. Is it glowing?... Yeah, you need to turn it on. Err, the button turns it on. Yeah, you do know how a button works, don't you? No, not on clothes." - Roy (The IT Crowd)