If you’re building a Next.js or React.js application using the cPanel terminal and see the error “RangeError: WebAssembly.Instance(): Out of memory: Cannot allocate Wasm memory for new instance,” it means the build process needs more memory than cPanel is currently allowing.
Here’s how to fix this if you have WHM (WebHost Manager) access.
Modern JavaScript applications, like those built with Next.js or React.js, can use a lot of memory during their build process. Sometimes, the tools they use (which might include WebAssembly for speed) try to use more memory than the limit set for a single process in your cPanel settings. When this happens, the build stops and shows the “Out of memory” error.
You can solve this by increasing the maximum amount of memory a cPanel process can use. You’ll do this in WHM’s Tweak Settings.
yourdomain.com/whm
or yourserverip:2087
and logging in.After you save the new setting, go back to the cPanel terminal and try building your Next.js or React.js application again. This should usually fix the “WebAssembly.Instance(): Out of memory” error.
This memory error happens when your application build needs more resources. Increasing the “Max cPanel process memory” through WHM Tweak Settings generally resolves the issue by giving the build process the memory it requires.
In this comprehensive guide, we’ll configure a full-featured Postfix email server on AlmaLinux 9 with SASL authentication. This setup allows authenticated users to send emails securely, making it ideal for personal servers or small business environments. We’ll cover installation, configuration, security hardening, and testing.
Postfix is a powerful, open-source mail transfer agent (MTA) known for its security and reliability. Enabling SASL authentication lets users authenticate before sending emails, preventing unauthorized relaying and enhancing control over your mail server.
yourdomain.com
with your actual domain)sudo dnf update -y
sudo dnf install postfix -y
# Enable and start the service
sudo systemctl enable --now postfix
sudo systemctl status postfix
Edit /etc/postfix/main.cf
to define server behavior and security parameters:
# Server Identity
myhostname = mail.yourdomain.com
mydomain = yourdomain.com
myorigin = $mydomain
# Network Configuration
inet_interfaces = all # Listen on all interfaces (adjust based on your security requirements)
inet_protocols = all # Enable IPv4/IPv6
# Mail Delivery Rules
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
mynetworks =127.0.0.0/8 [::1]/128 # Restrict unauthenticated relaying to localhost
# Mail Storage
home_mailbox = Maildir/ # Use Maildir format for email storage
# SMTP Banner
smtpd_banner = $myhostname ESMTP Postfix
Verify syntax and apply changes:
sudo postfix check
sudo systemctl reload postfix
Install SASL libraries and configure PAM authentication:
# Install SASL packages
sudo dnf install cyrus-sasl cyrus-sasl-plain -y
# Configure SASL daemon
echo 'MECH=pam' | sudo tee -a /etc/sysconfig/saslauthd
sudo systemctl enable --now saslauthd
sudo systemctl status saslauthd
Modify /etc/postfix/main.cf
to enable authentication and restrict relay access:
# Enable SASL authentication
smtpd_sasl_auth_enable = yes
# Security policies
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes # Enable compatibility with older clients
# Relay control: Allow authenticated users
smtpd_recipient_restrictions =
permit_mynetworks,
permit_sasl_authenticated,
reject_unauth_destination
Create the SASL configuration file:
sudo mkdir -p /etc/sasl2
echo -e "pwcheck_method: saslauthd\nmech_list: plain login" | sudo tee /etc/sasl2/smtpd.conf
sudo systemctl reload postfix
Add a user account to test authentication:
sudo adduser newuser
sudo passwd newuser
Install Swaks, a command-line SMTP testing tool:
sudo dnf install epel-release -y
sudo dnf install swaks
# Test authentication and email delivery
swaks \
--server localhost \
--port25 \
--helo smtp.server.com \
--to test@yourdomain.com \
--from test2@yourdomain.com \
--auth LOGIN \
--auth-user newuser \
--auth-password 'your_secure_password' \
--tls \
--body "Subject: Test Email via Swaks\n\nThis is a test message."
mynetworks
: Only allow trusted networks to bypass authentication.Tags: `Postfix, AlmaLinux9, SASL Authentication, Email Server, Linux Configuration, Cyrus SASL, SMTP Authentication, Systemd Services, Mail Server Setup, Email Security, Swaks Testing Tool, Linux Command Line, Maildir, EPEL Repository, PAM Authentication, Postfix Configuration, User Management, Network Security, SMTP Relay, Installation Guide, Configuration Guide, Linux System Administration, Open Source Tools, Security Best Practices`
Grafana is a popular open-source platform for monitoring and observability. It allows you to visualize and explore your metrics, logs, and traces. In this guide, we will walk you through the steps to install Grafana on AlmaLinux 9.
First, ensure your system is up to date:
sudo dnf update -y
To install Grafana, you need to add the official Grafana repository. Run the following command:
sudo dnf install https://dl.grafana.com/oss/release/rpm/grafana-8.5.5-1.x86_64.rpm
Note: Replace `8.5.5-1` with the latest version available from the Grafana download page.
Once the repository is added, install Grafana using the following command:
sudo dnf install grafana -y
After installation, start the Grafana service and enable it to start on boot:
sudo systemctl start grafana-server
sudo systemctl enable grafana-server
If you have a firewall enabled, you need to allow traffic on port 3000 (default Grafana port):
sudo firewall-cmd --zone=public --add-port=3000/tcp --permanent
sudo firewall-cmd --reload
Once Grafana is installed and running, you can access it via a web browser. Open your browser and navigate to:
http://your_server_ip:3000
Replace `your_server_ip` with the actual IP address of your server.
The first time you access Grafana, you will be prompted to set up an admin user and configure data sources. Follow the on-screen instructions to complete the setup.
To ensure that Grafana is running correctly, you can check the status of the service:
sudo systemctl status grafana-server
You should see that the service is active and running.
By following these steps, you should now have Grafana installed and running on your AlmaLinux 9 server. You can start adding data sources, creating dashboards, and monitoring your systems effectively.
If you encounter any issues or need further assistance, refer to the official Grafana documentation.
Happy monitoring!
—
### Tags for the Post
“`
#Grafana #AlmaLinux #Linux #SystemMonitoring #DataVisualization #InstallationGuide #OpenSource #MonitoringTools #AlmaLinux9 #GrafanaInstallation
“`
Metabase v0.47.0 offers powerful permission controls that allow you to restrict user access to specific dashboards while preventing them from accessing other features. Follow these steps to configure this setup:
Start by creating a new user group specifically for dashboard viewers:
Next, set up restrictive permissions for the newly created group:
Organize your dashboards by creating a specific collection:
Ensure the “Dashboard Viewers” group has access only to the specified collection:
Add the users who should only view the specified dashboards:
Provide your users with direct links to the dashboards:
For a more streamlined experience, consider the following options:
By following these steps, you can ensure that users are restricted to viewing only the specific dashboards you have granted them access to, without being able to access query builders, raw data, or other Metabase features.
#Metabase #dashboardaccess #userpermissions #dataaccesscontrol #Metabasev0.47.0 #restricteduseraccess #dashboardviewers #Metabasepermissions #usergroups #SSO #embedding #datasecurity
Introduction
SPF (Sender Policy Framework) records are crucial for email authentication, helping prevent email spoofing and improving deliverability. Manually updating SPF records for each cPanel user can be time-consuming. This guide shows you how to automate this process using a single command.
Use the following command to update SPF records for all non-system cPanel users at once:
for user in $(cut -d: -f1 /etc/passwd | grep -v "nobody\|mysql\|system" | sort); do /usr/local/cpanel/bin/spf_installer $user "include:relay.mailchannels.net,include:smtp.mellow.solutions" 0 1 1; done
cut -d: -f1 /etc/passwd | grep -v "nobody\|mysql\|system" | sort
cut -d: -f1 /etc/passwd
: Extracts all usernames from the system’s user list.grep -v "nobody\|mysql\|system"
: Excludes system users (like nobody
, mysql
, or system
) to target only cPanel accounts.sort
: Orders the list alphabetically for consistency./usr/local/cpanel/bin/spf_installer $user "include:relay.mailchannels.net,include:smtp.mellow.solutions" 0 1 1
$user
: Iterates through each valid cPanel username."include:relay.mailchannels.net,include:smtp.mellow.solutions"
: The SPF record to set. Replace these values with your own if needed (e.g., your email service providers).0 1 1
: Flags for the spf_installer
script (refer to cPanel documentation for exact meaning, but typically:0
: Do not force overwrite.1 1
: Save and enable the SPF record.include:relay.mailchannels.net
, etc.) are correct and compatible with your email service providers.spf_installer
tool is installed (common in cPanel versions 11.50+).This method saves hours of manual work, ensuring all accounts comply with your email provider’s requirements in seconds.
Final Note
Automating SPF updates is efficient, but always prioritize accuracy. Mistakes in SPF records can lead to email delivery failures.
Ready to implement? Copy the command, test it on a staging server if possible, and ensure your SPF syntax is validated.
Share this guide with your team or save it for future reference. Let us know if you need further assistance!
Tags: #cPanel, #SPF, #EmailAuthentication, #Automation
This guide ensures your SPF records are updated seamlessly, enhancing email security and deliverability across all accounts.
First, boot the system in the rescue kernel. I am assuming your boot partition is separated then the home partition, like in my case. Here are the list of commands I have used:
# mount /dev/md126 /mnt # mount /dev/md127 /mnt/boot # mount --bind /dev /mnt/dev # mount --bind /dev/pts /mnt/dev/pts # mount --bind /proc /mnt/proc # mount --bind /sys /mnt/sys # chroot /mnt # passwd
Now, make sure to reset the password properly. Once done. Umount all the partition and boot in regular mode:
# umount /mnt/boot # umount /mnt/sys # umount /mnt/proc # umount /mnt/dev/pts # umount /mnt/dev # umount /mnt # reboot
It should be it.
Virtualization and cloud computing often require the manipulation of disk images. One common format used for these operations is the QCOW2 (QEMU Copy-On-Write version 2) format. This blog post will guide you through the process of mounting a QCOW2 image as a Network Block Device (NBD) to access its contents directly from the host system.
Before you start, ensure you have the necessary tools installed on your system. The primary tools needed are:
First, you need to enable the NBD module with support for up to 8 partitions. Execute the following command:
modprobe nbd max_part=8
Next, use the qemu-nbd tool to connect the QCOW2 image to an NBD device. Replace /vz/vmprivate/v1002/harddisk.hdd with the path to your QCOW2 image:
qemu-nbd --connect=/dev/nbd0 /vz/vmprivate/v1002/harddisk.hdd
After connecting the image, you need to identify the partitions on the NBD device. Use the fdisk tool to list the partitions:
fdisk /dev/nbd0 -l
Note down the partition identifiers (e.g., /dev/nbd0p1).
With the partition identifier noted, you can now mount the partition to a mount point. Create a mount point if it does not exist:
mkdir -p /mnt
mount /dev/nbd0p1 /mnt
You can now access the contents of the QCOW2 image through the /mnt directory.
After you’re done with your operations, it’s important to clean up the environment to avoid any conflicts or resource leaks.
umount /mnt
qemu-nbd --disconnect /dev/nbd0
rmmod nbd
Mounting a QCOW2 image as a Network Block Device (NBD) allows you to access its contents directly from the host system, making it a powerful tool for debugging, data recovery, or any situation where direct access to the image is necessary.
By following the steps outlined in this post, you can easily mount, work with, and then safely disconnect and remove the QCOW2 image from your system.
Keywords: QCOW2, Network Block Device, NBD, qemu-nbd, modprobe, mount, umount, fdisk, virtualization, cloud computing, disk image, partition, data recovery, debugging.
Issue
KVM VM not starting with the following error when you try to start:
could not get access to acl tech driver 'ebiptables'
There is a nwfilter module for libvirt. If for some reason, it comes up with an issue, the above error would appear. To fix this, you need to update (If any update is available) / reinstall (If no update is available) the following module using Yum:
libvirt-daemon-config-nwfilter
The command would be like the following:
yum update libvirt-daemon-config-nwfilter
That shall fix the issue.
When I tried to load my Roundcube today, found that it failed to load the inbox and instead had thrown the following error:
Server Error! (Ok)
Then, I tried searching the cpanel logs or the roundcube error log but found nothing. Then, I checked the Dovecot log located here:
/var/log/maillog
I found the following:
May 7 13:57:49 network2 dovecot: imap(shawon@mellowhost.com)<26343><cQG+qxX7MvdneMrv>: Error: Mailbox INBOX: mmap(size=351817308) failed with file /home/mellow/mail/mellowhost.com/shawon/dovecot.index.cache: Cannot allocate memory
This is happening because Dovecot caches the mail index in a file, once it tries to cache a lot of emails, it fails with a memory error. In those cases, you may remove the cache file and let Dovecot generate a new cache based on the latest mails. You may simply rm the file and see Roundcube is loading again:
rm -f /home/mellow/mail/mellowhost.com/shawon/dovecot.index.cache
To see/list the constraints, first, connect to the database using the following:
\c my_prod;
Here we are assuming the database name is my_prod. Please note, we are putting these commands in the psql client utility.
Now, use the following query to list all the constraints in the database:
select pgc.conname as constraint_name, ccu.table_schema as table_schema, ccu.table_name, ccu.column_name, contype, pg_get_constraintdef(pgc.oid) from pg_constraint pgc join pg_namespace nsp on nsp.oid = pgc.connamespace join pg_class cls on pgc.conrelid = cls.oid left join information_schema.constraint_column_usage ccu on pgc.conname = ccu.constraint_name and nsp.nspname = ccu.constraint_schema order by pgc.conname;
Good luck