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/mod_rewrite.so

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: domain.com/article.php?name=title&page=5
You want to change: domain.com/articles/title/5/
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

logo-samba

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

10.21.21.105  storage.test.com       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

username=storage/backuplinux

password=passwrod

And secure the file:

# chmod 600 /etc/cifspw

Then the last thing

mount -a

or

mount /mnt/storage

Now you copy the backup to /mnt/storage