Saturday, April 11, 2015

Redirecting to sub-folder in Hostgator using .htaccess

Step 1)
Create .htaccess file under public_html folder and paste the following code

RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www.)?main\-yourdomainname.com$ [NC]
RewriteCond %{REQUEST_URI} !^/sub\-folder/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /sub-folder/$1
RewriteCond %{HTTP_HOST} ^(www.)?main\-yourdomainname.com$ [NC]
RewriteRule ^(/)?$ sub-folder/index.php [L]

Step 2)
Open wp-config.php and paste the following code.
define('WP_HOME','http://yourdomainame.com/');
define('WP_SITEURL','http://yourdomainame.com/sub-folder');

Step 3)
Copy your index.php from sub-folder and paste it under public_folder and add the following code
require( dirname( __FILE__ ) . '/sub-folder/wp-blog-header.php' );

BINGO!!!
Refresh the url in your browser: www.yourdomainname.com and it should work!

Ref: http://webmaxformance.com/blog/web-development/setting-wp-subfolder-points-root-hostgator-account

Thursday, March 5, 2015

Wireshark on Ubuntu

Install wireshark in ubuntu

For super admin:
get wireshark and install
sudo apt-get install wireshark

Change the mode of the file dumpcap to allow execution sudo chmod 777 /usr/bin/dumpcap
Grant capabilities with setcap sudo setcap cap_net_raw,cap_net_admin=eip /usr/bin/dumpcap
Verify the change sudo getcap /usr/bin/dumpcap

For others:
get wireshark and install sudo apt-get install wireshark Add your username to the wireshark group sudo usermod -a -G wireshark YOUR_USER_NAME Change the group ownership of file dumpcap to wireshark sudo chgrp wireshark /usr/bin/dumpcap Change the mode of the file dumpcap to allow execution by the group wireshark sudo chmod 750 /usr/bin/dumpcap Grant capabilities with setcap sudo setcap cap_net_raw,cap_net_admin=eip /usr/bin/dumpcap Verify the change sudo getcap /usr/bin/dumpcap.

Ref: http://www.dickson.me.uk/2012/09/17/installing -wireshark-on-ubuntu-12-04-lts/

Wednesday, March 4, 2015

Phpmyadmin on Ubuntu 14.04

To install phpmyadmin on ubuntu 12.04 follow this steps:

1) ctrl + alt + T to open your terminal
2) type sudo apt-get install phpmyadmin
3) select Apache-2 on pop window and click enter
4) type in your mysql admin username and password and click enter
5) Congrats!! phpmyadmin is successfully installed on your machine.
Now..
open apache2.conf which is located in etc/apache2 using gedit or vim and add the following command.
# phpMyAdmin Configuration
Include /etc/phpmyadmin/apache.conf
click on save
6) restart your apache: sudo service apache2 restart
7) Go to your browser and type localhost/phpmyadmin in address bar. BINGO! it should work

If the above step fails don't worry follow this:

1) reconfigure your phpmyadmin by typing following command in your terminal:
sudo dpkg-reconfigure -plow phpmyadmin.

Click yes when configure phpmyadmin pop window shows up
enter mysql username and password and type "phpmyadmin" when pop window ask for database to be given access to administrator.
Select Apache2 and click yes. Phpmyadmin should configure
Create a symbolic link :
sudo ln -s /etc/phpmyadmin/apache.conf /etc/apache2/conf.d/phpmyadmin.conf (use this for ubuntu < 13.10)
sudo ln -s /etc/phpmyadmin/apache.conf /etc/apache2/conf-available/phpmyadmin.conf (use this for ubuntu >= 13.10)
reload your apache:
sudo a2enconf phpmyadmin
sudo /etc/init.d/apache2 reload
Go to your browser and type localhost/phpmyadmin in address bar. BINGO! this should work.

Ref: https://help.ubuntu.com/community/phpMyAdmin
http://howtofindsolution.blogspot.com/2012/12/how-to-fix-phpmyadmin-404-error-in.html
https://www.digitalocean.com/community/tutorials/how-to-install-and-secure-phpmyadmin-on-ubuntu-14-04