Onlyoffice-v7.1.1 Docker启动后无法访问的解决方案

官方地址:https://helpcenter.onlyoffice.com/installation/docs-developer-install-docker.aspx
安装命令:

sudo docker run -i -t -d -p 80:80 --restart=always onlyoffice/documentserver-de
## 或者
sudo docker run -i -t -d -p 80:80 --restart=always \
    -v /app/onlyoffice/DocumentServer/logs:/var/log/onlyoffice  \
    -v /app/onlyoffice/DocumentServer/data:/var/www/onlyoffice/Data  \
    -v /app/onlyoffice/DocumentServer/lib:/var/lib/onlyoffice \
    -v /app/onlyoffice/DocumentServer/db:/var/lib/postgresql  onlyoffice/documentserver-de

但是很不幸,我这里这样启动的onlyoffice是无法访问的,通过日志查看原因:

 * Starting PostgreSQL 12 database server                                [ OK ]
 * Starting RabbitMQ Messaging Server rabbitmq-server                    [ OK ]
Starting redis-server: redis-server.
psql:/var/www/onlyoffice/documentserver/server/schema/postgresql/removetbl.sql:4: NOTICE:  table "doc_callbacks" does not exist, skipping
psql:/var/www/onlyoffice/documentserver/server/schema/postgresql/removetbl.sql:9: NOTICE:  function merge_db(pg_catalog.varchar,int2,int8,pg_catalog.timestamp,pg_catalog.varchar,int8,int8) does not exist, skipping
psql:/var/www/onlyoffice/documentserver/server/schema/postgresql/removetbl.sql:10: NOTICE:  function merge_db(pg_catalog.varchar,int2,int4,pg_catalog.timestamp,pg_catalog.varchar,int4,int4) does not exist, skipping
Starting supervisor: supervisord.
 * Starting periodic command scheduler cron                              [ OK ]
 * Starting nginx nginx                                                  [fail]
Generating AllFonts.js, please wait...Done
Generating presentation themes, please wait...Done
ds:docservice: stopped
ds:docservice: started
ds:converter: stopped
ds:converter: started
 * Reloading nginx configuration nginx                                   [fail]

可以看到,其他服务都还ok,就nginx起不来了,导致onlyoffice服务无法访问。
查看nignx的失败日志:

2022/05/30 06:14:12 [info] 885#885: Using 32768KiB of shared memory for nchan in /etc/nginx/nginx.conf:63
2022/07/22 03:56:32 [emerg] 992#992: open() "/etc/nginx/sites-enabled/default" failed (2: No such file or directory) in /etc/nginx/nginx.conf:62
2022/07/22 03:57:40 [emerg] 6630#6630: open() "/etc/nginx/sites-enabled/default" failed (2: No such file or directory) in /etc/nginx/nginx.conf:62

原来是onlyoffice里面的nginx.conf无法打开/etc/nginx/sites-enabled/default文件,查看下该文件的情况:

root@09617eafc726:/var/log/nginx# ll /etc/nginx/sites-enabled/
ls: cannot access '/etc/nginx/sites-enabled/default': No such file or directory
total 4
drwxr-xr-x. 1 root root 20 May 30 06:13 ./
drwxr-xr-x. 1 root root 23 Jul 22 03:56 ../
??????????? ? ?    ?     ?            ? default

不明所以,应该就是这些???导致default不能访问,我也不知道default里面是什么配置。所以我这里采用暴力的方式,直接通过docker挂载文件的方式把default给覆盖了试试:

docker run -idt -p 9001:80 --name=onlyoffice --privileged=true -v /app/onlyoffice/nginx/log:/var/log/nginx -v /app/onlyoffice/nginx/default:/etc/nginx/sites-enabled/default docker.io/onlyoffice/documentserver

然后,onlyoffcie里面的nginx果然就好了,并且onlyoffice服务也能访问了,目前没发现什么异常.文章来源地址https://uudwc.com/A/xkXeb

原文地址:https://blog.csdn.net/qq1049545450/article/details/125929377

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请联系站长进行投诉反馈,一经查实,立即删除!

h
上一篇 2023年07月26日 05:41
下一篇 2023年07月26日 05:41