Mar 20

In order to enable the mod_rewrite module in the Ubuntu server issue the following command:

# a2enmod rewrite

The above Apache2 Enable Module command will add the correct line in the /etc/apache2/apache2.conf file. The precise command will be added on /etc/apache2/mods-enabled/rewrite.load

LoadModule rewrite_module /usr/lib/apache2/modules/

then restart your apache2

#/etc/init.d/apache2 restart

then checked your apache modules on your phpinfo, create phpinfo.php on your web root directory

<? phpinfo(); ?>

then browse it

New Picture

Simple test:

Nice looking URLs (no querying) with pagination:
Suppose your url is:
You want to change:
Then write in .htaccess file:
RewriteRule ^articles/(A-Za-z0-9-]+)/([0-9]+)/?$ article.php?name=$1&page=$2 [L]

The rule is defined in regular expression. Here [L] means Last Rule. It’s called RewriteRule Flags.

Oct 08

The reason i make this article is because i want to connect windows sharing folder and i need to copy my backup to windows SAN storage, you need samba to connect


What is SAMBA ?

Samba is the standard Windows interoperability suite of programs for Linux and Unix.

Samba is Free Software licensed under the GNU General Public License, the Samba project is a member of the Software Freedom Conservancy.

Since 1992, Samba has provided secure, stable and fast file and print services for all clients using the SMB/CIFS protocol, such as all versions of DOS and Windows, OS/2, Linux and many others.

Samba is an important component to seamlessly integrate Linux/Unix Servers and Desktops into Active Directory environments using the winbind daemon.

Okay let’s start the connection .

First, you need to install samba first

on Ubuntu

# apt-get install samba smbfs

on CentOS

# yum install samba samba-client

Then to make it easier, edit your /etc/hosts file and give the Windows machine a name:

#vim /etc/hosts       storage

Create a directory where the share will appear on your local filesystem.

# mkdir /mnt/storage

Edit /etc/fstab and add a line for the mount. Here “storage” is the name of the machine and “backuplinux$” is the name of the share.

# vim /etc/fstab

//storage\backuplinux$ /mnt/storage cifs exec,credentials=/etc/cifspw 0 0

Create a password file /etc/cifspw with the login credentials for your Windows account.

# vim /etc/cifspw



And secure the file:

# chmod 600 /etc/cifspw

Then the last thing

mount -a


mount /mnt/storage

Now you copy the backup to /mnt/storage