官方地址: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给覆盖了试试:文章来源:https://www.toymoban.com/news/detail-603450.html
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://www.toymoban.com/news/detail-603450.html
到了这里,关于Onlyoffice-v7.1.1 Docker启动后无法访问的解决方案的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!