Why is my .htaccess not working?
Tuesday October 21st 2008, 10:58 am
Filed under: Linux Server Administration, Tips and Tricks

If you have a VPS or Linux server running Apache the goold old fashioned way without fancy control panels, you’ll quickly have to learn some Apache tweaks.

One of the main issues we commonly run into is a non-working .htaccess file.  Apache doesn’t come with .htaccess support automatically turned on.  You’ll have to turn it on in order for .htaccess files to have an effect.  Here’s what you do:

There are two ways,

  1. Edit your httpd.conf manually using a text editor like vim, nano, vi, joe whatever you like.
  2. Edit your httpd.conf through Webmin

Since the Webmin version is more graphical, we’ll show you how to do it through Webmin.  If you’re using a text editor, just skip to the portion with the AllowOveride command.

  1. Login to your Webmin
  2. Servers>Apache
  3. Go to the Global Configuration tab
  4. Click on EDIT CONFIG FILES
  5. Search for AllowOveride and .htaccess and remove the # sign in front or type “AllowOveride All”.

This should fix it permanently and allow your .htaccess files to override pretty much and directive needed.



HOWTO: Install PDFLite/PDFLib on a Centos/RHEL server
Friday June 20th 2008, 6:12 am
Filed under: Linux Server Administration

We recently helped a client install PDFLite on their server and it was a little more quirky than usual so we thought we’d share the installation process.

First of all, PDF Lite is the stripped down but free version of PDFLib. This library allows you to generate PDF files and can be quite handy. The easiest thing is to confuse the two versions, we’re using the Lite version which doesn’t have as many features but it’s free and doesn’t watermark your PDFs. The Lite version is good for just messing around with but if this is a commercial endeavor, you should get the full version found here : http://www.pdflib.com/

This tutorial installs the FREE Lite package version 7.03. Alright, let’s get started:
OS: CentOS 4.5/5,RHEL 4/5
Requires: PECL to be running and available and most likely has to be done as the root user

cd /usr/src
wget http://www.pdflib.com/binaries/PDFlib/703/PDFlib-Lite-7.0.3.tar.gz
tar xzpf PDFlib-Lite-7.0.3.tar.gz
cd PDFlib-Lite-7.0.3
./configure
make
make install
pecl install pdflib

The system will now ask you for the installation location of pdflib (path to pdflib installation?), put in:
/usr/local

Once it’s done installing, let’s finish this up:
cp /usr/local/lib/libpdf.so /usr/include/php/ext
echo "[libpdf]” >> /etc/php.ini
echo “extension=pdf.so” >> /etc/php.ini
service httpd restart

That should do it, check your phpinfo to make sure it works and go make some PDFs.



HOW TO: Optimize Wordpress + Memcache and eAccelerator
Wednesday June 18th 2008, 2:54 pm
Filed under: Linux Server Administration

We’ll do a complete tutorial in this blog series. Hopefully we can get this done in 3 main blog posts and then an accompanying post with some information about using Memcache in other common PHP scripts such as vBulletin, IPBoard, Joomla, etc.

Part 1 - Install Memcache

Part 2 - Install eAcclerator

Part 3 - Modify Wordpress to use Memcache + eAccelerator

PART 1 of 3: Memcache
Memcache aka Memcached is:

a high-performance, distributed memory object caching system, generic in nature, but intended for use in speeding up dynamic web applications by alleviating database load

In layman’s terms, it’s a caching system using RAM to cache your website and make it run quicker. Why would Memcache speed up your site? It basically takes your often hit pages and caches it into RAM. By caching it into RAM, your page doesn’t need to be regenerated as the information is still in memory. Large websites have huge Memcache server farms whose sole purpose is to cache data for quick retrieval, that’s how the big boys do it. Even Howard Stern uses Memcache.

Well we might not have millions of hits and gigabytes of Memcache but even a little bit of Memcache can help medium traffic sites. No, memcache is not for everybody, it doesn’t do you much good if your site doesn’t see much traffic. But if you have a popular Wordpress Blog or vBulletin forum, a little Memcache can go a long way.

We have found that Memcache + eAccelerator greatly increases the speed of your site and reduces the overall server load. So you might ask, how do I get Memcache working with Wordpress, let’s get started:

NOTE: This article assumes that you have root/admin access to your server. If you are on a hosted/shared webserver, just ask your hosting company to do the work for you and skip to the Wordpress Memcache plugin section.
(more…)