准备工作
一台腾讯云轻量应用服务器(
HK
最佳
腾讯云轻量应用服务器最近的几天都有活动大家可以关注一下,前面的文章有详细论述,本文就不赘述了,我们这次的重点依然是玩法! 腾讯云轻量应用服务器购买地址:
SSH
中运行yum -y groupinstall "Development tools" yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel yum install -y libffi-devel
Python3.7
并解压wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tar.xz tar -xvJf Python-3.7.0.tar.xz
Python3.7
安装包目录mkdir /usr/local/python3 cd Python-3.7.0
Python3.7
./configure --prefix=/usr/local/python3 make && make install
ln -s /usr/local/python3/bin/python3 /usr/local/bin/python3 ln -s /usr/local/python3/bin/pip3 /usr/local/bin/pip3
python3 -V pip3 -V
pip3 install --upgrade pip
Python 3.7
了!SQLite
至 /root/sqlite
目录并解压wget -P /root/sqlite https://www.sqlite.org/2021/sqlite-autoconf-3340100.tar.gz tar -zxvf /root/sqlite/sqlite-autoconf-3340100.tar.gz
SQLite
目录cd sqlite-autoconf-3340100
SQLite 3.34.1
./configure --prefix=/usr/local make && make install
SQLite
了!yum -y install fontconfig
PhantomJS
wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2
bzip2
tar
bzip2 -d phantomjs-2.1.1-linux-x86_64.tar.bz2
tar
/usr/local/
tar xvf phantomjs-2.1.1-linux-x86_64.tar -C /usr/local/
ln -s /usr/local/phantomjs-2.1.1-linux-x86_64/bin/phantomjs /usr/bin/
PhantomJS
python3 manage.py migrate python3 manage.py initadmin --username admin --password password python3 manage.py runserver 0.0.0.0:8000 --noreload
--username
--password
SQLite
SQLite
Django
Django
SQLite
if Database.sqlite_version_info < (3, 8, 3):
#
if Database.sqlite_version_info < (3, 8, 3):
if Database.sqlite_version_info < (3, 6, 3):
Esc + :wq
python3 manage.py migrate python3 manage.py initadmin --username admin --password password python3 manage.py runserver 0.0.0.0:8000 --noreload
WM.sh
vi /opt/WebMonitor/WM.sh
#!/bin/bash str=$"/n" sstr=$(echo -e $str) nohup python3 /opt/WebMonitor/manage.py runserver 0.0.0.0:8000 --noreload >WebMonitor.log 2>&1 & echo "$sstr"
Esc + :wq
/etc/rc.d/rc.local
中执行开机自启动vi /etc/rc.d/rc.local
Esc + :wq
WebMonitor
网页监测系统了!接下来我们就可以愉快的使用它了!