buy linux on cd and dvd

Apache - alphabetical orderApache - alphabetical order

Information and howtos about the Apache web server

Apache is an open source web server that runs on a variety of platforms including various UNIX flavours, Novell Netware and Microsoft Windows. It is used to run more websites on the Internet than any other webserver and has done so since 1996, as reported by the Netcraft Webserver Survey. The Apache webserver can be downloaded in binary and source form from the Apache website.

Post sort order: Post Date (Newest First) | Post Date (Oldest First) | Alphabetical | Date Updated

Aliasing images to a remote server with .htaccessAliasing images to a remote server with .htaccess

Posted April 19th, 2008 in Apache

When maintaing a website for a customer where there are several gigabtyes of product images that change frequently, it can be annoying to have to keep a local copy of all those images, particularly when bandwidth usage is taken in to consideration. Using .hatccess files on Apache with a clever use of rewrite rules, it is possible to still reference the images files as if they are on the local webserver but they are really served off the remote server. This makes the local development copy of the website look just like the remote one without having to worry about keeping the images in sync. This post looks at how to do this.

Read more »

Apache - Permission denied: Failed to acquire SSL session cache lockApache - Permission denied: Failed to acquire SSL session cache lock

Posted November 15th, 2007 in Apache

I've set up a CentOS 5 Apache web server for a customer where we run the web server as user different from the default user "apache" (often "nobody" is used as well). The application runs through SSL using mod_ssl, and when accessing SSL secured pages errors like these would appear in the error log:

"[Wed Nov 14 11:16:49 2007] [warn] (13)Permission denied: Failed to acquire SSL session cache lock [Wed Nov 14 11:16:49 2007] [warn] (13)Permission denied: Failed to release SSL session cache lock"

Read more »

Changing Apache log rotation behaviour on CentOS / RHELChanging Apache log rotation behaviour on CentOS / RHEL

Posted March 22nd, 2008 in Apache

On a default install of CentOS or Red Hat Enterprise Linux, the log rotation script will automatically rotate the Apache log file each day and then reload the httpd service. This post looks at how to prevent this action from occuring automatically, or to change the behaviour to rotate the log files if your naming convention for log files is different from the default.

Read more »

Changing the .htaccess filename in ApacheChanging the .htaccess filename in Apache

Posted April 17th, 2008 in Apache

Apache allows the use of .htaccess files which can change certain configuration options in a per-directory basis. By default .htaccess files are named .htaccess but it is possible to use a different name either for the whole server, or on a virtual host by virtual host basis. This post looks at how to change the filename used.

Read more »

Compressing files on Apache with mod_deflateCompressing files on Apache with mod_deflate

Posted November 6th, 2007 in Apache

It's possible with the Apache web server to compress files that are sent to the browser so less bandwidth is consumed and the load time should generally be faster. The module in Apache 2.0 and up is called mod_deflate (yes, that's rather unintuitive).

Read more »

Default virtualhost's secure certificate used with mod_sslDefault virtualhost's secure certificate used with mod_ssl

Posted September 21st, 2007 in Apache

After getting mod_ssl for Apache installed on CentOS 5 yesterday, I discovered when I actually went to test the site through the SSL server that it wasn't actually configured correctly and wasn't using the real secure certificate. Firefox and other web browsers alterted me that the certificate wasn't valid or was from an invalid or unknown certificate authority, despite actually having a valid certificate.

Read more »

Howto Restart ApacheHowto Restart Apache

Posted December 22nd, 2004 in Apache (Updated March 19th, 2007)

If you have made changes to the Apache configuration file httpd.conf, or one of the other included configuration files (eg vhosts.d files), you need to reload the Apache service for the changes to take effect.

Read more »

Installing AWStats on CentOSInstalling AWStats on CentOS

Posted September 26th, 2007 in Apache and Linux/Unix/BSD

AWStats provides a useful overview of website statistics from your Apache log files. There is no automatic way to install AWStats on CentOS using yum, so this article looks at how to install AWStats on CentOS. The instructions below should also work on other Linux distributions that do not have an automatic way of installing AWStats.

Read more »

Installing mod_ssl on Apache on CentOS 5Installing mod_ssl on Apache on CentOS 5

Posted September 20th, 2007 in Apache (Updated September 21st, 2007)

I was moving a customer's website from its old dedicated web server to a shiny new one, installing CentOS 5 on it with Apache 2.2 and MySQL 5.0. They already had a secure certificate running on the old site, so I copied the certificate files over and the secure server settings into the appropriate configuration file.

Read more »

Overriding the AWStats LogFile Configuration OptionOverriding the AWStats LogFile Configuration Option

Posted September 7th, 2007 in Apache and Linux/Unix/BSD

I run AWStats on one of my servers and it copies files over from some of the other servers I manage every 15 minutes and processes them. However, I had a server issue yesterday with the machine that AWStats runs on, and it meant the auto process which copies the files over and runs AWStats stopped running for about 12 hours. The end result was some lost information and needing to regenerate stats for the month to date. I needed to override the AWStats LogFile configuration directive on the command line to be able to do this.

Read more »

PHP Error Class 'SoapClient' not foundPHP Error Class 'SoapClient' not found

Posted September 25th, 2007 in Apache and PHP

I've often found that something gets left out or forgotten when moving a website from an old server to a new install. I've just finished migrating one of my customer's sites to a new CentOS 5.0 install with Apache 2.2 and PHP 5.1.6, and there's one single PHP script in the site which uses the SoapClient class.

Naturally I'd forgotten to test this particular function until after the migration was complete, and was wondering why the script had failed. A quick look in the Apache error log file revealed the following error message: PHP Fatal error: "Class 'SoapClient' not found"

Read more »

Redirecting an existing RSS feed to FeedburnerRedirecting an existing RSS feed to Feedburner

Posted December 19th, 2007 in Apache

Feedburner can host an RSS feed for you and provide useful statistics about the readers. If you already have an RSS feed running locally on your site, you can change the feed location to a Feedburner one and set up permanent redirects in Apache so that existing readers will be counted by Feedburner. I did this recently for my Linux CD Mall website, because I was interested to see how many readers I have utilising the feed. Until moving the RSS feed to Feedburner I had no idea how many there were.

Read more »

Sablotron 1.01 Core Dumps with PHP and ApacheSablotron 1.01 Core Dumps with PHP and Apache

Posted February 12th, 2004 in Apache and PHP (Updated May 24th, 2005)

There is a known problem with the Sablotron 1.01 libraries on PHP and Apache which can cause pages to not load and core dumps on the server for some XML files when using Apache and PHP.

Read more »

Seg fault or similar nasty error detected in the parent processSeg fault or similar nasty error detected in the parent process

Posted September 27th, 2007 in Apache

One of the servers I manage runs CentOS 5.0 with Apache 2.2 and PHP 5.1.6, and uses PHP's APC 3.0.14 (Alternative PHP Cache). We process the logs using AWStats every 15 minutes, and rotate the logs on a daily basis. However, after two or three days of working correctly, Apache would crash and we'd get the following in the log files: "seg fault or similar nasty error detected in the parent process"

Read more »

Use of www in website addressesUse of www in website addresses

Posted October 22nd, 2007 in Apache

Tim Berners-Lee is the creator of the "World Wide Web" and the www prefix used in so many website addresses was his "fault" :) It made sense at the time to have a different prefix for domains for different services such as ftp, email, websites and more. However, websites came to use both the www and non-www prefix for accessing them (eg www.example.com and example.com) and the www part has therefore become somewhat redundant.

This article looks at why I use the www version of the domain name as the primary domain name for my websites, and redirect traffic from the non-www version to the www version.

Read more »

Using Apache's Rewrite Engine with vhosts enabledUsing Apache's Rewrite Engine with vhosts enabled

Posted June 19th, 2007 in Apache

I am currently working on a project for a customer where I'm converting it from a static html site to a database driven site with a search engine and a consultant's name find function. I am using Codeigniter for this project, which uses Apache's mod_rewrite feature, but had some issues when I uploaded the project to the customer's web host due to it being set up with vhosts.

Read more »

Virtual Hosts and Secure CertificatesVirtual Hosts and Secure Certificates

Posted November 30th, 2003 in Apache (Updated March 19th, 2007)

The Apache web server can be configured to support SSL requests using the mod_ssl or apache-ssl modules (among others) and OpenSSL. To enable SSL on any webserver you need to have a secure certificate and a separate IP address per SSL secured domain.

Read more »