How To Setup Python On Ubuntu 18.04

How To Setup Python On Ubuntu 18.04

A high-level, all-purpose computer language is Python. Code readability is prioritised in its design ideology, which makes heavy use of indentation. It is not specific to any one type of issue and can be used to create a broad range of programmes. It is one of the most popular computer languages today because of its adaptability and beginner-friendliness. You will learn how to set up a programming environment and install Python on Ubuntu 18.04 in this tutorial.

Requirements

  • Ubuntu 18.04 is Operating on a 99RDP Private/Dedicated Server
  • Entry To The Station

Updated and repository added

First, SSH your 99RDP server and upgrade the system’s local software packages and default repository database. This will stop Python installation errors from occurring.


# apt-get update

# apt-get upgrade


We will add the package repository for “software-properties-common” after the upgrade is complete. You can handle your distribution sources and independent software vendor sources with ease thanks to it. Run the provided command in the terminal to join the repository.


# apt install software-properties-common


The “Deadsnake” package source can also be added. Compared to the Ubuntu default package archive, this repository offers more recent programme releases.


# add-apt-repository ppa:deadsnakes/ppa


Python Setup Instructions

Now visit the official Python website and look up the most recent Linux stable version. We’re going to use version 3.11 for the instruction. To obtain and install the Python build, run the provided command.


# apt install python3.11


Once the installation is complete, use the symlink command to create a shortcut to the Python folder.


# ln -s /usr/bin/python3.11 /usr/bin/python


Finally, execute the provided command to ensure that the interpreter is operational.


# python –version

The loaded version of Python will be returned in the output.

Using pip To Manage Python Components

The pip tool will now be installed, making it easier for us to acquire and set up different Python modules. Install pip by typing the provided instructions in the terminal.


# apt install python-pip


Verify the pip version after the download is finished by executing the provided command.


# pip -V


Executing Your First Hello.py Program On Ubuntu 18.04

Your Python installation is now set to compile codes once all of this is finished. So let’s execute a simple print command from hello.py. Use any editor to enter the provided content in a file, then save it as hello.py.

print(“Hello 99RDP”)

Simply enter python filename.py in the terminal to execute the file, then wait for the results.


# python hello.py


Conclusion

This tutorial showed us how to set up Python’s most recent version on Ubuntu 18.04. Additionally, we discovered how to set up pip and execute a python file. Now that Python 3.11 is installed and functional, you can begin creating Python applications. Please get in touch with us if you have any inquiries or recommendations.

Read Our Next Articles Installing Apache HTTP Server in Ubuntu 18.04

Installing Apache HTTP Server in Ubuntu 18.04

Installing Apache HTTP Server in Ubuntu 18.04

Released in 1995, Apache HTTP is a free, open-source, cross-platform web server. It soon surpassed NCSA HTTPd to become the main web server. It served more than 100 million webpages for the first time in 2009 as web server software. Additionally, Apache was crucial to the early development of the World Wide Web. The Apache server project, an initiative to create and manage an open-source HTTP server for cutting-edge operating systems like UNIX and Windows, then appeared.A safe, effective, and extensible server that offers HTTP services in accordance with the most recent HTTP standards is what this project seeks to achieve. based on W3Tech’s evaluation of all webpages conducted in June 2022. With 31.4% of webpages, Apache came in second. This article will teach you how to set up Apache on Ubuntu 18.04.

Requirements

  • 99RDP Server Running Ubuntu 18.04
  • Terminal Access

Installing the Apache Web Service

Let’s update the system’s existing meta packages first, then carry out the installation. To update the existing software packages and repository database, first open the terminal and enter each of the instructions listed one at a time.


# apt-get update

# apt get upgrade


Enter the instruction to install the Apache web server once the update is complete. And then type y to accept the programmes download dialogue box, then wait for it to complete.


# apt-get install apache2


Once the procedure is complete, view the IP address of the server in a web browser to confirm the installation.


http://99RDP server IP


The presence of the aforementioned page indicates that Apache was set up on your server properly. Let’s move on.

Configuring Firewall For Apache Web Server

We must modify our current firewall settings to permit outside traffic to reach the web server. Enter the command in the terminal to see the inventory of apps in ufw.


# ufw app list


We will only enable standard web traffic on port 80 because we haven’t set up SSL on the server. To enable unencrypted web traffic to the app list, type the provided command.


# ufw allow apache


Additionally, execute the provided command to check the firewall status and confirm that the app has been added to the allowed list.


# ufw status


The app rule has been added to give access to the Apache web server, as evidenced by the output.

Administering the services of the Apache Web Server

Now that the web server and firewall rules have been enabled, let’s go over some fundamental systemctl instructions for managing Apache.


systemctl stop apache2: stop the Apache service.

systemctl start apache2: simply start the Apache service.

systemctl restart apache2: to stop and start the Apache service.

systemctl status apache2: check the current running status of Apache service.

systemctl reload apache2: reload the new configuration changes to Apache service.

systemctl disable apache2: disable the automatic startup for Apache when the system boot.

systemctl enable apache2: re-enable the service to start up at boot.

Conclusion

Using Ubuntu 18.04, we demonstrated how to install and set up ufw for the Apache web server in this tutorial. At this stage, your Ubuntu server can successfully host multiple websites and serve any type of content. Feel free to contact us in the comments section below if you have any questions, concerns, or ideas.

Read Our Next Articles How to Monitor Processor Use in Ubuntu 18.04

How to Monitor Processor Use in Ubuntu 18.04

How to Monitor Processor Use in Ubuntu 18.04

To troubleshoot operations that are producing errors, the CPU performance must be closely monitored. Considering that a greater core system operates more quickly and effectively. However Task switching occurs when a CPU core is unable to manage the heavy load of a programme. However, excessive context switching will also increase CPU utilisation. It is crucial to effectively track and monitor the CPU as a result. You will learn how to check Ubuntu 18.04’s CPU usage in this tutorial.

Requirements

  • 99rdp Linux VPS
  • Access To Terminal

How to Monitor Processor Use in Ubuntu 18.04

An dynamic process viewer is htop. For Linux, there is a free (GPL) ncurses-based process monitor called htop. Similar to the top tool, but with the ability to scroll both vertically and horizontally, it enables you to see every process currently active on the system, along with its complete command line, as well as to view it as a process tree and select multiple processes at once. Process-related tasks (such as terminating and re-initializing) can be completed without supplying their PIDs.

Enter the specified code into the terminal to install htop.


# sudo apt install htop


Run the provided command to display the system’s current CPU usage after the installation procedure has finished.


# htop


mpstat – related data for report processors. The first available processor, designated as processor 0, is the one for which the mpstat command writes actions to standard output. Additionally mentioned are the processors’ overall average activities. On both SMP and UP computers, the mpstat command can be used, but on UP machines, only global average activities will be printed. The CPU utilisation report is the default report if no activity has been chosen.

Enter the specified code in the terminal to install mpstat.


# sudo apt install sysstat


Type the provided command after installing the utility to get a report for each running processor. The output from the “htop” command is identical when using the “mpstat” function, but it is presented more succinctly.


# mpstat


You can periodically take snapshots of CPU utilisation using the “mpstat” tool. mpstat “time” “snapshots,” for instance.


# mpstat 3 10


The command outputs the CPU utilisation every three seconds, repeating this for ten spans before generating a final average report.

vmstat – Stats about virtual RAM are reported. The following tool, despite its name, does more than just keep track of memory data. Processes, memory, paging, block IO, traps, storage activity, and CPU activity are all reported by vmstat. Averages since the last reboot are provided in the first summary generated. Additional accounts provide details on a length delay in the sampling interval. In either scenario, the procedure and memory reports are instantaneous.

To view the vmstat CPU summary, enter the command that is provided.


# vmstat


nmon -benchmarking utility, system administrator, and tuner. System administrator, tuning, and benchmarking utility nmon. The CPU, RAM, network, discs (mini graphs or numbers), file systems, NFS, top processes, resources (Linux version & processes), and on Power micro-partition details can all be seen on this screen.

Enter the specified code into the terminal to install nmon.


# sudo apt-get install nmon


Run the provided command after it has completed to verify usage.


# nmon


This will start the tool and show all the available choices. Press the letter c to examine CPU usage. Press C once more to go back. Press “h” for more choices. Press q to stop.

Conclusion

CPU workload is a measure of how much work the CPU is doing to manage operating system duties and process resources. This metric estimates the average CPU utilisation over time and is used to assess system efficiency. High CPU utilisation can be caused by a variety of things, so identifying the underlying cause is crucial if you want to lower it. This guide described numerous helpful commands and tools to assist users in monitoring and resolving their Ubuntu 18.04 CPU-related problems.

Read Our Next Articles How to Setup the Nginx Web Server on Ubuntu 18.04

 

How to Setup the Nginx Web Server on Ubuntu 18.04

How to Setup the Nginx Web Server on Ubuntu 18.04

Igor Sysoev created the Nginx [engine x] HTTP and reverse proxy server, mail proxy server, and general-purpose TCP/UDP proxy server. It has been active for a very long time on numerous heavily trafficked Russian websites, including Yandex, Mail.Ru, VK, and Rambler. As of December 2022, 21.25% of the busiest websites were hosted by or proxied by Nginx, according to Netcraft. Additionally, it can fulfil requests for static resources faster than Apache, enabling you to carefully balance requests, boost speed, and make better use of available resources. You can learn how to set up the Nginx web server on an Ubuntu 18.04 system by reading this tutorial.

  • Root Access
  • Terminal Access
  • Server Running Ubuntu 18:04

Stages To SetUp Nginx Web Server on Ubuntu 18.04

  • SSH into the server and use the provided command to update the preset repository.

# sudo apt update


  • Run the provided command to install Nginx from the apt repository after the upgrade is complete.

# sudo apt install nginx


  • Run the provided command to verify the Nginx process’s status after the installation is finished.

# sudo systemctl status nginx


If the Nginx process isn’t already operating, try starting it with the provided command. The output will produce information about the Nginx process.


# sudo systemctl start nginx

# service nginx start


If the Nginx process is not already running, this will initiate it.


# sudo systemctl stop nginx: Stops the Nginx service
# sudo systemctl enable nginx: Enables Nginx to load at startup
# sudo systemctl disable nginx: Prevents Nginx from loading at startup


Firewall Configuration for Nginx Data

You should modify the firewall programme to permit access to the Nginx service before trying Nginx. During installation, Nginx registers with ufw as a service, making it simple to give access to Nginx. Enter the provided command to create a list of the apps that the firewall allows.


# sudo ufw app list


Full: This profile opens both port 80 (normal, unencrypted web traffic) and port 443 (TLS/SSL encrypted traffic)
HTTP: This profile opens only port 80 (normal, unencrypted web traffic)
HTTPS: This profile opens only port 443 (TLS/SSL encrypted traffic)

The inventory of applications that have access to the firewall rules will be generated by this command. There are three Nginx profiles in the roster. For the purposes of this lesson, port 80 will only be open to the Nginx HTTP profile. To enable Nginx HTTP traffic from the firewall, type the provided command.


You can now assess the firewall’s condition. It ought to show a list of the traffic that is permitted for various applications.


# sudo ufw status


Nginx Web Browser Evaluation

Open a web browser, like Chrome, and type in the address box the IP address of your server. It will display the Nginx welcome page.

Conclusion

After setting up a web server, you have a wide range of choices for the content types you serve and the technologies you employ to produce more immersive experiences. This tutorial showed us how to set up the Nginx Web Server on Ubuntu 18.04. Please get in touch with us if you have any ideas or queries.

Read Our Next Articles Rust Installation Guide for Ubuntu 18.04

 

Rust Installation Guide for Ubuntu 18.04

Rust Installation Guide for Ubuntu 18.04

A multi-paradigm universal computer language is called Rust. Performance, type safety, parallelism, and memory safety are prioritised. This indicates that all references are properly pointing to memory. It does not call for reference counting or the use of a garbage collection as found in other memory-safe languages. This code was created by Graydon Hoare and Mozilla.language and C++ are comparable in syntax. Rust is used in a broad range of software development projects, from browser components to game engines and operating systems. It is built on the tenets of data security, concurrency, and speed. You can learn how to run Rust on Ubuntu 18.04 from this tutorial.

Requirements

  • Ubantu Systems
  • Command Line Access
  • Root Access

Using apt, install Rust on Ubuntu 18.04

Make sure all system repositories are up to current before installing Rust on Ubuntu. To accomplish this, we must use the apt package management tool to update the default repository. To update the usual repository, type the following command into the terminal window. Keep in mind that the apt source might not always provide the most recent version of Rust-lang.


# sudo apt update


Once the usual repository has been updated, run the apt command to install Rust.


# sudo apt install rustc


When asked, say “Yes” to the request for more space.

By executing the provided command, you can confirm that the download is complete.


# rustc -V


The result will validate the installation of rustc 1.61.0.

Using the Rustup script, install rust on Ubuntu 18.04

Rust can be installed on Linux in a number of methods, but the rustup shell script is the most suggested one. On the official Rust page, this is the method that is advised for installing Rust on Ubuntu.

Enter the curl instruction after typing it in the terminal to get the most recent version of Rust.


# curl –proto ‘=https’ –tlsv1.2 -sSf https://sh.rustup.rs | sh


Once the installation process begins, you will have the opportunity to select the installation type you desire. You can choose the second choice to customise your installation if you are familiar with installing Rust. However, we will choose the default installation option and hit enter for the purposes of this guide.

We will now add the Rust directory to the system PATH once the download is complete. Enter the instruction into the box provided.


# source “$HOME/.cargo/env”


There won’t be any results from this. Run the version command once more to confirm the download.


# rustc -V


The loaded version of Rust, rustc 1.66.0, is displayed in the output.

Using apt, remove Rust from Ubuntu 18.04

You must enter the instruction and accept the prompt in order to uninstall Rust using apt manager.


# sudo apt remove rustc


Using the rustup script, remove Rust from Ubuntu 18.04

Run the provided command to remove Rust and its related files from your computer. When asked, respond with a yes.


# rustup self uninstall


You can examine the Rust version once more to confirm the procedure, but this time the result will be: No Such File or Directory.


# rustc -V


Conclusion

A multi-paradigm computer language is called Rust. It was created as a tool for creating strong, effective initiatives. I hope the instructions in this guide helped you install Rust on Ubuntu 18.04. Please feel free to get in touch with us if you have any queries, comments, or suggestions.

Read Our Next Articles Setup Git Once It’s Installed