Sunday, September 19, 2021

Create mysql user with all privileges

 CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'user_password';

GRANT ALL PRIVILEGES ON *.* TO 'database_user'@'localhost';

Thursday, September 16, 2021

Add Additional IP to Ubuntu VPS

Step-1:

add dns of your IP Pool or you can use

 /etc/hosts

for example:
xx.zz.yy.97 ip1-pool.example.com 
xx.zz.yy.98 ip2-pool.example.com 
xx.zz.yy.99 ip3-pool.example.com 
xx.zz.yy.100 ip4-pool.example.com

Step-2:

In Ubuntu beginning with version 17.10, you can find the network configuration in the file 

/etc/netplan/01-netcfg.yaml [in Contabo VPS]
/etc/netplan/50-cloud-init.yaml [in OVH VPS]

With this method you can assign additional IPv4 and IPv6 addresses to the interface eth0. Additionally to the main IPv4 address 192.51.100.10 and the first IPv6 address of your IPv6 network, you might configure the additional IPv4 addresses 192.51.100.42 and 192.0.2.23 and the additional IPv6 addresses 2001:0db8:2a02:c200:0000:0000:0000:0002 and 2001:0db8:2a02:c200:0000:0000:0000:0003 in the area addresses: below of eth0: . It is important to keep the correct indentation!

#/etc/netplan/01-netcfg.yaml [Contabo]
network: version: 2 renderer: networkd ethernets: eth0: match: macaddress: 00:50:56:3d:c3:aa addresses: - 192.51.100.10/24 - 192.51.100.42/24 - 192.0.2.23/24 
 - 2001:0db8:2a02:c200:0000:0000:0000:0001/64 
 - 2001:0db8:2a02:c200:0000:0000:0000:0002/64 
 - 2001:0db8:2a02:c200:0000:0000:0000:0003/64 gateway6: fe80::1 routes: - to: 0.0.0.0/0 via: 192.51.100.1 on-link: true nameservers: search: [ invalid ] addresses: - 79.143.183.251 - 79.143.183.252 - 2a02:c205::1:53 - 2a02:c205::2:53

#/etc/netplan/50-cloud-init.yaml [OVH]
ens3:
            accept-ra: false
            addresses:
            - 51.222.247.31/32
            dhcp4: true
            match:
                macaddress: fa:16:3e:fa:db:ad
            mtu: 1500
            nameservers:
                addresses:
                - 213.186.33.99
                search: []
            routes:
            -   to: ::/0
                via: 2607:5300:205:200::1
            set-name: ens3


To apply the changes, please enter the command below and reboot your server:

netplan apply



Sunday, September 5, 2021

install PowerMTA on the server

We can install PowerMTA on the server.

rpm -ivh /home/PowerMTA-4.0r6.x86_64.rpm

You will see the output like this

Preparing... ########################################### [100%]
1:PowerMTA ########################################### [100%]

PowerMTA has been installed. Please review the configuration
(in /etc/pmta/config) to ensure it fits your needs.

The PowerMTA User's Guide is available on file:/usr/share/doc/pmta/UsersGuide.pdf.

*** WARNING ***
The SMTP TCP port is already in use by other software on this
system. Installation will continue, but in order to be able to
start up PowerMTA you will need to stop the other software
or reconfigure PowerMTA to use an alternative port. See the
manual section about startup problems for more information.
*** WARNING ***

*** NOTE ***
gdb is not installed. Please install it at your earliest convenience,
so that PowerMTA can use it to provide more useful reports in case of problems.
*** NOTE ***

Thank you for choosing PowerMTA.

This software requires a license to run. To obtain a license key,
please contact Port25 at <sales@port25.com> or call +1.410.750.7687
during office hours, U.S. Eastern Time.

If you already received a license key from Port25, please save it
as /etc/pmta/license before starting PowerMTA.

Starting PowerMTA web monitor: [ OK ]

Now need to create some folder to work properly.

chown pmta:pmta /etc/pmta/config;
chmod 640 /etc/pmta/config;
mkdir -p /var/spool/pmtaPickup/;
mkdir -p /var/spool/pmtaPickup/Pickup;
mkdir -p /var/spool/pmtaPickup/BadMail;
mkdir -p /var/spool/pmtaIncoming;
chown pmta:pmta /var/spool/pmtaIncoming;
chmod 755 /var/spool/pmtaIncoming;
chown pmta:pmta /var/spool/pmtaPickup/*
mkdir -p /var/log/pmta;
mkdir -p /var/log/pmtaAccRep;
mkdir -p /var/log/pmtaErr;
mkdir -p /var/log/pmtaErrRep;
chown pmta:pmta /var/log/pmta;
chown pmta:pmta /var/log/pmtaAccRep;
chown pmta:pmta /var/log/pmtaErr;
chown pmta:pmta /var/log/pmtaErrRep;
chmod 755 /var/log/pmta;
chmod 755 /var/log/pmtaAccRep;
chmod 755 /var/log/pmtaErr;
chmod 755 /var/log/pmtaErrRep;

If you found no error then it is successful. now we need to configure Apache config file.

vi /etc/httpsd/conf/httpsd.conf

change Servername and Server Alias Values With your domain name. (don’t forget the error_log.yourdomain.com & access_log.yourdomain.com)

ServerName scalebuzz.com
ServerAlias scalebuzz.com
DocumentRoot /var/www/
ErrorLog /var/log/httpsd/error_log.scalebuzz.com
TransferLog /var/log/httpsd/access_log.scalebuzz.com
ServerName 192.168.0.10
ServerAlias 192.168.0.10
DocumentRoot /var/www/
ErrorLog /var/log/httpsd/error_log
TransferLog /var/log/httpsd/access_log

Save the file.

Step 8:
To add licence of PMTA

vi /etc/pmta/license

Paste the licence key in licence file.

Now edit the powerMTA config file.

cd /etc/pmta/
rm- rf config
wget https://www.scalebuzz.com/packages/config
chown mysql:mysql config
vi /etc/pmta/config

find the following lines and change the ip with server ip.

#...https management interface
https-mgmt-port 8080 Admin
https-access 127.0.0.1 admin

Now change the following line.

#relay-domain
relay-domain scalebuzz.com

Find this lines and change the ip

smtp-listener 127.0.0.1:2500
smtp-listener 192.168.0.10:25

Change virtual MTA also

<virtual-mta mta1E>
smtp-source-ip 192.168.0.10
host-name scalebuzz.com
domain-key SELECTOR1,scalebuzz.com,/etc/pmta/domainKeys/192.168.0.10.private
</virtual-mta>
cd /etc/pmta/
mkdir domainKeys
cd domainKeys
nano your_server_ip_address.private

Now important thing is set DKIM and SPF record for your domain to make work properly.

Now set the permission to PMTA config file.

cd /etc/pmta/
chown pmta:pmta config

Everything has been completed now you can send the mail by using PowerMTA.

Friday, September 3, 2021

Add File Manager to Vesta CP

 Log in as root to a Vesta installed server via terminal.

Open the configuration file using any text editor:
vi /usr/local/vesta/conf/vesta.conf

Add the following line at the end of that configuration file:

FILEMANAGER_KEY=’ILOVEREO’

Save and exit the file.


Try to log out and re-login to Vesta panel and you will be able to see the file manager option now.


Extract Domain from email in Excel or Google sheet

  =TEXTAFTER( A2 , "@") or, =MID(A1, FIND("@", A1) + 1, LEN(A1) - FIND("@", A1))