Monday, September 1, 2014

Apache Uthentication for single Page

If you don’t current have an .htpasswd, use the “-c” option to create the file with the first user. It will prompt you for a password and encrypt it for you.

htpasswd -c /var/www/domain.com/public_html/.htpasswd user1

Copy and Paste following in .htaccess (Change path and file name according to your ewquirement)
AuthUserFile /PATH-TO-HTPASSWD/.htpasswd
  AuthName "My restricted Area"
  AuthType Basic
# ErrorDocument 401 /test.php
  <Files "vox-videos.html">
   require valid-user
   </Files>

Monday, July 21, 2014

Get the phpMyAdmin's Visual Query Designer

Step 1) open phpMyAdmin/config.inc.php and modify the below lines of code.

/* change this info to whatever user has read-only access to the "mysql/user" and "mysql/db" tables */         
    $cfg['Servers'][$i]['controluser']   = 'root'; //this is the default user for MAMP's mysql
    $cfg['Servers'][$i]['controlpass']   = 'root'; //this is the default password for MAMP's mysql

/* this information needs to line up with the database we're about to create so don't edit it unless you plan on editing the SQL we're about to run */
    $cfg['Servers'][$i]['pmadb'] = 'phpmyadmin'; 
    $cfg['Servers'][$i]['bookmarktable'] = 'pma__bookmark';
    $cfg['Servers'][$i]['relation'] = 'pma__relation';
    $cfg['Servers'][$i]['table_info'] = 'pma__table_info';
    $cfg['Servers'][$i]['table_coords'] = 'pma__table_coords';
    $cfg['Servers'][$i]['pdf_pages'] = 'pma__pdf_pages';
    $cfg['Servers'][$i]['column_info'] = 'pma__column_info';
    $cfg['Servers'][$i]['history'] = 'pma__history';
    $cfg['Servers'][$i]['table_uiprefs'] = 'pma__table_uiprefs';
    $cfg['Servers'][$i]['tracking'] = 'pma__tracking';
    $cfg['Servers'][$i]['designer_coords'] = 'pma__designer_coords';
    $cfg['Servers'][$i]['userconfig'] = 'pma__userconfig';


Step 2)    phpMyAdmin installs with the SQL we need to generate the database that the Designer relies on. We just need to locate the script. In 4.0.7 the file location is phpMyAdmin/examples/create_tables.sql. Alternatively, you can copy/download this from phpMyAdmin's github.
Once you locate the file, either import the file or copy/paste it into a SQL window and execute in phpMyAdmin.
Now, everything should be configured properly. We need to clear cookies and restart the browser.
When you open phpMyAdmin back up, navigate to a specific table and in the tabs you should see Designer tab.

Thursday, July 17, 2014

htaccess rules

# ---- Make pages render without their extension in the url
Options +MultiViews


404 custom file not found page

ErrorDocument 404 /filenotfound.php


Prevent directory or File listing :

IndexIgnore *

Redirect entire domain to another domain

Redirect 301 / http://www.devaraju.com/

Redrect individual pages

Redirect 301 /old.html http://www.devaraju.com/new.html

Redirect entire domain to respective pages

RewriteCond %{HTTP_HOST} !^www.\devaraju\.com
RewriteRule (.*) http://www.devaraju.com/$1 [R=301,L]