官方编译文档
安装ubuntu18镜像虚拟机
sudo apt-get install -y python git
sudo apt install net-tools
sudo vim /etc/profile
# 添加如下内容
export HTTP_PROXY=http://127.0.0.1:9910
export HTTPS_PROXY=http://127.0.0.1:9910
source /etc/profile
# 添加
sudo npm config set proxy http://127.0.0.1:9910
sudo npm config set https-proxy http://127.0.0.1:9910
sudo npm config set registry https://registry.npmjs.org/
# 移除
sudo npm config delete proxy
sudo npm config delete https-proxy
# 克隆仓库
git clone https://github.com/ONLYOFFICE/build_tools.git
# 执行安装脚本
cd build_tools/tools/linux
./automate.py server
应该不会有什么大问题
如果出现安装包下载失败,就应该是代理问题
重新编译出现问题,一般可以清空对应目录重新执行编译
最后,编译成功(历时两天)
sudo apt-get install -y nginx
# 删除默认站点配置
sudo rm -f /etc/nginx/sites-enabled/default
# 创建新的配置文件,添加如下内容
sudo vim /etc/nginx/sites-available/onlyoffice-documentserver
文件内容
map $http_host $this_host {
"" $host;
default $http_host;
}
map $http_x_forwarded_proto $the_scheme {
default $http_x_forwarded_proto;
"" $scheme;
}
map $http_x_forwarded_host $the_host {
default $http_x_forwarded_host;
"" $this_host;
}
map $http_upgrade $proxy_connection {
default upgrade;
"" close;
}
proxy_set_header Host $http_host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $proxy_connection;
proxy_set_header X-Forwarded-Host $the_host;
proxy_set_header X-Forwarded-Proto $the_scheme;
server {
listen 0.0.0.0:80;
listen [::]:80 default_server;
server_tokens off;
rewrite ^\/OfficeWeb(\/apps\/.*)$ /web-apps$1 redirect;
location / {
proxy_pass http://localhost:8000;
proxy_http_version 1.1;
}
location /spellchecker/ {
proxy_pass http://localhost:8080/;
proxy_http_version 1.1;
}
}
# 创建软连接
sudo ln -s \
/etc/nginx/sites-available/onlyoffice-documentserver \
/etc/nginx/sites-enabled/onlyoffice-documentserver
sudo nginx -s reload
# 查看启动结果
sudo netstat -nlp | grep 80
sudo ps -ef | grep nginx
sudo apt-get install -y postgresql
sudo -i -u postgres psql -c "CREATE DATABASE onlyoffice;"
sudo -i -u postgres psql -c "CREATE USER onlyoffice WITH password 'onlyoffice';"
sudo -i -u postgres psql -c "GRANT ALL privileges ON DATABASE onlyoffice TO onlyoffice;"
# 在根目录执行
cd
# 创建数据库
psql -hlocalhost -Uonlyoffice -d onlyoffice -f \
build_tools/out/linux_64/onlyoffice/documentserver/server/schema/postgresql/createdb.sql
# 输入密码: onlyoffice
sudo apt-get install -y rabbitmq-server
cd
cd build_tools/out/linux_64/onlyoffice/documentserver/
mkdir fonts
LD_LIBRARY_PATH=${PWD}/server/FileConverter/bin server/tools/allfontsgen \
--input="${PWD}/core-fonts" \
--allfonts-web="${PWD}/sdkjs/common/AllFonts.js" \
--allfonts="${PWD}/server/FileConverter/bin/AllFonts.js" \
--images="${PWD}/sdkjs/common/Images" \
--selection="${PWD}/server/FileConverter/bin/font_selection.bin" \
--output-web='fonts' \
--use-system="true"
cd
cd build_tools/out/linux_64/onlyoffice/documentserver/
LD_LIBRARY_PATH=${PWD}/server/FileConverter/bin server/tools/allthemesgen \
--converter-dir="${PWD}/server/FileConverter/bin"\
--src="${PWD}/sdkjs/slide/themes"\
--output="${PWD}/sdkjs/common/Images"
前台启动
cd
cd build_tools/out/linux_64/onlyoffice/documentserver/server/FileConverter
LD_LIBRARY_PATH=$PWD/bin NODE_ENV=development-linux NODE_CONFIG_DIR=$PWD/../Common/config ./converter
cd
cd build_tools/out/linux_64/onlyoffice/documentserver/server/SpellChecker
NODE_ENV=development-linux NODE_CONFIG_DIR=$PWD/../Common/config ./spellchecker
cd
cd build_tools/out/linux_64/onlyoffice/documentserver/server/DocService
NODE_ENV=development-linux NODE_CONFIG_DIR=$PWD/../Common/config ./docservice
https://api.onlyoffice.com/editors/try