screenshot
install
#Installing Python 3.6 wget https://www.moerats.com/usr/shell/Python3/CentOS_Python3.6.sh && sh CentOS_Python3.6.sh #Install prerequisites, libraries pip3 install django pymysql pillow
#Install MySQL 5.6 wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm rpm -ivh mysql-community-release-el7-5.noarch.rpm yum install mysql-server -y #Set permissions chown -R root:root /var/lib/mysql service mysqld restart #Reset the MySQL password. 123456 is the password, which can be modified by yourself MySQL - u root//Enter the MySQL console directly mysql > use mysql; mysql > update user set password=password('123456') where user='root'; mysql > exit; #Restart the database service mysqld restart #Create a zhuye database with mypassword as the database password mysql -uroot -pmypassword mysql > create database zhuye; mysql > exit;
yum install git screen -y git clone https://github.com/wenguonideshou/zhuye_kim cd zhuye_kim/zhuye_kim
vi settings.py
#View the settings.py file cat /root/zhuye_kim/zhuye_kim/settings.py #Find the database password, that is, the value corresponding to PASSWORD 'PASSWORD': '6f81f112dbe1efc4' #Use the sed command to change the password. Remember to change the previous value. Passwd is the database password sed -i 's/6f81f112dbe1efc4/passwd/g' '/root/zhuye_kim/zhuye_kim/settings.py'
cd /root/zhuye_kim python3 manage.py makemigrations python3 manage.py migrate
#Enter the MySQL database console. Mypassword is the database password mysql -u root -pmypassword #Using the ABCD database mysql > use zhuye #Use the source command to import the database file, followed by the file path mysql > source /root/zhuye_kim/zhuye.sql #Exit mysql > exit;
screen -S zhuye Python3 manage.py runserver 0.0.0.0:80 # The last port is port 80, which can also be modified to other ports
#If you can't open the page using other ports, you need to open the firewall port, such as port 8080 #Centos 6 system iptables -I INPUT -p tcp --dport 8080 -j ACCEPT service iptables save service iptables restart #CentOS 7 system firewall-cmd --zone=public --add-port=8080/tcp --permanent firewall-cmd --reload
Domain Name Settings
wget -N --no-check-certificate https://raw.githubusercontent.com/iiiiiii1/doubi/master/caddy_install.sh && chmod +x caddy_install.sh && bash caddy_install.sh #Alternate address wget -N --no-check-certificate https://www.moerats.com/usr/shell/Caddy/caddy_install.sh && chmod +x caddy_install.sh && bash caddy_install.sh
#The following contents are a whole. After the domain name, IP, port and mailbox are modified, they are copied to SSH to run! echo "www.moerats.com { gzip tls admin@moerats.com proxy / 1.1.1.1:8080 }" > /usr/local/caddy/Caddyfile
/etc/init.d/caddy start
Copyright notice: This is an original article, and the copyright belongs to Rat's Blog All, please indicate the source for reprinting!
Link to this article: https://www.moerats.com/archives/679/
If the tutorial needs to be updated, or 404 appears on the related link, you can leave a comment below the article.