当前位置:网站首页>latex论文神器--服务器部署overleaf
latex论文神器--服务器部署overleaf
2022-08-01 19:41:00 【TOMD】
Overleaf是一个使用LaTeX进行多人协同编辑的平台,可以免费注册和使用,不用下载LaTeX软件,是最为著名的LaTeX在线协作系统。
而在有些情况下,考虑到数据安全以及操作方便性,可以购买服务器自行搭建Overleaf平台。
没有服务器的同学可以点此链接购买便宜的腾讯云服务器。
1.基本环境配置
安装Docker:
sudo curl -sSL https://get.daocloud.io/docker | sh
查看版本,检查是否安装成功:
docker --version
docker-compose --version
启动Docker:
systemctl start docker
2.运行容器
2.1安装overleaf
首先将overleaf项目从github拉至本地
git clone https://github.com/overleaf/toolkit.git ./overleaf
然后进行初始化配置
cd ./overleaf
bin/init
这里我们进入config下的overleaf.rc文件进行配置:
vim ./config/overleaf.rc
更改如下两行:
SHARELATEX_LISTEN_IP=如果本地使用按照原配置即可,腾讯云服务器需要改为**内网地址**
SHARELATEX_PORT=想映射的端口,默认的80端口常常被占用
(注意,映射的端口需要在腾讯云防火墙和centos内部的防火墙中均被开放)
其中还有许多个性化的配置:如网页抬头文字内容,网址标题,UI语言(中文)等,可以在overleaf的Wiki页面中进行查看和配置。
执行容器:bin/up
。
此时正在拉取镜像,可以等出现大量的log时使用 ctrl+c 停止,然后执行bin/start
即可。
此时用浏览器打开http://公网IP:映射的端口/launchpad
应该能看到管理员注册界面,至此overleaf的安装结束。
2.2下载完整texlive包
以上安装的overleaf配套的LaTeX不是完整版,所以需要继续下载。
首先进入容器的bash:
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
# 更换texlive的下载源
tlmgr option repository https://mirrors.sustech.edu.cn/CTAN/systems/texlive/tlnet/
# 升级tlmgr
tlmgr update --self --all
# 安装完整版texlive(时间比较长,不要让shell断开)
tlmgr install scheme-full
# 退出sharelatex的命令行界面,并重启sharelatex容器
exit
docker restart sharelatex
至此,安装完成。
2.3 配置反向代理【可选】
如果想要使用域名ssl访问,或者改变访问端口,可能需要反向代理。
宝塔可能要修改反向配置文件为下面内容,如果直接默认的话,每次加载项目文档会卡卡的,甚至提示XXX加载错误
#PROXY-START/
location ~* \.(php|jsp|cgi|asp|aspx)$
{
proxy_pass http://127.0.0.1:5200;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header REMOTE-HOST $remote_addr;
}
location /
{
proxy_pass http://127.0.0.1:5200;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header REMOTE-HOST $remote_addr;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'Upgrade';
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_read_timeout 3m;
proxy_send_timeout 3m;
add_header X-Cache $upstream_cache_status;
#Set Nginx Cache
proxy_ignore_headers Set-Cookie Cache-Control expires;
add_header Cache-Control no-cache;
expires 12h;
}
#PROXY-END/
以上内容部分参考:
边栏推荐
猜你喜欢
Keras deep learning practice - traffic sign recognition
智能硬件开发怎么做?机智云全套自助式开发工具助力高效开发
Mobile Zero of Likou Brush Questions
如何记录分析你的炼丹流程—可视化神器Wandb使用笔记【1】
网络不通?服务丢包?这篇 TCP 连接状态详解及故障排查,收好了~
How PROE/Croe edits a completed sketch and brings it back to sketching state
【kali-信息收集】(1.6)服务的指纹识别:Nmap、Amap
58: Chapter 5: Develop admin management services: 11: Develop [admin face login, interface]; (not measured) (using Ali AI face recognition) (demonstrated, using RestTemplate to implement interface cal
使用常见问题解答软件的好处有哪些?
MySQL开发技巧——并发控制
随机推荐
Shell script topic (07): file from cfs to bos
Combining two ordered arrays
百度无人驾驶商业化已“上路”
【kali-信息收集】(1.5)系统指纹识别:Nmap、p0f
Creo5.0 rough hexagon is how to draw
手撸代码,Redis发布订阅机制实现
随时随地写代码--基于Code-server部署自己的云开发环境
Ruijie switch basic configuration
终于有人把AB实验讲明白了
10 个 PHP 代码安全漏洞扫描程序
OSPO 五阶段成熟度模型解析
MySQL开发技巧——存储过程
What should I do if the Win11 campus network cannot be connected?Win11 can't connect to campus network solution
【kali-信息收集】(1.4)识别活跃的主机/查看打开的端口:Nmap(网络映射器工具)
力扣刷题之移动零
短视频软件开发,Android开发,使用Kotlin实现WebView
Database Plus 的云上之旅:SphereEx 正式开源 ShardingSphere on Cloud 解决方案
DAO开发教程【WEB3.0】
分享一个适用于MCU项目的代码框架
ThreadLocal讲义