CentOS 宝塔7.9.0 安装 onlyoffice

发布于:2023-04-27 ⋅ 阅读:(1153) ⋅ 点赞:(0)

目录

1、宝塔默认软件安装和注意事项

Nginx 1.21.4

Redis 6.2.6

PostgreSql管理器

修改/etc/yum.conf

2、安装onlyoffce

参考官网

安装依赖软件

安装onlyoffce

设置supervisord开机启动

设置RabbitMQ开机启动

删除Nginx系统服务配置文件

设置onlyoffce

修改权限

设置Nginx

开放9090端口方便局域网访问

重启服务

访问示例:  


1、宝塔默认软件安装和注意事项

Nginx 1.21.4

Nginx需要编译安装 

默认版本没有http_secure_link_module 所以需要重新编译安装一遍

cd /www/server/nginx/src

./configure \
--user=www \
--group=www \
--prefix=/www/server/nginx \
--with-http_secure_link_module \
--with-http_ssl_module \
--with-http_stub_status_module \
--with-http_realip_module \
--with-stream \
--with-threads

make && make install

Redis 6.2.6

PostgreSql管理器

 安装postgresql 14.2 添加数据库 onlyoffice

修改/etc/yum.conf

由于宝塔排除了nginx

找到exclude=行删除nginx,否则安装onlyoffice-documentserver时会提示没有安装nginx

2、安装onlyoffce

参考官网

https://helpcenter.onlyoffice.com/installation/docs-community-install-centos.aspx?_ga=2.20962040.1995720888.1647591452-1314819513.1646308835&_gac=1.223747689.1647592164.Cj0KCQjw29CRBhCUARIsAOboZbJC-JChzQP1SmEfHo4jhRJzhhocMdufPsnRIql9YrOJxeOgXznt-Q8aArHqEALw_wcBhttps://helpcenter.onlyoffice.com/installation/docs-community-install-centos.aspx?_ga=2.20962040.1995720888.1647591452-1314819513.1646308835&_gac=1.223747689.1647592164.Cj0KCQjw29CRBhCUARIsAOboZbJC-JChzQP1SmEfHo4jhRJzhhocMdufPsnRIql9YrOJxeOgXznt-Q8aArHqEALw_wcB

安装依赖软件

sudo yum install -y epel-release postgresql rabbitmq-server cabextract xorg-x11-font-utils fontconfig
sudo rpm -i https://deac-ams.dl.sourceforge.net/project/mscorefonts2/rpms/msttcore-fonts-installer-2.6-1.noarch.rpm

安装onlyoffce

sudo yum install -y https://download.onlyoffice.com/repo/centos/main/noarch/onlyoffice-repo.noarch.rpm
sudo yum install -y onlyoffice-documentserver

设置supervisord开机启动

sudo service supervisord start
sudo systemctl enable supervisord

设置RabbitMQ开机启动

sudo service rabbitmq-server start
sudo systemctl enable rabbitmq-server

删除Nginx系统服务配置文件

安装onlyoffce时依赖安装,Nginx还是用宝塔的版本,有试过systemctl disable Nginx禁用服务,不过会和宝塔有冲突导致服务不正常,这里直接删除服务文件。

rm -f /usr/lib/systemd/system/nginx.service 

设置onlyoffce

onlyoffce默认端口可以看需要修改

export DS_PORT=9090
bash documentserver-configure.sh

 PostgreSQL:
Host: localhost
Database: onlyoffice
User: onlyoffice
Password: onlyoffice

RabbitMQ:
Host: localhost
User: guest
Password: guest

这里的nginx报错不用理会  

修改权限

chown -R www:www /var/lib/onlyoffice
sudo usermod -a -G www ds
chmod -R 775 /var/lib/onlyoffice

chown -R www:www /etc/onlyoffice/documentserver/nginx
chown -R www:www /etc/onlyoffice/documentserver-example/nginx
chown -R www:www /etc/nginx
chown -R www:www /var/www

设置Nginx

添加 include /etc/nginx/conf.d/*.conf;

开放9090端口方便局域网访问

重启服务

sudo service supervisord restart
sudo supervisorctl start ds:example   # 远行示例服务
/etc/init.d/nginx restart

访问示例:  

http://localhost:9090/ 

本文含有隐藏内容,请 开通VIP 后查看