Misdirected Request The client needs a new connection for this request as the requested host name does not match the Server Name Indication (SNI) in use for this connection.

Cause In recent Apache version, Apache team has released fixes for CVEs that affected Apache + nginx functionality: new changes do not allow Apache process requests from nginx without the server name (by default, nginx does not pass the server name through SNI when establishing a connection with a proxied HTTPS server). Plesk team is… Continue reading Misdirected Request The client needs a new connection for this request as the requested host name does not match the Server Name Indication (SNI) in use for this connection.

Schema Extension in Payload

This hook runs before the schema is built. You can use it to extend your database structure with tables that won’t be managed by Payload. import { postgresAdapter } from ‘@payloadcms/db-postgres’ import { integer, pgTable, serial } from ‘@payloadcms/db-postgres/drizzle/pg-core’ postgresAdapter({ beforeSchemaInit: [ ({ schema, adapter }) => { return { …schema, tables: { …schema.tables, addedTable:… Continue reading Schema Extension in Payload

Access plesk postgres Database using SSH thunnel

Modify postgresql.conf: 1. Open the file /var/lib/pgsql/data/postgresql.conf in a text editor Add the following line at the end of the file: listen_addresses = ‘*’ Save the changes and close the file. Modify pg_hba.conf: Open the file /var/lib/pgsql/data/pg_hba.conf in a text editor Add the following line at the end of the file: host same role all 203.0.113.2/32 md5 203.0.113.2/32… Continue reading Access plesk postgres Database using SSH thunnel

Schema Creation for the enitre work Flow

When designing a schema for employees based on roles, the goal is to establish a flexible structure that dynamically manages permissions. Here’s how we achieve this: Create a Roles Table The Roles table defines different roles within the system (e.g., Admin, Manager, Employee). Columns: role_id (Primary Key): Unique identifier for each role. role_name: Name of… Continue reading Schema Creation for the enitre work Flow

Creating a PostgreSQL database on a server terminal

Access the PostgreSQL Terminal Log in to the PostgreSQL command-line interface using the following command: sudo -u postgres psql This assumes you’re logged in as a user with sudo privileges and postgres is the PostgreSQL administrative user. Create a Database In the psql terminal, run: CREATE DATABASE database_name; Verify the Database Creation You can list… Continue reading Creating a PostgreSQL database on a server terminal

Payload Startup File for the Plesk Panel

Here is the startup file which can be used for the startup file import express from ‘express’ import payload from ‘payload’ import path from ‘path’ import nodemailerSendgrid from ‘nodemailer-sendgrid’ const sendGridAPIKey = process.env.SENDGRIDAPI_KEY require(‘dotenv’).config({ path: path.resolve(__dirname, ‘../.env’), }) const app = express() const PORT = process.env.PORT || 8000 // Redirect root to Admin panel app.get(‘/’,… Continue reading Payload Startup File for the Plesk Panel

Postgress Database Configration on Plesk

Firstly need to install a PostgreSQL on the server After that need to Configure the DB with the username and password from the local server If it is a server need to configure the db with SSD access from the server. Once the configuration is done the DB will be connected to the server and… Continue reading Postgress Database Configration on Plesk

Hosting of the Payload web application

in order to run the payload application on the server we need to configure the startup file with following code This code can be used for normal hosting platforms // Ensure that the ‘payload.config.js’ is in the correct directory const payloadConfig = require(‘./dist/payload/payload.config.js’); // Start the server const app = require(‘./dist/server.js’); // Check if server.js… Continue reading Hosting of the Payload web application

Plesk User permission

1. Set Ownership to Root Change the ownership of /var/log/plesk and its contents to root:root: bash Copy code sudo chown -R root:root /var/log/plesk 2. Set Permissions Set appropriate permissions for directories and files. Generally, directories should have 755 permissions and files should have 644. Set Permissions for Directories bash Copy code sudo find /var/log/plesk -type… Continue reading Plesk User permission