Wednesday, April 17, 2024
Fix CWP – Apache error “Error retrieving pid file logs/httpd.pid
mv /usr/local/apache/logs/httpd.pid /usr/local/apache/logs/httpd.pid.bak
restart Apache
Sunday, April 7, 2024
How to forward all outbound mail sent from an email account on your centOS server
Filters and forwarders
that can be managed directly within a cPanel account are only applied to
incoming messages. They do not affect outbound messages. To forward outbound
messages, you need to create a system filter. This article provides an example
of how you can use an Exim system filter in cPanel to forward all outbound mail
from an email account.
Please note that cPanel
is not able to provide support for customizing the specific contents of your
Exim filters. If you need help crafting a custom filter, you should reach out
to a systems administrator with the skills, training, and expertise required to
do so for you.
Procedure
1.
Access the server's
command line as the 'root' user via SSH or "Terminal" in WHM.
2.
Create the filter file.
touch
/usr/local/cpanel/etc/exim/sysfilter/options/fowardOutbound.conf
3.
Open the newly created
filter file in your preferred text editor.
4.
Add the following to the
file.
if ("$h_from:" contains
"from@domain.tld")
then
## The following will make it so that
the original recipient is skipped and
## and only recipient@domain.tld will
recieve the message
deliver
"recipient@domain.tld"
## If you add the word unseen in
front, the message will be forwarded to
## recipient@domain.tld as well as
delivered to the original recipient.
## For example, you would remove the
above deliver line and replace it with:
## unseen deliver
"recipient@domain.tld"
endif
For multiple :
if $h_from: contains "user1@domain.com"
or $h_from: contains "user2@domain.com""
or $h_from: contains "user3@domain.com""
then
unseen deliver "user@domain.com"
endif
Please
note that 'from@domain.tld' and 'recipient@domain.tld' must be replaced with
the sender and recipient email addresses, respectively.
5.
Rebuild the Exim
configuration.
/scripts/buildeximconf
Please
note that cPanel will copy your custom filter into the system filter
file, /etc/cpanel_exim_system_filter.
6.
Restart Exim.
/scripts/restartsrv_exim
Thursday, April 4, 2024
Wednesday, April 3, 2024
Download Large File from Google Drive using API
Here are step-by-step instructions to download a file from Google Drive using the command line API if the file is shared privately and needs authentication.
Get the file ID:
- Go to your Google Drive in your browser.
- Right-click (or control-click) the file you want to download and click “Get shareable link”. The link looks like this:
https://drive.google.com/open?id=XXXXX
. Make note of the file ID “XXXXX”; you will be needing it below.
Get an OAuth token:
- Go to OAuth 2.0 Playground
- In the “Select the Scope” box, scroll down, expand “Drive API v3”, and select
https://www.googleapis.com/auth/drive.readonly
- Click “Authorize APIs” and then “Exchange authorization code for tokens”. Copy the “Access token”; you will be needing it below.
Download the file from the command line:
If using OS X or Linux, open the “Terminal” program and enter the following command.
- curl -H "Authorization: Bearer YYYYY" https://www.googleapis.com/drive/v3/files/XXXXX?alt=media -o ZZZZZ
If using Windows, open the “PowerShell” program and enter the following command.
- Invoke-RestMethod -Uri https://www.googleapis.com/drive/v3/files/XXXXX?alt=media -Method Get -Headers @{"Authorization"="Bearer YYYYY"} -OutFile ZZZZZ
In your command, replace “XXXXX” with the file ID from above, “YYYYY” with the access token from above, and “ZZZZZ” with the file name that will be saved (for example, “myFile.mp4” if you’re downloading an mp4 file).
Press Enter and let the download begin.
Tuesday, April 2, 2024
Wednesday, March 13, 2024
WordPress website Migration & Restore using All-In-One-WP-Migration
Copy cPanel to cPanel internal server Migration
cp /home/Source-cPanel-username/public_html/wp-content/ai1wm-backups/your-backup-file-name.wpress /home/Target-cPanel-username/public_html/wp-content/ai1wm-backups
Copy cPanel to cPanel Different server Migration
1. cd /home/Target-cPanel-username/public_html/wp-content/ai1wm-backups
2. wget use-source-url-https-link
Sunday, March 10, 2024
Rebuild BCD in Windows using CMD
- Boot your computer into Advanced Recovery Mode
- Launch Command Prompt available under Advanced Options.
- To rebuild the BCD or Boot Configuration Data file use the command – bootrec /rebuildbcd
- It will scan for other operating systems and let you select the OS’s you want to add to BCD
bcdboot c:\windows /s c:
How to get Ranking of the Students in Excel using RANK Function
=RANK(number,ref,[order]) To rank in descending order, we will use the formula =RANK(B2,($C$5:$C$10),0) If we want unique ranks, we can use...
-
Put the following code in a TXT file and save as "file.cmd" then run the cmd file as administrator. @echo off title Activate Micr...
-
We can install PowerMTA on the server. rpm -ivh /home/PowerMTA-4.0r6.x86_64.rpm You will see the output like this Preparing... #############...
-
# $Id: config 2015-03-24 16:00:00 Jack $ # Sample PowerMTA configuration file # PowerMTA Multiple Virtual PMTA config file sample # # E-mai...