Vajra Support Wordpress How it work

Started by Admin • 2 hours ago

← Back to Forum
A
Admin 2 hours ago
How I can install Wordpress With Vajra? Guide ?
A
Admin 2 hours ago
Here is the complete, step-by-step guide to installing WordPress on a VPS using the Vajra Web Server.

Vajra is perfect for WordPress because it handles FastCGI caching natively, making your site blazing fast.

### Step 1: Install Required Packages
First, update your server and install PHP-FPM, MariaDB, and required PHP extensions.
sudo apt update && sudo apt upgrade -y
sudo apt install php8.3-fpm php8.3-mysql php8.3-curl php8.3-xml php8.3-mbstring mariadb-server unzip wget -y

### Step 2: Setup MariaDB Database
Login to MariaDB and create a database and user for WordPress.
sudo mariadb
CREATE DATABASE wp_vajra_db;
CREATE USER 'wp_user'@'localhost' IDENTIFIED BY 'StrongPassword123!';
GRANT ALL PRIVILEGES ON wp_vajra_db. TO 'wp_user'@'localhost';
FLUSH PRIVILEGES;
EXIT;

### Step 3: Download and Configure Vajra
Download the latest Vajra binary from GitHub and place it in the bin directory.
wget https://github.com/sugan0927/vajra-server/releases/latest/download/vajra-v0.15.15-linux-x86_64.tar.gz
tar -xzf vajra-v0.15.15-linux-x86_64.tar.gz
sudo cp vajra-v0.15.15-linux-x86_64/vajra /usr/local/bin/vajra
sudo chmod +x /usr/local/bin/vajra

### Step 4: Create the Vajra Configuration
Create the directory for Vajra config and your website files.
sudo mkdir -p /etc/vajra /var/www/wordpress
Create the /etc/vajra/app.toml file and add your site configuration. Pay attention to the php_sock path, which must match your PHP-FPM version.
[[site]]
host = "yourdomain.com"
root = "/var/www/wordpress"
index = "index.php"
mode = "wordpress"
php_sock = "unix:/run/php/php8.3-fpm.sock"

### Step 5: Download WordPress
Download WordPress and set the correct permissions.
cd /tmp
wget https://wordpress.org/latest.tar.gz
tar -xzf latest.tar.gz
sudo mv wordpress/
/var/www/wordpress/
sudo chown -R www-data:www-data /var/www/wordpress/
sudo chmod -R 755 /var/www/wordpress/

### Step 6: Run Vajra and Complete Installation
Start Vajra using the configuration file.
sudo vajra --config /etc/vajra/app.toml
Now, open your browser and go to https://yourdomain.com. You will see the WordPress setup screen. Enter the database details we created in Step 2, and you are good to go!

Pro Tip: To ensure Vajra starts on boot, set it up as a systemd service (vajra.service).