Last update at :2024-05-07,Edit by888u
This article was successful under Centos 7.
1. Install necessary components to install git
yum install -y git yum install screen wget unzip gcc gcc-c++ python-devel -yInstall pip
wget https://bootstrap.pypa.io/get-pip.py && python get-pip.pyTurn off the firewall
systemctl stop firewalld.service; systemctl disable firewalld.serviceOr open port 5000
firewall-cmd --add-port=5000/tcp --permanent2. Install Mysql 5.61, download the source and install
wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm rpm -ivh mysql-community-release-el7-5.noarch.rpm yum install mysql-server2. Reset mysql password and set permissions first
chown -R root:root /var/lib/mysql service mysqld restartReset password
mysql -u root //Press enter directly to enter the mysql console mysql > use mysql; mysql > update user set password=password('123456') where user='root'; mysql > exit;Restart the database
service mysqld restartCreate database
mysql -uroot -p mysql > create database tumblr;3. Obtain source code and install dependent libraries
git clone https://github.com/tangrela/tumblr_clawer or wget https://us.com/wp-content/uploads/2017/09/tumblr_clawer.zip unzip tumblr_clawer.zip cd tumblr_clawer pip install -r requirement.txt pip install grequests4. Modify the configuration file to support Mysql. Modify config.py: comment the sixth line –> remove the # at the beginning of the fifth line and modify user, passwd, ‘database’
5. Operation
python rebuildDB.py gunicorn -w4 -b 0.0.0.0:5000 run:appUse IP:5000 to access
6. Add auto-start
1. Modify supervisord.conf and change the directory to the script root directory 2. echo "supervisord -c website root directory/supervisord.conf" >> /etc/rc.d/rc.local3, chmod +x /etc /rc.d/rc.local
7. nginx configuration
Mainly modify the root directory to the tumblr_clawer/app/static directory. You can also reverse it and use SSL.
via: https://github.com/tangrela/tumblr_clawer
Recommended site search: Korean independent server, US server, how much does server defense cost, Hong Kong cloud host, registered domain name, dual line dual IP, Zhenjiang high defense server, registration-free cdn acceleration, multi-IP station group server, IP online query ,
发表评论