部署OnlyOffice服务器在Ubuntu操作系统上需要按照以下步骤进行:
sudo apt update
sudo apt upgrade
sudo apt install docker.io docker-compose
sudo docker run --detach --name onlyoffice -p 80:80 onlyoffice/documentserver
安装Nginx:
sudo apt install nginx
创建Nginx配置文件:
sudo nano /etc/nginx/sites-available/onlyoffice
在配置文件中添加以下内容:
server {
listen 80;
server_name your-domain-name;
location / {
proxy_pass http://localhost:80;
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 X-Forwarded-Proto $scheme;
}
}
启用Nginx配置文件:
sudo ln -s /etc/nginx/sites-available/onlyoffice /etc/nginx/sites-enabled/
重新加载Nginx配置:
sudo systemctl reload nginx
sudo ufw allow 80/tcp
现在,您可以通过浏览器访问OnlyOffice服务器,输入您的域名或IP地址即可访问OnlyOffice文档处理服务。