Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
techwiki:aws [2019/04/08 21:32]
ying [Instance is stuck and retiring]
techwiki:aws [2020/03/30 03:40] (current)
ying [Website Cant Do Editing and Disk is Full]
Line 74: Line 74:
   * tip:   * tip:
     * quit ssh by: exit     * quit ssh by: exit
 +
 +==== Disable PageSpeed on Apache ====
 +
 +  * when have pagespeed feature on Apache, it will auto create small size image when the webpage put a high res image in a small size form, like with width and height attribute. it can sometimes not useful when you really want to show the high res image in page and in a easy to view layout for people to zoom later.
 +
 +  * Disable pagespeed step:
 +    - ref: https://​docs.bitnami.com/​bch/​apps/​wordpress/​administration/​use-pagespeed/​
 +    - comment out pagespeed related line in httpd.conf
 +    - restart apache.
  
 ====== Backup and New EC2 Instance ====== ====== Backup and New EC2 Instance ======
Line 252: Line 261:
   * Problem: browse can't open website, long loading.   * Problem: browse can't open website, long loading.
     * solution: Go ssh in terminal and restart apache server     * solution: Go ssh in terminal and restart apache server
 +
 +===== Website Cant Do Editing and Disk is Full =====
 +
 +  - ssh into the server and check disk global size <​code>​df -h</​code>​
 +  - then you will see which partition is full, cd to that place to check each folder
 +    - to check current folder size: <​code>​du -sh .</​code>​
 +    - to list all sub folder with size info <​code>​du -sh *</​code>​
 +    - to list all file with size info <​code>​ls -lh</​code>​
 +  - potential Big Size eater
 +    - check A: go apache'​s log folder <​code>​apache2/​logs ​
 +error_log-*.gz
 +access_log-*.gz
 +</​code>​
 +    - check B: go apache'​s mod_pagespeed folder <​code>​
 +// https://​docs.bitnami.com/​aws/​apps/​orocrm/​administration/​use-pagespeed/​
 +// apache2/​var/​cache/​mod_pagespeed/​
 +// if you dont use that feature, just delete all inside
 +// rm -rf *
 +// restart apache ​
 +// (for bitnami: sudo /​opt/​bitnami/​ctlscript.sh restart apache)
 +</​code>​
 +    - check C: check mysql database folder
 +      - login mysql (for bitnami, same as main app pass) <​code>​mysql -u root -p</​code>​
 +      - check database size <code sql>
 +SELECT table_schema AS "​Database", ​
 +ROUND(SUM(data_length + index_length) / 1024 / 1024, 2) AS "Size (MB)" ​
 +FROM information_schema.TABLES ​
 +GROUP BY table_schema;​
 +</​code>​
 +      - check each database'​s table size <code sql>
 +SELECT table_name AS "​Table",​
 +ROUND(((data_length + index_length) / 1024 / 1024), 2) AS "Size (MB)"
 +FROM information_schema.TABLES
 +WHERE table_schema = "​database_name"​
 +ORDER BY (data_length + index_length) DESC;
 +</​code>​
 +      - type quit to exit mysql