1 Install dependent packages
yum install gcc-c++
yum install pcre pcre-devel
yum install zlib zlib-devel
yum install openssl openssl--devel
2 Download the installation package
wget http://nginx.org/download/nginx-1.7.4.tar.gz
3 After decompression and move to the /usr/local/ directory
tar -zxvf nginx-1.7.4.tar.gz
mv nginx-1.7.4 /usr/local/
4 Enter the directory to make make install
cd /usr/local/nginx-1.7.4/
./configure
make
make install
5 Verify
whereis nginx
Check out the command help
/usr/local/nginx/sbin/nginx -h
The default is port 80
Browser opens http://10.238.162.33 : 80
Reference https://www.cnblogs.com/forthelichking/p/11818253.html
Two install Python 3.7.4
wget https://www.python.org/ftp/python/3.7.4/Python-3.7.4.tgz
tar -xzvf Python-3.7.4.tgz
cd Python-3.7.4
./configure --prefix=/usr/local/python3
make
make install
ln -s /usr/local/python3/bin/python3.7 /usr/bin/python3
ln -s /usr/local/python3/bin/pip3.7 /usr/bin/pip3
Three install uwsgi and django
Installation of uwsgi reports an error because the dependency package is not installed, the following is a screenshot of the error report
Install dependencies
yum -y install python-devel libevent-devel libjpeg-devel
pip install uwsgi
Successful installation
Install django
pip install django
Test whether django is working properly.
django-admin.py start project demo site
cd demosite/
python manage.py runserver 0.0.0.0:8002
Access error
Invalid HTTP_HOST header: '10.238.162.33:8002'. You may need to add u'10.238.162.33' to ALLOWED_HOSTS.
vi settings.py
ALLOWED_HOSTS = ['*']
After adding the whitelist, try to start the service again and visit the browser.
Full documentation
https://zhuanlan.zhihu.com/p/101907939
Novice Tutorial
https://www.runoob.com/django/django-nginx-uwsgi.html
Python upgrade