1.宝塔默认软件安装
1.1Nginx需要编译安装
默认版本没有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
1.2安装 Redis
1.3安装 PostgreSQL管理器
并安装 PgSQL,添加数据库 onlyoffice
1.4安装rabbitmq
修改/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
安装依赖软件
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开机启动
/bin/systemctl start supervisord.service sudo systemctl enable supervisord
设置RabbitMQ开机启动
/bin/systemctl start rabbitmq-server.service sudo systemctl enable rabbitmq-server
删除Nginx系统服务配置文件
安装onlyoffce时依赖安装,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
修改权限
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 systemctl start ds-example # 运行示例服务
sudo systemctl enable ds-example # 自启动
/etc/init.d/nginx restart #重启nginx
标签:宝塔,www,CentOS,--,安装,sudo,nginx,onlyoffice From: https://www.cnblogs.com/logan47537/p/17934796.html