Saturday, December 12, 2015

Configuring SPF on Virtualmin

Configuring SPF in Virtualmin

What is SPF?

Sender Policy Framework (SPF) is an anti spamming technique that detects email spoofing and verify the sender's IP address, thus allowing only specific server(s) to send on behalf of a domain.

Configuring SPF:

1- Make sure you have a valid hostname and it's resolving to your server's main IP.
2- To check or change your hostname, go to Webmin => Networking => Network Configuration => Hostname and DNS Client.

Virtualmin SPF

3- Add the below to your domain records as a SPF or TXT record.
v=spf1 a mx ~all
Where is your server's main IP address.
Do this for every domain name you have it hosted in your virtualmin.

The below flowchart shows how SPF works:

SPF Flow

Question? Please leave a comment below!

Tuesday, August 25, 2015

Fix Yum Update Duplicate Packages Issue

Yum logo

First install yum utils if it's not installed
yum install yum-utils

1- Second, start with
yum update

2- If that doesn't work, try
yum clean all
yum update

3- If the above doesn't work, try the below:
yum update --skip-broken

Friday, August 14, 2015

Bash Script to Benchmark A Linux Server

Linux Penguin Logo

Whether you're using Linux on a VPS, dedicated server, laptop or desktop pc, this script will benchmark the hardware. It is written in BASH and will benchmark the CPU, memory, hard disk speed and internet connection speed.
1- CPU: The CPU Model, frequency, number of cores and cache size will be tested
2- Memory: The total amount of memory (RAM) and swap will be displayed
3- System: The server uptime will be displayed
4- Hard Disk speed: The Input/Output speed of the harddisk will be tested, and the total available disk space will be displayed.
5- The server's internet connection will be tested by downloading files across the globe, starting from USA to Europe to Asia. 
Note: A total of 1GB of data will be downloaded during execution

Friday, July 10, 2015

Fix Magento Access Denied After Patch SUPEE-6285

magento logo

Magento has released a critical patch (SUPEE-6285) that fixes many XSS and CSRF vulnerabilities (Official Release).

However, it seems many 3rd party extensions were affected by this due to bad implementation, and are returning "Access Denied" to all the admin roles except the Administrator.

Saturday, July 4, 2015

How To Fix: InnoDB Enabled But Not Starting

InnoDB Logo

This is for CentOS, but it should work on Debian/Ubuntu as well. There are two reasons why InnoDB would not start:
  1. It's not enabled in my.cnf
  2. The log files are corrupted

Tuesday, June 16, 2015

How To Cache Files to Leverage Browser Caching in htaccess

Leverage Browser Caching

One of the most essential factors in improving page loading speed is by caching static files such as javascripts, css, fonts and images in the user's browser.

This has lately became important specially when webmasters were testing their page speed on Google insights and getting the following message:

Friday, May 1, 2015

Installing VNC Server on CentOS 7

VNC logo

VNC allows you to connect to your server or computer remotely using a graphical user interface.

Installing The VNC Server:

Install the CentOS desktop
yum groupinstall "GNOME Desktop"

Saturday, April 11, 2015

Forwarding IP Address From Varnish to Apache On Ubuntu & CentOS

Varnish Logo

By default, varnish doesn't forward the public IP of the visitor to the web server such as Apache or Nginx. This makes it harder to detect the visitors' real IP and to read the log files since they will all be displaying the server's IP.

To fix this, Varnish has to be configured to forward the real IP to the webserver.

Thursday, March 5, 2015

Forwarding a Domain Name to a New Domain Using Cloudflare

Cloudflare Logo

Lately, I moved my domain names to namesilo, and I noticed that their domain forwarding option will only forward the root domain, rather than all the pages or virtual directories within that domain.

I decided to park my DNS on cloudflare since it's for free and forward the domain and all its pages to the new domain name.

Saturday, February 14, 2015

Linux Mint and Ubuntu Error: E: Encountered a section with no Package: header

Linux mint Logo

If you encounter the following problem on Linux Mint or Ubuntu while using aptitude or apt-get:
E: Encountered a section with no Package: header

Tuesday, January 13, 2015

How To Install OpenVPN on CentOS 7

OpenVPN Logo

Installing OpenVPN on CentOS 7

Install the Epel package:

rpm -Uvh