Tuesday 22 October 2019

htaccess redirect

RewriteEngine On
RewriteCond %{HTTP_HOST} ^example.com$ [NC]
RewriteRule ^(.*)$ https://www.example.com/$1 [L,R=301]
 
 
good reference: 
https://my.bluehost.com/hosting/help/htaccess_redirect 

Wednesday 2 October 2019

elgg css issue not displaying site properly

 REf: http://learn.elgg.org/en/stable/intro/install.html
 
The .htaccess, if not generated automatically (that happens when you
have problem with mod_rewrite), you can create it by renaming
install/config/htaccess.dist file you find with elgg package to .htaccess. 



you may see like below if u view source 

view-source:https://demo.whyscience.com/css/elgg.1570080191.css?view=default

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>404 Not Found</title> </head><body> <h1>Not Found</h1> <p>The requested URL /css/elgg.1570080191.css was not found on this server.</p> </body></html>

mysqldump from remote host and copy to another database


mysqldump -h waaadb.cc5sssssss4rddmp.us-dddd.rds.amazonaws.com -u wsssssl -p databaseName > filename.sql
Enter password:

mysql -u root -p databaseName < ./filename.sql

Enter password:


Tuesday 1 October 2019

connect mysql from command line in bitnami installation

mysql -u root -p
Enter password:

password is the root password generated during installation of bitnami lamp stock

Ref:
https://docs.bitnami.com/aws/infrastructure/lamp/get-started/find-credentials-link-mysql/

Linux command to move content of a foler to another folder

/bitnami$ sudo cp -R apps//htdocs/* /opt/apache2/htdocs

mount additional storage disk in AWS Lightsail instances

mount additional storage disk in AWS Lightsail instances

1. bitnami@/opt/bitnami/apache2/htdocsCopy$ lsblk

NAME    MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
xvda    202:0    0  20G  0 disk
└─xvda1 202:1    0  20G  0 part
/xvdf    202:80   0   8G  0 disk


2. bitnami@/opt/bitnami/apache2/htdocsCopy$ sudo file -s /dev/xvdf

/dev/xvdf: data


3. bitnami@/opt/bitnami/apache2/htdocsCopy$ sudo mkfs -t ext4 /dev/xvdf

mke2fs 1.42.13 (17-May-2015)
Creating filesystem with 2097152 4k blocks and 524288 inodes
Filesystem UUID: 0d51c225-806f-4121-a2b5-29d5852425fe
Superblock backups stored on blocks:
    32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632

Allocating group tables: done                           
Writing inode tables: done                           
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done


4. (command 2 again) bitnami@/opt/bitnami/apache2/htdocsCopy$ sudo file -s /dev/xvdf

/dev/xvdf: Linux rev 1.0 ext4 filesystem data, UUID=0d51c25-86f-4121-a2b5-29fe (extents) (large files) (huge files)


4.1 bitnami@/opt/bitnami/apache2/htdocsCopy$ cd / - i prefer to create a directry at the roo as the mount point and then mount the devic on thi spoint (5, 6)

5. itnami@:/$ sudo mkdir me
6. bitnami@:/$ sudo mount /dev/xvdf /me