Ubuntu server

    How to Search string on server

    grep -r -l "some text here to search" .

    How to do php mysql and apache2 setup on amazon ec2 ubuntu

    See here


    Opening Port 80 or http on ec2

    1. Click security group in left bar

    2. then select security group for instance

    3. then select inbound rule

    4 add rule for http and done

    How to flush dns cache ubuntu

    First install nscd

    mohit@mohit-Inspiron-580s:$ sudo apt-get install nscd


    mohit@mohit-Inspiron-580s:$ sudo /etc/init.d/nscd restart


    allownopassword phpmyadmin allowing no password to login

    To allow no password in phpmyadmin login you have to edit phpmyadmin config file and set allow no password to true to do this open terminal and first edit config file
    ubuntu@mypc$ sudo gedit /etc/phpmyadmin/config.inc.php

    Then find below line uncomment if commented and set TRUE, FALSE accordingly.

    $cfg['Servers'][$i]['AllowNoPassword'] = TRUE;

    How to change directory ownership in ubuntu

    To change directory ownership in ubuntu Open terminal and give following command
    mohit@ubuntu$: chown -hR <username>  <directory_path/name>

    where <username> is the user to give ownership and <directory_path/name> is the directory or path to directory

    How to transfer file from one server to other via scp

    To transfer file from one server to another using scp 1. Open terminal and connect to server via ssh
    mohit@ubuntu: ssh usrname@mohitsharma.net
    Enter password:

    username@mohitsharma.net ]:

    Go to directory from where file is to be transfered

    Then type following command

    username@mohitsharma.net ]: scp filename username@remoterhost:<pathtofile>


    Add to known host yes

    Enter remote password

    its starts transfer and file will be transfered

    How to install java jdk on ubuntu

    To install java on ubuntu follow the steps
    1. First to get update
    mohit sharama@ubuntu $:  sudo apt-get update

    2. Install jdk and plugin

    mohit sharama@ubuntu $: sudo apt-get install sun-java6-jdk sun-java6-plugin

    3. Check if its installed fine and version installed

    mohit sharama@ubuntu $:  java -version

    How do we always show sidebar in ubuntu

    Follow there steps to always show the sidebar in ubuntu

    1. First of all install CompizConfig Settings Manager

    2. Open the manager type about:config in ubuntu search and open. To open ubuntu search you can use shortcut ALT+F2 from keyboard

    3. In behaviour tab on the opened window you see hide launcher dropdown select "never" from there and you are done

    How to install LAMP(Apache, PHP, MySQL) on ubuntu

    We can install these things simply using few commands on terminal. Follow these steps 1. Login with root user and open terminal root@ubuntu:/ apt-get install mysql-server mysql-client Enter root mysql password two times 2. Next to install apache2 root@ubuntu:/ apt-get install apache2 After installation verify if your sever working correctly visit in browser 3. Next to install PHP root@ubuntu:/ apt-get install php5 libapache2-mod-php5 4. After installation restart apache2 root@ubuntu:/ /etc/init.d/apache2 restart 5.