Ubuntu server

    How to install php on AWS EC2 instance with Amazon MySQL RDS On Ubuntu

    Execute this command: (Remove which you don't need)

    ubuntu@mohitsharma.net$: sudo apt-get install apache2 libapache2-mod-php5 php5-mysql postfix mysql-client unzip php5-memcache php5-curl memcached php5-gd

    How to give SSH Key access to user on Amazon EC2 Server

    To add ssh key access to users on Amazon EC2 follow these steps Note: upload user public key file in .ssh/id_rsa.pub 1. Add New User: useradd -c "Mohit Sharma" mohit 2. Navigate to user directory: cd /home/mohit 3. Create .ssh directory: mkdir .ssh 4. Give Permission: chmod 700 .ssh 5. Set Diretory Group and Onwer Permission: chown user:user .ssh 6. Write uploaded key to authorized_keys: cat id_rsa.pub >> .ssh/authorized_keys 7. Give Permission: chmod 600 .ssh/authorized_keys 8.

    wkhtmltopdf: cannot connect to X server on ubuntu server

    To fix wkhtmltopdf: cannot connect to X server on ubuntu server Follow the steps: Note: Check latest versions here: http://download.gna.org/wkhtmltopdf/
    Download it

    $: wget -q "http://download.gna.org/wkhtmltopdf/0.12/0.12.2/wkhtmltox-0.12.2_linux-trusty-amd64.deb"

    Install it

    $: sudo dkpg -i  "http://download.gna.org/wkhtmltopdf/0.12/0.12.2/wkhtmltox-0.12.2_linux-trusty-amd64.deb"


    To install dependencies

    $: sudo apt-get -f install
    If still issue do sudo apt-get install xvfb

    How to install phpmyadmin with php7 on ubuntu 14.04

    Go to directory /usr/share :$ cd /usr/share Download PhpMyAdmin there :$ sudo wget "https://files.phpmyadmin.net/phpMyAdmin/4.5.4.1/phpMyAdmin-4.5.4.1-all-languages.zip" Unzip content :$ sudo unzip phpMyAdmin-4.5.4.1-all-languages.zip Rename Directory :$ sudo mv phpMyAdmin-4.5.4.1-all-languages phpmyadmin Give Recursive permission for execution :$ sudo chmod -R 0755 phpmyadmin Add phpmyadmin to apache2 default configuration file :$ sudo vim /etc/apache2/sites-available/000-default.conf Add below lines after DocumentRoot Alias /phpmyadmin "/usr/sha

    How to create new user in mysql

    To create new user in mysql. Login to mysql and run following commands:
    mysql> CREATE USER 'mohitsharma'@'localhost' IDENTIFIED BY 'secretpassword';

    mysql> GRANT ALL PRIVILEGES ON * . * TO 'mohitsharma'@'localhost';

    to grant specific permission to table to database will be covered in other chapter


    mysql> FLUSH PRIVILEGES;

    mysql> exit

    $: mysql -u mohitsharma -p and Enter
    Easy & Done :)

    How to install LAMP Linux Apache Mysql PHP on ubuntu 14.04 LTS

    To Install LAMP on Ubuntu 14.04 LTS Simply Type these commands Install Apache $: sudo apt-get update $: sudo apt-get install apache2 Install Mysql $: sudo apt-get install mysql-server php5-mysql Secure mysql $: sudo mysql_install_db $: sudo mysql_secure_installation Choose options whatever you need Install PHP $: sudo apt-get install php5 libapache2-mod-php5 php5-mcrypt PHP File Configuration to select from directory $: sudo vi /etc/apache2/mods-enabled/dir.conf and paste DirectoryIndex index.php index.html index.

    How to diagnose disk full problem linux

    Find all files greate then 10M size

    sudo find / -type f -size +10M -exec ls -lh {} \;

    in the output look for log files and make them empty

    cat dev/null > logfile_path

    How to read file live log file on ubuntu / linux?

    You can do this using below command. Open terminal and write the command below you will see the live view of the file and new entries will be shown in the end
    ubuntu~$: tail -f /path-to-logfile/filename.log

    How to remove nodejs from ubuntu server?

    Run these commands

    $: which node
    /usr/local/bin/node

    then run

    $: cd /usr/local/

    then run

    $: rm -r bin/node bin/node-waf include/node lib/node lib/pkgconfig/nodejs.pc share/man/man1/node.1

    Done