ONLYOFFICE Docs uses NGINX
as a web server and PostgreSQL
as a database. RabbitMQ
is also required for ONLYOFFICE Docs to work correctly.
Installing and configuring NGINX
- Install NGINX:
sudo apt-get install nginx
- Disable the default website:
sudo rm -f /etc/nginx/sites-enabled/default
- Now you need to set up the new website. To do that create the
/etc/nginx/sites-available/onlyoffice-documentserver
file with the following contents:
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;
}
}
- Add the symlink to the newly created website to the
/etc/nginx/sites-available
directory:
sudo ln -s /etc/nginx/sites-available/onlyoffice-documentserver /etc/nginx/sites-enabled/onlyoffice-documentserver
- And restart NGINX to apply the changes:
sudo nginx -s reload
Installing and configuring PostgreSQL
Install PostgreSQL using the following command:
sudo apt-get install postgresql
Once PostgreSQL is installed, run the following commands to create the PostgreSQL database and user:
The created database must have onlyoffice both for user and password.
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;"
Run the following command to configure the database:
psql -hlocalhost -Uonlyoffice -d onlyoffice -f ../../out/linux_64/onlyoffice/documentserver/server/schema/postgresql/createdb.sql
Upon that, you will be asked to provide a password for the onlyoffice
PostgreSQL user. Please enter the onlyoffice
password.
Installing RabbitMQ
Install RabbitMQ using the following command:
sudo apt-get install rabbitmq-server
Generate fonts data
cd 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"
Generate presentation themes
cd 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"