For the sake of SEO is better to have one URL for each post or article on your site, like having two uris respond with the same content can lead to duplicate content and is penalized by search engines, especially Google, which is the largest by far.

Therefore, if you’re using Nginx and want to remove the trailing slash at the end of every URI in your site.

So if someone writes: will be automatically redirected to

Here is the code needed to put it in your nginx.conf.

rewrite ^/(.*)/$ /$1 permanent;

That goes in the server section so something like this:

server {
listen  :80;
rewrite ^/(.*)/$ /$1 permanent;

Nginx will handle the trailing slashes now.

1. Configure The Master
First we have to edit /etc/mysql/my.cnf

We have to enable networking for MySQL, and MySQL should listen on all IP addresses, therefore we comment out these lines (if existant):

#bind-address            =

Furthermorewe have to tell MySQL for which database it should write logs,which log file it should use, and we have to specify that this MySQLserver is the master. We want to replicate the database exampledb, so we put the following lines into /etc/mysql/my.cnf:

log-bin = /var/log/mysql/mysql-bin.log

# what database you want to replication



Then we restart MySQL:

/etc/init.d/mysql restart

Then we log into the MySQL database as root and create a user with replication privileges:

mysql -u root -p
Enter password:

GRANT REPLICATION SLAVE ON *.* TO ‘slave_user’@’%’ IDENTIFIED BY ‘<your_password>’;

Next do this:


Now leave the MySQL shell:

Continue Reading…

You may be concerned about the security of your servers, and you should know that hackers often try to break your server

One way to secure your LAMP server would stop Apache and PHP5 to send details of their versions or other valuable informations.

1. How to hide Apache2 version?

Continue Reading…

The Wine development release 1.3.25 is now available.

What's new in this release (see below for details):
  - Rewrite of the audio support, using the Win7 architecture.
  - Old-style sound drivers for Jack, NAS and ESD are removed.
  - Graphics driver architecture changes for the DIB engine.
  - Improved handling of the shell recycle bin.
  - Better joystick support in DirectInput.
  - Initial stub for VBScript support.
  - Various bug fixes.

The source is available from the following locations:

Binary packages for various distributions will be available from:

Continue Reading…

Nginx Canonical Domain

Valic —  July 19, 2011 — Leave a comment
############# www to non-www
  listen 80;
  rewrite ^(.*)$1 permanent;

############# non-www to www
server {
  if ($host ~* ^([a-z0-9\-]+\.(com|net|org))$) {
    set $host_with_www www.$1;
    rewrite ^(.*)$ http://$host_with_www$1 permanent;

Page 1 of 3123