Read The Docs搭建

时间:2023-03-09 15:28:30
Read The Docs搭建
#!/bin/sh

########################### base ######################
yum -y update
yum -y install yum-utils
yum groupinstall development ################## install python 3.6 #####################
# install IUM repository
yum -y install https://centos7.iuscommunity.org/ius-release.rpm
yum -y install python36u
python3.6 -V # Next up, is pip to manage Python packages, and some development packages.
yum -y install python36u-pip
yum -y install python36u-devel
#yum -y install python-devel python-pip libxml2-devel libxslt-devel ############### install virtualenv ######################
pip3.6 install virtualenv ############### install git ################################
## Requires Git version >=2
yum -y install curl-devel expat-devel gettext-devel openssl-devel zlib-devel
yum -y install gcc perl-ExtUtils-MakeMaker
cd /usr/src
wget https://www.kernel.org/pub/software/scm/git/git-2.18.0.tar.gz
tar xzf git-2.18.0.tar.gz
cd git-2.18.0
make prefix=/usr/local/git all
make prefix=/usr/local/git install
echo "export PATH=/usr/local/git/bin:$PATH" >> /etc/bashrc
source /etc/bashrc
git --version git config --global user.name "liulin"
git config --global user.email "liulin_sssppp@163.com"
git config --list ############### create a virtual environment,and activate it ###############
mkdir -p /home/liulin/readthedocs
cd /home/liulin/readthedocs virtualenv rtd
cd rtd
source bin/activate ################ Create a folder, and clone readthedocs repository #############
mkdir checkouts
cd checkouts
git clone https://github.com/rtfd/readthedocs.org.git ######### install the dependencies using pip (included inside of virtualenv)#########
## this may take a wile
cd readthedocs.org
pip install -r requirements.txt ## build your database
python manage.py migrate ## create a superuser account for Django: admin/qaz
python manage.py createsuperuser ## load in a couple users and a test project
python manage.py loaddata test_data ## start the webserver
python manage.py runserver ip:8000 curl http://127.0.0.1:8000/
curl http://127.0.0.1:8000/admin ################### How to start when reboot################################
# cd /home/liulin/readthedocs/rtd
# source bin/activate
#
# cd /home/liulin/readthedocs/rtd/checkouts/readthedocs.org
# python manage.py runserver
#############################################################################
#
##################### Question ########################
# 1. curl http://127.0.0.1:8000 可以访问,但是 curl ip:8000无法访问
# 解决:https://docs.readthedocs.io/en/latest/custom_installs/local_rtd_vm.html
#
# 2. 如何后台启动
############################################################