Skip to content

Installing OpenVK on CentOS 8

This is an example guide made specifically for CentOS 8 that is based on @rem-pai's way to install OpenVK modified by WerySkok.


CentOS 8 is reaching it's end-of-life soon. There are other supported similar distributions like Rocky Linux or AlmaLinux.


🖥Run the command:


If it says SELinux status: enabled then SELinux will disturb us. Let's disable it.


I know that it's not most secured solution but I don't know any proper way that will work._

📝Edit file /etc/sysconfig/selinux and change the line SELinux=enforcing to SELinux=disabled, then 🔌reboot your machine. sestatus should tell SELinux status: disabled right now.


🖥Let's install EPEL and Remi repos for PHP 7.4:

dnf -y install epel-release
dnf -y install

🖥Then enable modules that we need:

dnf -y module enable php:remi-7.4
dnf -y module enable nodejs:14

🖥And install dependencies:

dnf -y install php php-cli php-common unzip php-zip php-yaml php-gd php-pdo_mysql nodejs git

🖥Don't forget about Yarn and Composer:

npm i -g yarn
php -r "copy('', 'composer-setup.php');"
php composer-setup.php --filename=composer2 --install-dir=/bin --snapshot
rm composer-setup.php


🖥We will use Percona Server for DB:

dnf -y install
percona-release setup -y ps80
dnf -y install percona-server-server percona-toolkit
systemctl start mysql

🖥And then look up for temporary password:

cat /var/log/mysqld.log | grep password

It should look like this:

2021-01-11T12:56:09.203991Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: >b?Q.fDXJ4fk

🖥Then run mysql_secure_installation, set new password and answer like this:

Change the password for root ? ((Press y|Y for Yes, any other key for No) : n
Remove anonymous users? (Press y|Y for Yes, any other key for No) : y
Disallow root login remotely? (Press y|Y for Yes, any other key for No) : y
Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y
Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y


Additionally, you can install ffmpeg for processing videos.

🖥You will need to use RPMFusion repo to install it:

dnf -y localinstall --nogpgcheck
dnf -y install --nogpgcheck

🖥Then install SDL2 and ffmpeg:

dnf -y install
dnf -y install ffmpeg

Chandler and OpenVK installation

🖥Install Chandler in /opt:

cd /opt
git clone
cd chandler/
composer2 install

🖥You will need a secret key. You can generate it using:

cat /dev/random | tr -dc 'a-z0-9' | fold -w 128 | head -n 1

📝Now edit config file chandler-example.yml like this:

    debug: true
    websiteUrl: null
    rootApp:    "openvk"

        appendExtension: "xhtml"
        adminUrl: "/chandlerd"
        exposeChandler: true

        dsn: "mysql:unix_socket=/var/lib/mysql/mysql.sock;dbname=db"
        user: "root"
        password: "DATABASE_PASSWORD"

        secret: "SECRET_KEY_HERE"
        csrfProtection: "permissive"
        sessionDuration: 14

🖥And rename it to chandler.yml:

mv chandler-example.yml chandler.yml

🖥Now let's install CommitCaptcha extension. It is mandatory for OpenVK.

cd extensions/available/
git clone
cd commitcaptcha/
composer2 install

🖥And now download OpenVK:

cd ..
git clone --recursive
cd openvk/
composer2 install
cd Web/static/js
yarn install

📝Now edit config file openvk-example.yml like this:

    debug: true
        name: "OpenVK"
        motd: "Yet another OpenVK instance"
        femaleGenderPriority: true
            disableLargeUploads: false
            mode: "basic"
                - "index.php"
            requireEmail: false
            requirePhone: false
            forcePhoneVerification: false
            forceEmailVerification: false
            enableSu: true
                actions: 5
                time: 20
                maxViolations: 50
                maxViolationsAge: 120
                autoban: true
            supportName: "Moderator"
            adminAccount: 1 # Change this ok
            strict: false
                maxSize: 60000
                processingLimit: 3000
                emojiProcessingLimit: 1000

            enable: false
            src: ""
            caption: "Ad caption"
            link: ""
            fartscroll: false
            testLabel: false
            enable: false
            client: ""
            secret: ""
            enable: true # Better enable this
                dsn: "mysql:unix_socket=/var/lib/mysql/mysql.sock;dbname=openvk_eventdb"
                user: "root"
                password: "DATABASE_PASSWORD"

Please note eventDB section because it's better to enable event database.

🖥And rename it to openvk.yml:

mv openvk-example.yml openvk.yml

🖥Then enable CommitCaptcha and OpenVK for Chandler:

ln -s /opt/chandler/extensions/available/commitcaptcha/ /opt/chandler/extensions/enabled/commitcaptcha
ln -s /opt/chandler/extensions/available/openvk/ /opt/chandler/extensions/enabled/openvk

DB configuration


It's better to create another user for SQL but I won't cover that.

🖥Enter MySQL shell:

mysql -p

🖥And create main and event databases:

CREATE DATABASE openvk;                                                                                          
CREATE DATABASE openvk_eventdb;

🖥Go to /opt/chandler:

cd /opt/chandler

📝We need to import Chandler database but for some reason it's not ready for use so we need to edit dump install/init-db.sql: 1. Remove PAGE_CHECKSUM=1 everywhere. 2. Replace Aria with InnoDB everywhere.

🖥Now database dump can be imported:

mysql -p'DATABASE_PASSWORD' openvk < install/init-db.sql

🖥Go to extensions/available/openvk/:

cd extensions/available/openvk/

📝We also need to import OpenVK database. Unless you use MariaDB (we are using Percona here) you should edit install/init-static-db.sql: 1. Replace utf8mb4_unicode_nopad_ci with utf8mb4_unicode_520_ci everywhere.

🖥Now database dump can be imported:

mysql -p'DATABASE_PASSWORD' openvk < install/init-static-db.sql

🖥Also import event database:

mysql -p'DATABASE_PASSWORD' openvk_eventdb < install/init-event-db.sql

Webserver configuration

Apache is already installed so we will use it.

🖥Make the user apache owner of the chandler folder:

cd /opt
chown -R apache: chandler/

📝Now let's create config file /etc/httpd/conf.d/10-openvk.conf:

<VirtualHost *:80>
    ServerName openvk.local
    DocumentRoot /opt/chandler/htdocs

    <Directory /opt/chandler/htdocs>
        AllowOverride All

        Require all granted

    ErrorLog /var/log/openvk/error.log
    CustomLog /var/log/openvk/access.log combinedio

📝Also enable rewrite_module by creating /etc/httpd/conf.modules.d/02-rewrite.conf:

LoadModule rewrite_module modules/

🖥Make directory for OpenVK logs and make the user apache owner of it:

mkdir /var/log/openvk
chown apache: /var/log/openvk/

🖥Make the firewall exception for port 80:

firewall-cmd --permanent --add-port=80/tcp
firewall-cmd --reload

🖥And start Apache:

systemctl start httpd

OpenVK should work right now!

Also you can raise 2MB the file limit through editing /etc/php.ini. And it's also better to install PHPMyAdmin but I won't cover that.

Last update: 2023-11-17