Server Setup
Requirements:
- Server CentOS9
- Minimum 500 GB hard drive
- 8 GB RAM
API's Require:
- Digio PAN Verification
- Digio ADDHAR SIGN
- Digio IFSC Verification
- Digio Bank Account Verification
- Google Map's Geocoding API
- SMS API Credentials
- EMAIL Server Credentials
- KRA/CVL
- Razor Pay
Company Logo Require:
- .PNG format 186x32
- .SVG format 186x32
- favicon.ico 16x16
Server Setup
1) Here’s a step-by-step guide to installing Node.js on CentOS 9:
Step 1: Update the System
Start by updating the system to ensure all packages are up-to-date.
sudo dnf update -y
Step 2: Add Node.js Repository
Node.js provides its official repository for different versions. To add the Node.js repository:
-
Install the
dnf-utilspackage to manage repositories easily:sudo dnf install -y dnf-utils -
Add the Node.js repository:
sudo dnf module reset nodejs sudo dnf module enable nodejs:18 -y(Replace
18with the desired version of Node.js, e.g.,20for the latest LTS.)
Step 3: Install Node.js
Now, install Node.js along with npm (Node Package Manager):
sudo dnf install -y nodejs
Step 4: Verify Installation
Check the installed versions of Node.js and npm:
node -v
npm -v
2) Here’s a step-by-step guide to installing Nginx on CentOS 9:
Step 1: Update the System
Ensure your system is up-to-date before installing Nginx:
sudo dnf update -y
Step 2: Install Nginx
The Nginx package is available in the CentOS AppStream repository. To install it:
sudo dnf install -y nginx
Step 3: Start and Enable Nginx
After installation, start the Nginx service and enable it to start automatically on boot:
sudo systemctl start nginx
sudo systemctl enable nginx
Step 4: Adjust the Firewall
If the firewall is active, allow HTTP and HTTPS traffic:
sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --permanent --add-service=https
sudo firewall-cmd --reload
Step 5: Verify the Installation
-
Check the status of the Nginx service:
sudo systemctl status nginx
3) Here’s a step-by-step guide to installing Stunnel on CentOS 9:
Step 1: Update the System
Ensure the system is up-to-date:
sudo dnf update -y
Step 2: Install Stunnel
Stunnel is available in the EPEL (Extra Packages for Enterprise Linux) repository. Install the EPEL repository first:
sudo dnf install -y epel-release
Then install Stunnel:
sudo dnf install -y stunnel
Step 3: Start and Enable Stunnel
-
Enable the Stunnel service to start automatically:
sudo systemctl enable stunnel -
Start the Stunnel service:
sudo systemctl start stunnel -
Check the service status:
sudo systemctl status stunnel
Step 4: Adjust the Firewall
If you're using a firewall, open the required ports (e.g., 443 for HTTPS):
sudo firewall-cmd --permanent --add-port=443/tcp
sudo firewall-cmd --reload
Here’s a step-by-step guide to installing MongoDB on CentOS 9:
Step 1: Add the MongoDB Repository
MongoDB is not available in the default CentOS repositories, so you need to add the official MongoDB repository.
-
Create the repository file:
sudo nano /etc/yum.repos.d/mongodb-org-6.0.repo -
Add the following repository configuration:
[mongodb-org-6.0] name=MongoDB Repository baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/6.0/x86_64/ gpgcheck=1 enabled=1 gpgkey=https://www.mongodb.org/static/pgp/server-6.0.asc(Replace
6.0with the version you want if newer versions are available.)
Step 2: Install MongoDB
-
Install MongoDB using
dnf:sudo dnf install -y mongodb-org
Step 3: Start and Enable MongoDB
-
Start the MongoDB service:
sudo systemctl start mongod -
Enable MongoDB to start on boot:
sudo systemctl enable mongod -
Verify that MongoDB is running:
sudo systemctl status mongod
Step 4: Verify the Installation
-
Access the MongoDB shell to verify installation:
mongo -
Check the version:
db.version()
Install Certbot on centos9
sudo dnf install -y certbot python3-certbot-nginx
Install pm2 for managaing processes
npm i -g pm2
Upload "e-kyc-website-frontend" folder to server then run below command
cd /e-kyc-website-frontend
npm i
pm2 start server.js
Upload "e-kyc-admin-frontend" folder to server then run below command
cd /e-kyc-admin-frontend
npm i
pm2 start admin.js
To save Process for faster management run
Used to Save Process List in Dump File faster start/stop process.
pm2 save
To check list is save or no after reboot of server do
pm2 status
if list is empty start manually using
pm2 start <filepath>
to stop
pm2 stop <filepath>
To Start Stop Restart if List is Exist Do
pm2 start all
pm2 stop all
pm2 restart all
command for Enforcing access to server
setenforce 0
or
setenforce Permissive