Connect to CentOS8 with SSH and execute the following with root privileges.
yum -y update
yum install -y wget
sysctl -w net.ipv6.conf.all.disable_ipv6=1
yum -y install vim-enhanced
setenforce 0
vi /etc/selinux/config
Edit below
SELINUX=disabled
Open the port for http access to Django.
firewall-cmd --add-port=80/tcp --zone=public --permanent
firewall-cmd --add-port=8000/tcp --zone=public --permanent
firewall-cmd --add-port=8081/tcp --zone=public --permanent
firewall-cmd --reload
You have created a user (yamato in this case) on CentOS and have administrator privileges.
su yamato
cd /home/yamato
wget https://repo.anaconda.com/archive/Anaconda3-2020.11-Linux-x86_64.sh
sh Anaconda3-2020.11-Linux-x86_64.sh
Follow the wizard and enter yes to proceed. Activate the path when you are done.
source .bashrc
pip install django
cd /home/yamato
django-admin.py startproject myapp
vi /home/yamato/myapp/myapp/settings.py
#ALLOWED_HOSTS = []
ALLOWED_HOSTS = ["*"]
python /home/yamato/myapp/manage.py runserver 0.0.0.0:8000
Access http on port 8000 with the IP address of the virtual server (192.168.1.14 in this case).
http://192.168.1.14:8000/
Recommended Posts