How To Redirect to https in Apache Using mod_rewrite

Author: , November 17th, 2017

How To Watch https Calls to Apache 2.4 using Perl and mod_status

Author: , September 5th, 2017

Step 1: Enable Apache status and lock it down: Make sure mod_status is being loaded:

Add support for the call just under the first DocumentRoot statement:

Step 2. Prepare your environment:

Step 3: Create and run the status script: (See the astat contents at the bottom)

/root/astat

How To Enable Compression On Apache Webservers

Author: , April 26th, 2016

Add the following to either .htaccess or httpd.conf:

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 Allow Cross-Site Javascript Using Apache

Author: , September 24th, 2015

The key is to send a response header like this: Access-Control-Allow-Origin: * In the Apache web server, one enables this via the following directive: Header set Access-Control-Allow-Origin * This requires the use of mod_headers, which is enabled by default in Apache. For example:

How to Install Apache mod_evasive on AWS Linux/CentOS

Author: , July 26th, 2014

I was getting tired of using iptables to block the various hackers and bots constantly slamming my servers (the Chinese are the worst offenders by far – curse them!). I found the Apache module mod_evasive and installed it. Here are links to various articles about mod_evasive: http://www.zdziarski.com/blog/?page_id=442 https://coderwall.com/p/eouy3g http://www.crucialp.com/resources/tutorials/server-administration/flood-protection-dos-ddos-protection-apache-1.3-2.0-mod_dosevasive-avoiding-denial-of-service-attacks.php Add the Module to Apache I […]

How To Fix iOS 7.1 Error: Cannot install applications because the certificate is not valid

Author: , March 19th, 2014

After I upgraded to iOS 7.1, Enterprise application deployments no longer worked. I would get the following error: “Cannot install applications because the certificate is not valid”, and the download would fail. As it turns out, Apple changed the rules without notification again, and is now requiring https for part of the process. For those […]

How To Determine HTTP Protocol Using PHP

Author: , May 11th, 2012

$protocol = (!empty($_SERVER[‘HTTPS’]) && $_SERVER[‘HTTPS’] !== ‘off’) ? “https:” : “http:”;

How To Force Apache To Use https

Author: , October 26th, 2011

How To Determine The Current Protocol Using Javascript

Author: , February 18th, 2011

var myPrefix = ‘https:’ == document.location.protocol ? ‘https://’ : ‘http://’;