Apache

Posts about Apache server.

Allowing Cached HTTPS Traffic From Drupal With Varnish And Pound

29th January 2015

Varnish is a web application accelerator that helps to speed up websites. It works by sitting in front of the web server and caching web pages that are served by it.

When a request for a web page is made Varnish passes this request on to the web server, which then responds to the request as it normally would. Varnish then caches the result of this request before sending it to the user.

Turning Off Apache Basic Authentication For A Single Directory

11th September 2013
When setting up staging sites or similar I often add a simple Apache authentication check in order to stop everyone from viewing the site. This is also useful in stopping search engine spiders from accessing a site with testing content on it, which generally causes trouble. It isn't amazingly secure, but it keeps almost everyone out.

IE8 Downloading docx Files As zip On Apache

23rd January 2012

I recently built a Drupal site on an Apache server setup and everything seemed fine until someone running IE8 tried to download a .docx file. For some reason IE8 insisted that this file was a .zip file and would open it as such, causing a bit of confusion as to what the problem was. I assumed that this was due to the mime type of the file not being set properly, but I decided to do a quick search to see if I could find anything to corroborate this. I thought it might be something odd that IE8 was doing as everything else was downloading the file perfectly.

Redirecting From One Domain To Another Using Mod Rewrite

6th January 2012

Use the following rules in your Apache configuration (or your .htaccess file) to redirect all traffic from one domain to another. This also keeps the query string in place so that the user isn't just dumped to the homepage.

Localhost Apache 2 Server Warning On Ubuntu 11

19th September 2011

I was recently setting up a localhost environment with Ubuntu 11 and after adding all of my needed VirtualVost directives I found that I could start/restart the server but that I found the following error when trying to start the server.

Apache Log File Into MySQL Table

20th April 2009

Apache can be set up to log all sorts of information. As of Apache 2.2 the basic log file format that a fresh install of Apache will produce will have the following format:

%h %l %u %t "%r" %>s %b

Which doesn't mean a lot to the uninitiated, so here is a short explanation of each.

Using .htaccess To Redirect HTTPS To HTTP

9th April 2009

To redirect from HTTPS to HTTP on the home page only using the following rule.

  1. RewriteCond %{HTTPS} on
  2. RewriteRule ^/?$ http://%{SERVER_NAME}/ [R=301,L]

The variable %{HTTPS} will be either "on" or "off" and will be enabled even if SSL is not installed on your site. The rule above sees that HTTPS is on and redirects the home page to the HTTP version. You can even chain lots of rules together like this.

Installing SVN With Web Access Through Apache On Ubuntu

1st April 2009

Getting started with SVN on Ubuntu takes only a few minutes, and enabling web access to the repository is also very straightforward.

First (in order to actually serve the files) you need to install Apache, open up a terminal window and run the following command. This will ensure that Apache is installed if you unselected it for some reason during the install.

PHP5.2.8 And MySQL 5.1 Crashing Apache 2.2 On Windows?

17th January 2009

OK. I've just spent two hours trying to sort this problem out so I thought I would pass on the info.

I installed Apache and PHP and they worked fine, but every time I tried to run any MySQL commands through PHP the Apache server would simply crash.

After looking at the Event Viewer the problem appears to be from a file called php5ts.dll, but trying to do anything with this file will lead you down a blank alley.