27 May 2017

Linux Ubuntu Commands -

Linux Ubuntu Commands -

1. Grant Permissions on folder & It's files =>  sudo chmod -R 777 /var/www/html[Path]

2. Check Permissions on folder/files =>  

a).   ls -l  
b).  ls  -la /var/www/

3. Command to access terminal from root user => sudo su

4. MySql Access Command =>   mysql -u username -p

5. Database Show Command => Show Databases;

6. Select Database Command => Use Database Name;

7. See Structure of folder & files => tree

8. Command to correct the apache permission to www folder -

a). sudo chown -R www-data:www-data /var/www/

Refer the following link -
            https://www.digitalocean.com/community/questions/setting-permissions-for-wordpress

9. Mysql DB Export Database Command -

Syntax -  mysqldump -u USER_NAME -p DB_NAME > FILE_NAME.sql

e.g.   mysqldump -u motormanager -p motormanager > motormanager_ravi_bkp_july_2018.sql

10. MySql DB import Database Command -

  source  PATH/FILE_NAME.sql





18 May 2017

Install LAMP on Ubuntu

Install LAMP on Ubuntu -
    https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu-16-04

Proper LAMP Setup on Ubuntu -

1. Install & enable mbstring module

2. Install phpmyadmin on Ubunttu & add (in file/etc/apache2/apache2.conf )

#Include the phpmyadmin configuration
Include /etc/phpmyadmin/apache.conf

3. Following changes will be needed to work htaccess properly,
/etc/apache2/apache2.conf file. 
First, find
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
And change AllowOverride None to All and save.
Then enable mode rewrite using the command(In this case already enabeled),
$ sudo a2enmod rewrite
Then restart the server,
$ sudo /etc/init.d/apache2 restart
Run the project.