Showing posts from 2016

Apache - RewriteRule in htaccess vs httpd.conf

Typically Apache’s RewriteRule sets from mod_rewrite go in  .htaccess  files, but sometimes you have a good reason to put them in your general server config instead: your  httpd.conf  or apache2.conf  file (or a file you  Include  from one of those). If you’ve done this before, you’ve probably been surprised that it didn’t work quite the same. So while this works in .htaccess: RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule . /index.php [L] Putting the same thing in your VirtualHost doesn’t work at all: <VirtualHost *:80>     ServerName example .com     DocumentRoot /var/www/ example /     <Directory /var/www/example/>         Allow From All     </Directory>     RewriteEngine On     RewriteCond %{REQUEST_FILENAME} !-f     RewriteRule . /index.php [L] </VirtualHost> Apache doesn’t tell you  why  it doesn’t work. It just doesn’t work. You most likely will get an Error 500 status with a message

CentOS - LVM quick notes

Please refer to full documentation online - LVM Administrator's Guide Am not responsible if you break your server by following my notes. TIP : If not sure, always try on TEST server before running your commands on PRODUCTION. SCENARIO : There is a Fresh install of CentOS on VM (TEST Server) [root@localhost ~]# df -h Filesystem                    Size  Used Avail Use% Mounted on /dev/mapper/VolGroup-lv_root  6.7G  1.1G  5.3G  17% / tmpfs                         250M  4.0K  250M   1% /dev/shm /dev/sda1                     485M   31M  430M   7% /boot By default LVM is used. REQUIREMENT : Add new logical volume to the server (use existing Volume Group called "VolGroup"). STEPS : 1. add new Virtual Hard Disk (at VMWARE or VIRTUALBOX level) 2. fdisk -l ( e.g newly added disk is /dev/sdb) 3. pvcreate /dev/sdb 4. pvs (verify) 5. vgextend VolGroup /dev/sdb 6. vgs (verify) 7. lvcreate -L 450M -n mydata VolGroup  (create new logical volume of 450MB named &