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
module_hotfixes=true
Install NGINX:
sudo yum install nginx
Remove the following file:
sudo rm /etc/nginx/conf.d/default.conf
Official instruction
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 (8 for versions 8.x, 9 for versions 9.x and so on).
Initialize the PostgreSQL database
sudo service postgresql initdb
sudo chkconfig postgresql on
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 (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 | sudo bash
ERLANG_LATEST_VERSION=$(curl -s https://api.github.com/repos/rabbitmq/erlang-rpm/releases | sed -n 's/.*"tag_name":\s*"v\([^"]*\)".*/\1/p' | head -1)
sudo rpm -ivh https://github.com/rabbitmq/erlang-rpm/releases/latest/download/erlang-${ERLANG_LATEST_VERSION}-1.el${REV}.aarch64.rpm
Change $REV to your OS version manually (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