Tag Archive for 'apache'

Website compression

I just found a helpful article about compressing website pages automatically using .htaccess here.  This reduced my page size by at least 75%, a big (and safe) help for viewing pages fast.

My next search was for a WordPress caching plugin.  I am currently testing WordPress Super Cache, which has been updated to work with WP 2.5.  However, it has a complicated setup and clashed with the .htaccess rules I already have setup for the rest of my website.

I've been testing other .htaccess rules to enable GZIP or Deflate for all files, but haven't yet found the perfect configuration.  If I do, I'll post it here!

WordPress 2.5 Media

Well I'm enjoying my experience of WordPress 2.5 already. The admin interface is so much cleaner, and it does so many things better than before!

I did however have one small problem. When trying to add media using the new media interface, I kept getting HTTP errors. After a bit of searching around, I discovered it was due to the mod_security Apache module.

Not wanting to disable it entirely, I discovered that it is possible simply to disable the POST filter, which allows the gallery to work. Simply add the following to the .htaccess file in the root folder of your blog:

<IfModule mod_security.c>SecFilterScanPOST Off</IfModule>

This works for me, so I hope it works for you!

Custom SSH port with svnserve

I had some trouble accessing my svn repository on my server.  The people who host my website use a non-standard SSH port, and they force you to access the svn server through SSH - but without telling svnserve to use the non-standard port!

So, after much trawling through the internet, I finally found the solution, thanks to this page.  Their solution didn't quite match my needs (as they assume root access for the Linux shell, which I don't have), but it got me over the hump.  Their solution is to set the global variable $SVN_SSH, '
It seems like the environment variable is the only way to set the SSH port.'

However, this is wrong - there is another way, and it is more elegant, I think.

The subversion configuration file settings on a standard Linux setup can be found in the '.subversion' directory.  In this folder you can find the 'config' file.  Open this, and you will find the '[tunnels]' section.  Add the following code to that section:

custom_ssh = $SVN_SSH ssh -p 12345

This creates a custom ssh access protocol which is identical to the standard one, except with a different port number.  If you want to specify a different (or non-ssh) protocol you can do that too.  More details can be found here.

To access the repository now, you simply use this:

$ svn co svn+custom_ssh://username@server_ip/path/to/repos/ .

instead of this:

$ svn co svn+ssh://username@server_ip/path/to/repos/ .

Problem solved!