How To Upgrade MySQL from 5.5 to 5.7 on CentOS/AWS Linux

Author: , December 7th, 2017

START: Server version: 5.5.54-log MySQL Community Server (GPL) FINISH: Server version: 5.7.20-log MySQL Community Server (GPL) 1 2 3 4 5 6 mysql –execute="SET GLOBAL innodb_fast_shutdown=0;" service mysqld stop yum remove mysql mysql-* yum install mysql57-devel mysql57-server mysql57-test service mysqld start mysql_upgrade mysql –execute=”SET GLOBAL innodb_fast_shutdown=0;” service mysqld stop yum remove mysql mysql-* yum install […]

How To Block an Entire TLD in Postfix

Author: , September 13th, 2016

Step 1. Execute the following two commands: postconf -e smtpd_sender_restrictions=pcre:/etc/postfix/rejected_domains postconf -e reject_unauth_destinations=pcre:/etc/postfix/rejected_domains If that doesn’t work, you may hand-edit main.cf and add/edit these lines: 1 2 smtpd_sender_restrictions=pcre:/etc/postfix/rejected_domains reject_unauth_destinations=pcre:/etc/postfix/rejected_domains smtpd_sender_restrictions=pcre:/etc/postfix/rejected_domains reject_unauth_destinations=pcre:/etc/postfix/rejected_domains Step 2. Create the regex filter file: vim /etc/postfix/rejected_domains 1 2 /\.top$/           REJECT No spam allowed from the .top […]

How To Install and Use the screen Command on AWS Linux

Author: , August 12th, 2016

Install it: yum install screen Start it up: screen Detach from the session: Control-a d Re-attach to the session later on: screen -r This is a good reference guide: https://www.rackaid.com/blog/linux-screen-tutorial-and-how-to/

How To Enable DNS Hostnames for AWS VPC

Author: , August 8th, 2016

When you launch an instance into a VPC, AWS provides the instance with a public DNS hostname only if DNS hostnames are enabled for the VPC. By default, DNS hostnames are enabled only for default VPCs and VPCs that you create using the VPC wizard in the VPC console. If you enable DNS hostnames and […]

How To Fix Apache VirtualHost Overlap on Port 443 on AWS Linux

Author: , July 4th, 2016

If you get this error when starting Apache or via `apachectl configtest`: [warn] _default_ VirtualHost overlap on port 443, the first has precedence then you must add: NameVirtualHost *:443 to /etc/httpd/conf/httpd.conf, then restart Apache

How To Fix a “Corrupted index cache file” Error in Dovecot

Author: , June 17th, 2016

Jun 17 00:02:45 inbound dovecot: IMAP(yourName): Corrupted index cache file /home/yourName/Maildir/dovecot.index.cache: invalid record size service dovecot stop cd /home/yourName/Maildir/ rm dovecot.index* service dovecot start As always, YMMV. Proceed with caution.

How To Install the AWS CLI

Author: , March 29th, 2016

http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-set-up.html http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html 1 2 3 4 5 6 7 8 cd curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip" unzip awscli-bundle.zip yum install python26 /usr/bin/python26 awscli-bundle/install -i /opt/aws/awscli -b /usr/bin/aws aws configure aws s3 ls aws ec2 describe-instances –output text cd curl “https://s3.amazonaws.com/aws-cli/awscli-bundle.zip” -o “awscli-bundle.zip” unzip awscli-bundle.zip yum install python26 /usr/bin/python26 awscli-bundle/install -i /opt/aws/awscli -b /usr/bin/aws aws configure aws […]

How To Fix Peer Not Authenticated Errors While Using AWS API Tools

Author: , February 9th, 2016

I was getting the following errors when using an older version of the Amazon EC2 API Tools: $ ec2-describe-regions Unknown problem connecting to host: ‘https://ec2.amazonaws.com’ Unable to execute HTTP request: peer not authenticated The solution was to upgrade to the latest AWS CLI tools and start using the aws command instead. For example: aws ec2 […]

How To Check Amazon RDS MySQL Servers in Nagios Without Ping

Author: , August 13th, 2015

Amazon Web Services (AWS) offers MySQL Server via the Relational Database Service (RDS) offering. Unfortunately, AWS doesn’t allow ICMP Ping to reach the nodes, so as configured by default, Nagios will fail on the host check. The solution is to submit a Passive Check for that host. Login to the Nagios web console Click on […]

How To Find the AWS Region and Availability Zone Via the CLI

Author: , June 30th, 2015

/opt/aws/bin/ec2-metadata | grep placement