If you are interested in how to install Python 3, the most popular web server out there, check out this tutorial.
If you want to learn about Python 2 and Python 2.7, check this tutorial instead.
There is no need to install a separate package just to run the web server.
We’ll cover how to set up Python 3.
The main purpose of this tutorial is to demonstrate how to use the official Python webserver in production.
Before we begin, you need to make sure that your webserver is properly configured for Python 3 by checking the server configuration options and adding a security group that you will be able to add to any hosts that you wish.
For more information on setting up your own webserver, check Out this tutorial on setting Up a Python Server to run Python 3 as well.
In this tutorial, we’ll install the official Ubuntu 12.04 server, which is available as part of Ubuntu 12, 12.10, 14.04, and 16.04.
You will need to download the official server packages for your OS.
To install the Ubuntu 12 server, you can use the command: sudo apt-get install ubuntu12 You can download the Ubuntu 16 server package as well if you prefer.
The installation of the Ubuntu server packages is fairly straightforward.
You can install the server by using the command sudo apt install ubuntustorage-server To install Ubuntu 14.10 and 16 servers, you will need a few additional packages.
The easiest way to install them is to use sudo apt update sudo apt upgrade You can use sudo yum install python-http-server If you would like to install Ubuntu 17.04 servers, just follow these instructions.
sudo yums install python3-httpd-server You will also need to add a firewall rule for the Ubuntu servers.
The firewall rules are in /etc/firewall/rules.d/rules and you can find them using the help command.
To add the firewall rules for Ubuntu 15.04 and 16, you should add the following rule: firewall-cmd –add-rule –additional-rule=ubuntu14.10-14.04-17.04 firewall-rules.rules