DevOps Classroom notes 26/Dec/2024

IaaS offerings to run Virtual Machines

  • All clouds offer virtual machines as a service
    • AWS => EC2
    • Azure => Virtual Machines
    • GCP => Compute Engine
  • All clouds use some kind of hypervisors
  • The operating system is selected via image (snapshot of a disk)
  • some clouds give you option to set
    • credentials (both username and password/key)
    • password or key
  • Key based authentication
    • private key (you will have a private key)
    • public key (aws/azure will have public key)
  • Size of the machine => selecting cpu and RAM
  • Disk size
  • network

    • public ip
    • private ip
  • In this case we get a virtual machine with selected OS
  • Lets create an ubuntu 24.04 (distribution) in aws free tier
  • Steps:
    • Create network if it doesnot exist
    • Create a key pair and store private key with you
    • Select the sizes
    • select the subnet (where your vm should run)
    • Create a security fencing
    • We get two ips
      • public ip
      • private ip
  • For creation and establishing connection watch classroom recording

Installing nopCommerce

sudo add-apt-repository ppa:dotnet/backports
sudo apt-get update && \
  sudo apt-get install -y dotnet-sdk-9.0

  • check if the dotnet 9 is installed dotnet --list-runtimes
    Preview
  • Lets create a user called as nop in ubuntu
sudo adduser nop
  • Create a directory called as /opt/nop
sudo mkdir /opt/nop
  • Now download nopcommerce into /opt/nop
cd /opt/nop
sudo wget https://github.com/nopSolutions/nopCommerce/releases/download/release-4.80.1/nopCommerce_4.80.1_NoSource_linux_x64.zip
  • install unzip and unzip the package
sudo apt-get install unzip
sudo unzip nopCommerce_4.80.1_NoSource_linux_x64.zip
  • Create couple directories to run nopCommerce:
sudo mkdir bin
sudo mkdir logs
  • Now change the permissions to make nop user as owner
cd ..
sudo chgrp -R nop nop/
sudo chown -R nop nop/
  • Lets create a linux service to run nopCommerce in background and automatically
  • Create the /etc/systemd/system/nopCommerce.service file with the following contents:
[Unit]
Description=Example nopCommerce app running on Xubuntu

[Service]
WorkingDirectory=/opt/nop
ExecStart=/usr/bin/dotnet /opt/nop/Nop.Web.dll --urls http://0.0.0.0:5000
Restart=always
# Restart service after 10 seconds if the dotnet service crashes:
RestartSec=10
KillSignal=SIGINT
SyslogIdentifier=nopCommerce-example
User=nop
Environment=ASPNETCORE_ENVIRONMENT=Production
Environment=DOTNET_PRINT_TELEMETRY_MESSAGE=false

[Install]
WantedBy=multi-user.target
  • Lets enable and start the service
sudo systemctl enable nopCommerce.service
sudo systemctl start nopCommerce.service
  • Now verify the status
sudo systemctl status nopCommerce.service

Preview
* if the service is not working cd into /opt/nop and execute to run manually

sudo dotnet Nop.Web.dll --urls "http://0.0.0.0:5000"

Published
Categorized as Uncategorized Tagged

By continuous learner

devops & cloud enthusiastic learner

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Please turn AdBlock off
Animated Social Media Icons by Acurax Responsive Web Designing Company

Discover more from Direct DevOps from Quality Thought

Subscribe now to keep reading and get access to the full archive.

Continue reading

Visit Us On FacebookVisit Us On LinkedinVisit Us On Youtube