The Oceanside Group Home page

Oceanside Group

Summary

I was approached by one of my co-workers with some questions about how to continually run a python script on GoDaddy hosting.  Since this isn't possible, it was pretty easy to say, "Well, you can't".  The follow up, cause you never want to say no, was: what you want to do is get your site off of GoDaddy and onto AWS so you can run it on a reasonably cheap server that will let you run a python script over and over again.  No problems.  After a second it occurred to me. I have an AWS account and I can provide some value add to his environment.  I offered to host his site in my AWS instance for a marginal fee (because he's a co-worker).

And so this project was born.

I spoke with him for a while to understand what he was trying to accomplish and ultimately, I was able to craft the following solution document for his review:

Requirements

This project was to replace the Godaddy hosting for the website oceansidegroup.net with a solution that would allow for python scripts to be executed on the same server as the website. An additional consideration is that all current functionality would be retained.

The following requirements exist

  1. Website available on the public internet
  2. Website runs PHP
  3. Website requires a mySQL database
  4. Client requires the ability to remotely access the database
  5. Client requires the ability to remotely modify website files
  6. Client requires the ability to run a python script on the server
  7. Client requires the ability to modify the python script remotely

Solution Details

Server Access

The server’s console can be accessed through Putty at <redacted> using the PEK file provided on the USB.  Please take care and avoid sharing that file with anyone who should not have access to the system.

This tutorial from AWS provides the instructions for configuring Putty:  Connect to your Linux instance from Windows using PuTTY - Amazon Elastic Compute Cloud

Once you are connected to the server you will find yourself in the /home/ubuntu directory.  This is a secure folder that you may use to download resources, configure python scripts, etc.

If a command you are attempting to run returns with a permissions error, you will be able to run the command with administrative rights by using the “sudo” command in front of the desired command:

Example:

  • sudo systemctl restart apache2

File Transfers

Transferring files to the server can be accomplished through the use of WinScP which is available at this link:  Downloading WinSCP-5.17.10-Setup.exe :: WinSCP

It is a product provided by the same company that produces Putty and it will automatically configure your connection properties using the configuration you completed in the Server Access section. 

The GUI for WinScp shares many similarities to Filezilla but if you experience any issues do not hesitate to reach out.

Database Access

The database, “oceanside_deals” is available through phpMyAdmin at <redacted>

The credentials for the phpMyAdmin site match your current database credentials.

Python

Python 3 is native to Ubuntu 20.  It is ready to use.  You will need to find the equivalent libraries using pip3 to duplicate your development environment. 

If you have any issues, do not hesitate to reach out.

Support and Issues

If you require assistance, please contact Rob Tacey at rob@robtacey.com

I monitor the server 24x7 for availability of the server itself as well as the mysql and apache2 process.  These will be addressed as soon as possible.

Next Steps

The following tasks are required to move the site into production:

  1. Kevin to review and approve the new solution.
  2. DNS record update to point to the new server.
  3. Provisioning Certbot SSL certificate once the DNS record is updated.
  4. Disable HTTP access (only allow HTTPS).

My co-worker was delighted with the detail - I kind of just whipped it up because his needs weren't all that complicated from a hosting point of view and he agreed.  One week later the site has been transferred and it's humming along.

The site has something to do with cryptocurrency and my co-worker has a web guy to build the site so I don't have to worry about that.  Other than capacity my involvement is making sure the server is solid.

Architecture

To start, I doubled the resources that GoDaddy was providing because I would also be hosting a pretty small mySQL database.  The site is running on a t2.micro instance.  More than adequate for the size of the database and the expected traffic.  Of course, I'll monitor this going forward and if he needs to expand we can talk about it.

  • AWS t2.micro instance with Elastic IP
  • The operating system is Ubuntu 20.04.2 LTS. 
  • Python is 3.x
  • PHP 7.4
  • Database is version 15.1 Distrib 10.1.47-MariaDb
  • Apache2
  • DNS/Nameserver is provided by GoDaddy

The short version is everything is pretty standard and default.

Lessons Learned

Technical

At this point it's a pretty pedestrian project from my point of view.  Stand up a server and make it go.  Done.

Process

It's been a bit since I've had my consulting practice in place and so I'm thinking I need to do a better job setting expectations.  I'm getting a fair few pings (okay, every night) with questions on the differences between this setup and GoDaddy/windows setup.  It's all good though. My client gets I'm busy and he's pretty competent so he can usually fix things himself. If I were to make this a thing though...  Boundaries and/or billing mechanisms for random queries needs to be a thing.

I also need to harden how I create billing for a client.  It's been so long.

Current Status

This is a new project that's currently active.  You can view the site at Oceanside Group.

This article was updated on March 23, 2021

Rob Tacey

Rob is the IT Systems Manager for a manufacturing automation company in Southwestern Ontario. It's great. He's a technologist focusing on information technology, IT security, and customer satisfaction. With over 20 years of experience in various IT roles, it might actually be worth reading some of his stuff.

Comments