Namecheap SSL CSR and CA Bundle for PostiveSSL certs

CSR generation for PositiveSSL and PositiveSSL WildCard with Apache2/OpenSSL see: CSR Generation: Using OpenSSL (Apache w/mod_ssl, NGINX, OS X):

 openssl req -nodes -newkey rsa:2048 -keyout myserver.key -out server.csr

To generate the CA bundle see this article:

 cat COMODORSADomainValidationSecureServerCA.crt COMODORSAAddTrustCA.crt AddTrustExternalCARoot.crt > your_domain.ca-bundle

New Apache SSL configuration

Today Apache complained about SSLCertificateChainFile being deprecated and it told me to use SSLCertificateFile instead.

SSLCertificateFile was already in use with the .crt file. I had to create a new ‘SSLCertificateFile’ by concatenating the .crt file with the ca-bundle, and that fixed the problem:

# cat trust.jj5.net.crt trust.jj5.net.ca-bundle.pem > trust.jj5.net.pem

Apache2 REQUEST_FILENAME requires DOCUMENT_ROOT

I had a problem with my rewrite rules, that looked like this:

  DocumentRoot /var/www/trust.jj5.net
  RewriteEngine On
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule (.*) http://trust.jj5.net/sorry.html [L,R]

I was trying to redirect any request which didn’t match a file or directory. The !-f and !-d requirements were failing because the path to the REQUEST_FILENAME wasn’t fully qualified. I fixed the problem by including the DOCUMENT_ROOT:

  DocumentRoot /var/www/trust.jj5.net
  RewriteEngine On
  RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f
  RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-d
  RewriteRule (.*) http://trust.jj5.net/sorry.html [L,R]

Happy days! :)