0% found this document useful (0 votes)
11 views8 pages

Mail Log Configuration

Uploaded by

Umesh Paneru
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views8 pages

Mail Log Configuration

Uploaded by

Umesh Paneru
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Email Log Viewer

Technotiate Solutions Pvt. Ltd.


Saugal-12, 44700, Lalitpur, Nepal

Date: 22-August-2023

Submitted By Submitted To
Amit Kusmi
Anil Kushma Salim Shrestha
Table of Content
Mail Log Configuration................................................................................................................1
Step 1: Create PHP-FPM Instances............................................................................................1
Step 2: Configure the Mlog Configuration files........................................................................ 2
I. index.php............................................................................................................................. 3
vi index.php : Here we change server_name and port number............................................... 3
II. application.php.....................................................................................................................3
vi application.php: Here we change the server_name............................................................3
III. login.php............................................................................................................................. 3
IV. log.php................................................................................................................................ 3
V. log_outgoing.php................................................................................................................. 4
VI. logout.php...........................................................................................................................4
Step 3: Mount File Sharing using SAMBA.................................................................................4
Step 4: Now configure the Nginx............................................................................................... 5
How to insert the users into Mysql Database........................................................................... 6
Mail Log Configuration
We have to first configure in the PHP FPM to handle the parallel processing of PHP instances.
The php-fpm service creates a default pool, the configuration (www.conf) for which can be
found in /etc/php/7.4/fpm/pool.d folder. You can customize the default pool as per your
requirements. But it is a standard practice to create separate pools to have better control over
resource allocation to each FPM process. Furthermore, segregating the FPM pool will enable
them to run independently by creating its own master process. That means each php application
can be configured with its own cache settings using PHP-FPM.

Step 1: Create PHP-FPM Instances


Now go to the FPM configuration directory and create a configuration file using your favorite
text editor like vi,vim, nano:

cd /etc/php/7.4/fpm/pool.d
ls
cp second.conf third.conf
sudo vi third.conf

Here we have copy existing .conf file to new .conf file


Now, we have to change the port number and server related information.

To see the port is available or not use cmd: netstat -tulpn

1
Now restart the php-fpm : sudo systemctl restart php7.4-fpm

Step 2: Configure the Mlog Configuration files.


Now navigate to cd /var/www/mlog
cp mlog02 mlog03
vi mlog3

2
Now update the following file of php.
cd /var/www/mlog3
ls

I. index.php

vi index.php : Here we change server_name and port number

II. application.php
vi application.php: Here we change the server_name

III. login.php
vi login.php

IV. log.php
vi log.php: incoming-domain and logs path

3
V. log_outgoing.php
vi log_outgoing.php: In log_outgoing.php we have to change the filename.

VI. logout.php
vi logout.php: Check if we need to make any changes or not.

Step 3: Mount File Sharing using SAMBA


mkdir /directory/logs

mkdir /directory/domains

4
mount -t cifs -o username=-------, password=’----’ \\ip\logs or Domain.

Example: mount -t cifs -o username=syslog, passwords=‘L0g123#$123’ //


172.28.0.100 /Logs /directory/logs/

Here we mount the source // 172.28.0.100/Logs to this directory /directory/logs/

Similarly you can mount the other domain logs also.

To check the mount use cmd : df -h

Step 4: Now Configure the Nginx


cd /etc/nginx/sites-enabled
cp log02.conf log03.conf

5
sudo vi logs03.conf

server_name logs03.syntegrate.com.org;
root /var/www/mlogs03;
fastcgi_pass_127.0.0.1:9002;

Make sure the above configuration setting is syntactically correct and restart NGINX.
# nginx-t to check the syntax of nginx
# systemctl restart nginx

How to insert the users into Mysql Database.


# sudo mysql
# use mlog

INSERT INTO users (email, password, domain) VALUES ('ani@synt',


SHA2('anil123', 256), 'cmli.com.np');

Here “all” denotes a global administrator of an email log viewer.


“cmli.com.np” user for this domain name only.

You might also like