Installing the up-to-date NGINX package version
To set up the yum repository for RHEL/CentOS, create the file named /etc/yum.repos.d/nginx.repo
with the following contents:
[nginx-stable]
name=nginx stable repo
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
gpgcheck=1
enabled=1
gpgkey=https://nginx.org/keys/nginx_signing.key
[nginx-mainline]
name=nginx mainline repo
baseurl=http://nginx.org/packages/mainline/centos/$releasever/$basearch/
gpgcheck=1
enabled=0
gpgkey=https://nginx.org/keys/nginx_signing.key
Official instruction
Install NGINX:
sudo yum install nginx
After that edit the /etc/nginx/nginx.conf
NGINX configuration file, so that it looked the following way:
user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
#gzip on;
include /etc/nginx/conf.d/*.conf;
}
Installing EPEL repository
sudo yum install epel-release
To install EPEL on CentOS 9, use the following commands:
sudo yum config-manager --set-enabled crb
sudo yum install epel-release epel-next-release
To install EPEL on RHEL, use the following commands:
sudo subscription-manager repos --enable codeready-builder-for-rhel-$REV-$(arch)-rpms
sudo yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-$REV.noarch.rpm
Change $REV to your OS version manually (7 for versions 7.x, 8 for versions 8.x, 9 for versions 9.x and so on).
Installing and configuring PostgreSQL
Install the PostgreSQL version included in your version of CentOS:
sudo yum install postgresql postgresql-server
Initialize the PostgreSQL database
sudo service postgresql initdb
sudo chkconfig postgresql on
On CentOS 9, chkconfig
is not installed by default. Install it using the following command:
sudo yum install chkconfig
Turn on the 'trust' authentication method for IPv4 and IPv6 localhost
Open the /var/lib/pgsql/data/pg_hba.conf
file in a text editor.
Find the host all all 127.0.0.1/32 ident
string and replace it with the following one:
host all all 127.0.0.1/32 trust
Then find the host all all ::1/128 ident
string and replace it with the following one:
host all all ::1/128 trust
Save the changes.
Restart the PostgreSQL service:
sudo service postgresql restart
Create the PostgreSQL database and user:
You can specify any user name and password.
First run the command
cd /tmp
to prevent the could not change directory to "/root"
warning if running from root. Then the database and the user must be created:
sudo -i -u postgres psql -c "CREATE USER onlyoffice WITH PASSWORD 'onlyoffice';"
sudo -i -u postgres psql -c "CREATE DATABASE onlyoffice OWNER onlyoffice;"
Installing Redis
Run the following command:
sudo rpm -ivh https://rpms.remirepo.net/enterprise/remi-release-$REV.rpm
Change $REV to your OS version manually (7 for versions 7.x, 8 for versions 8.x, 9 for versions 9.x and so on).
sudo yum -y install redis --enablerepo=remi
Start the redis service and enable start on boot:
sudo systemctl enable --now redis
Installing RabbitMQ
sudo curl -s https://packagecloud.io/install/repositories/rabbitmq/rabbitmq-server/script.rpm.sh | os=centos dist=$REV sudo bash
sudo curl -s https://packagecloud.io/install/repositories/rabbitmq/erlang/script.rpm.sh | os=centos dist=$REV sudo bash
Change $REV to your OS version manually (7 for versions 7.x, 8 for versions 8.x, 9 for versions 9.x and so on).
sudo yum install rabbitmq-server
Alternatively, you can install RabbitMQ on CentOS 8 or CentOS 9 from the official site.
Start the rabbitmq service and enable start on boot:
sudo systemctl enable --now rabbitmq-server
Adding the ONLYOFFICE Docs repository
Add the yum ONLYOFFICE Docs repository with the following command:
sudo yum install https://download.onlyoffice.com/repo/centos/main/noarch/onlyoffice-repo.noarch.rpm
Installing mscorefonts
Install the cabextract
and xorg-x11-font-utils
packages:
sudo yum install cabextract xorg-x11-font-utils
For CentOS 7.8(2003), fontconfig
is also required:
sudo yum install fontconfig
Install the msttcore fonts package:
sudo rpm -i https://sourceforge.net/projects/mscorefonts2/files/rpms/msttcore-fonts-installer-2.6-1.noarch.rpm