How to force Apache to use manually pre-compressed gz file of CSS and JS files?

Some RewriteRule should handle that quite well. In a Drupal configuration file I found: # AddEncoding allows you to have certain browsers uncompress information on the fly. AddEncoding gzip .gz #Serve gzip compressed CSS files if they exist and the client accepts gzip. RewriteCond %{HTTP:Accept-encoding} gzip RewriteCond %{REQUEST_FILENAME}\.gz -s RewriteRule ^(.*)\.css $1\.css\.gz [QSA] # Serve … Read more

Configuring MAMP for SSL

If you’re using MAMP 3 or 4 the instructions are slightly different. Here’s what worked for me, starting from a fresh install of MAMP 3.0.5 on Mavericks without Pro. Update: Still works on Yosemite after fixing Apache as described in this answer. Further Update: Comments suggest this still works at least through MAMP 5.4. Generate … Read more

htaccess exclude one url from Basic Auth

Using SetEnvIf, you can create a variable when the request starts with some path, then use the Satisfy Any directive to avoid having to login. # set an environtment variable “noauth” if the request starts with “/callbacks/” SetEnvIf Request_URI ^/callbacks/ noauth=1 # the auth block AuthName “Please login.” AuthGroupFile /dev/null AuthType Basic AuthUserFile /xxx/.htpasswd # … Read more

apache to tomcat: mod_jk vs mod_proxy

A pros/cons comparison for those modules exists on http://blog.jboss.org/ mod_proxy * Pros: o No need for a separate module compilation and maintenance. mod_proxy, mod_proxy_http, mod_proxy_ajp and mod_proxy_balancer comes as part of standard Apache 2.2+ distribution o Ability to use http https or AJP protocols, even within the same balancer. * Cons: o mod_proxy_ajp does not … Read more

How to debug an apache virtual host configuration?

Syntax check To check configuration files for syntax errors: # Red Hat-based (Fedora, CentOS), Arch-based and OSX httpd -t # Debian-based (Ubuntu) apache2ctl -t # MacOS apachectl -t List virtual hosts To list all virtual hosts, and their locations: # Red Hat-based (Fedora, CentOS), Arch-based and OSX httpd -S # Debian-based (Ubuntu) apache2ctl -S # … Read more

Do I need to convert .CER to .CRT for Apache SSL certificates? If so, how?

File extensions for cryptographic certificates aren’t really as standardized as you’d expect. Windows by default treats double-clicking a .crt file as a request to import the certificate into the Windows Root Certificate store, but treats a .cer file as a request just to view the certificate. So, they’re different in the sense that Windows has … Read more

tech