Finally I’ve gotten the site back up and running.
I have a new Age Gate module for Drupal 7. Its called new age gate. It uses css and javascript to do its magic and is SEO and static page cache friendly. This new module also has a number of configuration options that you can set in the Drupal admin interface so you don’t need to edit the module to change what it says.
I was unhappy with the performance of our Drupal websites when using them logged in. We have a local test machine that is LAMP (Linux, Apahce, MySQL, PHP) and it was had page load times of over a second quicker than the production server that is WIMP (Windows, IIS, MySQL, PHP). While the machine are using different OS and Webservers that didn’t account for the issues. Using the Devel module it was telling me the MySQL queries were almost identical between the two machines but the page execution time was significantly slower on the production machine.
After using a profiling extension for PHP I tracked down the problem. PDO was taking over a second (!) to connect to the MySQL database on localhost. After much searching around it turns out the problem seems to be due to MySQL having issues with resolving names with IPv6 addresses. Windows Server 2008 R2 by default returns an IPv6 (::1) and IPv4 (127.0.0.1) address for localhost. In order to work around the issue I needed to add ‘127.0.0.1 localhost’ to the servers \Windows\System32\etc\hosts file. It should be noted for anyone else doing the same, make sure there is no IPv6 address for localhost in the hosts file either.
After making the change, database connections were instant and the performance of the sites improved considerably.
After not being able to find a module that worked quite as we wanted, I created a simple Age Gate module for Drupal 7. This module very basic and has various hardcoded paths in it.
The module redirects all anonymous users to the agegate page and requires that they check the ‘Over 18’ checkbox before they can view content on the site. If they don’t check to box and press submit they get redirected to a page at the path ‘access-denied’ (this is the page we use on our site). The module is coded to allow non agegate access to logged in users, the ‘user/login’ page and the ‘access-denied’ page.
Download it here. Module is provided as is. Agegate Module for Drupal 7
D3D FSAA Viewer is a tool to examine the Antialiasing sampling pattern used by 3D Accelerator cards. Its an old program that I wrote, that has been very useful for a lot of people, in particular when reviewing graphics cards. Expand the post for download links. Continue reading »