Create a Tumblr parser using VPS

888u

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 -y

Install pip

wget https://bootstrap.pypa.io/get-pip.py && python get-pip.py

Turn off the firewall

systemctl stop firewalld.service; systemctl disable firewalld.service

Or open port 5000

firewall-cmd --add-port=5000/tcp --permanent

2. 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-server

2. Reset mysql password and set permissions first

chown -R root:root /var/lib/mysql service mysqld restart

Reset 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 restart

Create 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 grequests

4. 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:app

Use 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 ,

Create a Tumblr parser using VPS

All copyrights belong to 888u unless special state
取消
微信二维码
微信二维码
支付宝二维码