1. 本地部署ShareLatex 本地部署ShareLatex
假设从裸机Ubuntu开始
2. Docker安装
docker
docker-compose
官网链接:
docker docker-compose
1 2 3 4 5 6 7 8 9 10 11 mkdir dockercd dockercurl -fsSL https://get.docker.com -o get-docker.sh sudo sh get-docker.sh sudo gpasswd -a $USER docker newgrp docker sudo service docker restart sudo curl -L "https://github.com/docker/compose/releases/download/1.25.0/docker-compose-$(uname -s) -$(uname -m) " -o /usr/local/bin/docker-compose sudo chmod +x /usr/local/bin/docker-compose
3. 安装并配置ShareLatex ShareLatex
3.1 拉取最新的 ShareLatex 镜像 1 docker pull sharelatex/sharelatex
3.2 下载docker-compose.yml文件,并进行配置 1 2 3 4 mkdir -p ~/sharelatexcd ~/sharelatex wget https://raw.githubusercontent.com/sharelatex/sharelatex/master/docker-compose.yml sudo vim docker-compose.yml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 ports: - 5000:80 volumes: - /home/docker/sharelatex:/var/lib/sharelatex environment: SHARELATEX_SITE_URL: http://xxx.xxx.xxx.xxx:5000/ SHARELATEX_EMAIL_FROM_ADDRESS: xxx@xxxx SHARELATEX_APP_NAME: Our ShareLaTeX SHARELATEX_NAV_TITLE: Our ShareLaTeX Instance SHARELATEX_LEFT_FOOTER: '[{"text": "Powered by <a href="https://www.sharelatex.com">ShareLaTeX</a> 2016"},{"text": "Another page I want to link to can be found <a href="here">here</a>"} ]' SHARELATEX_RIGHT_FOOTER: '[{"text": "Hello I am on the Right"} ]' volumes: - /home/docker/mongo_data:/data/db volumes: - /home/docker/redis_data:/data
3.3 创建并运行ShareLaTeX容器,启动后不要着急进入网站
3.4 升级并安装完整版texlive 非完整版的texlive不支持识别.ins文件,只能识别.cls文件
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 $ docker exec -it sharelatex bash $ cd /usr/local/texlive $ wget http://mirror.ctan.org/systems/texlive/tlnet/update-tlmgr-latest.sh $ sh update-tlmgr-latest.sh -- --upgrade $ tlmgr option repository https://mirrors.tuna.tsinghua.edu.cn/CTAN/systems/texlive/tlnet/ $ tlmgr update --self --all $ tlmgr install scheme-full $ exit $ docker restart sharelatex
3.5 取消 recaptcha 2020-01-15,这一版的sharelatex没有使用最新的web,所以默认开启 recaptcha,需要手动取消。
1 2 3 4 5 6 7 8 9 10 docker exec -it sharelatex bash vim /var/www/sharelatex/web/config/settings.defaults.coffee 472 473 474 475 exit docker restart sharelatex
3.6 使用ShareLatex 设置 admin user:进入浏览器访问 http://localhost:5000/launchpad 或者
1 docker exec sharelatex /bin/bash -c "cd /var/www/sharelatex; grunt user:create-admin --email=joe@example.com"
其他用户 http://localhost:5000
在浏览器中编译时发现没有.cls文件无法编译
3.7 如果安装中出错,则删除容器重新安装 1 2 3 4 docker ps docker rm -f 容器ID docker rm -f $(docker ps -q)
4. 参考链接 https://www.dazhuanlan.com/2019/10/16/5da6231405e85/ 本地部署 ShareLatex