Pages

Bài đăng phổ biến

Saturday, December 31, 2011

How To Update exim using a source rpm

In this how-to, we'll describe how to compile a new version of th exim src.rpm file in order to update exim.

We'll use exim 4.76 for the example, so if you need a new/older version, just replace all instances of that version with the version you want (assuming we have it on our server).


wget http://files.directadmin.com/services/da_exim-4.76-1.src.rpm
rpmbuild --rebuild --force da_exim-4.76-1.src.rpm
rpm -Uvh /usr/src/redhat/RPMS/i386/da_exim-4.76-1.i386.rpm
/etc/init.d/exim restart

If needed, use the --nodeps and/or --force options with the rpm command.


DirectAdmin

Check version by rpm

Check version by rpm .
Example check version of exim:
#rpm -qa|grep exim

Tuesday, December 27, 2011

How to Redirect non-www to www by .htaccess


Redirect www to non-www:
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^www.yourdomain.com [NC]
RewriteRule ^(.*)$ http://yourdomain.com/$1 [L,R=301]

Redirect non-www to www:RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^yourdomain.com [NC]
RewriteRule ^(.*)$ http://www.yourdomain.com/$1 [L,R=301]


Both of these rules send a full search engine friendly 301 HTTP redirect. They also preserve the entire URL (so yoursite.com/redirects to www.yoursite.com/).
Search engines can usually figure out which format is preferred, but since you're showing the same page for www and non-www URLs it can't hurt to be consistent about it.

Nguyen Si Nhan