Step to Recover Size of Ibdata1

  • Export / dumping all databases except 3 tables; information_schema, performance_schema, and mysql
  • Move ibdata1, ib_logfile0 and ib_logfile1 to / home or another folder just in case there is an error in the repair
  • Stop mysql
  • Edit /etc/mysql/my.cnf
innodb_file_per_table = 1
innodb_flush_method = O_DIRECT
innodb_log_file_size = 500M
innodb_buffer_pool_size = 1G
  • Large innodb_buffer_pool_size can be 4 fold or at least 2 times from innodb_log_file_size
  • Start mysql
  • Restore the database that we have exported. when restoring data, ibdata1 will get bigger but will only store metadata only, while the original data from each database will be created a folder and each folder will contain many files, each file represents a particular table.

Repository Ubuntu 14.04 Kambing UI

deb trusty main restricted universe multiverse
deb trusty-updates main restricted universe multiverse
deb trusty-security main restricted universe multiverse
deb trusty-backports main restricted universe multiverse
deb trusty-proposed main restricted universe multiverse

Panduan Instalasi LAMP+ Ubuntu 16.04 LTS di KiosK


  1. Instalasi Ubuntu 16.04 LTS
  2. Mengganti Repositori ke Kambing UI
  3. Instalasi Apache2.4.x Web Server
  4. Instalasi PHP5.6 Instalasi MariaDB 10.2.x
  5. Instalasi PHPMyAdmin
  6. Instalasi GNOME Classic
  7. Mengganti Desktop ke Gnome Classic

Dapat diunduh di: Panduan Instalasi LAMP+ di KiosK Ubuntu 16.04

Installing Python on Ubuntu 17.04

– Open browser, see
– Download the newest version of Python as tgz file for Unix/Linux
– Extract file
– Run ./configure or ./configure –enable-optimizations for any live optimazion
– Edit Modules/Setup file if you want customization Python
– make
– make install

Nginx Upstream prematurely closed FastCGI stdout while reading response header from upstream

Error Log:

Nginx Upstream prematurely closed FastCGI stdout while reading response header from upstream

Error Code

  • 502 Bad Gateway
  • 502 Proxy Error
  • 502 Bad Gateway NGINX
  • 502 Service Temporarily Overloaded
  • Error 502
  • HTTP 502
  • HTTP Error 502 – Bad Gateway

Cek tcp conn:

netstat -ant|awk '/tcp/ {print $6}'|sort|uniq -c

SetUp system /etc/sysctl.conf

net.core.somaxconn = 65536
fs.file-max = 2097152
net.ipv4.tcp_fin_timeout = 60
net.ipv4.tcp_keepalive_time = 7200
net.ipv4.tcp_keepalive_probes = 9
net.ipv4.tcp_keepalive_intvl = 75
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_tw_recycle = 1

Setup php-fpm pool: /etc/php/5.6/fpm/pool.d/www.conf


listen.owner = www-data = www-data
listen.mode = 0660
listen = /run/php/php5.6-fpm.sock
listen.backlog = 65536
pm = dynamic
pm.max_children = 300
pm.start_servers = 30
pm.min_spare_servers = 10
pm.max_spare_servers = 30
pm.max_requests = 400

or adjust to your needs

chown -R www-data:root /var/lib/nginx
chown -R www-data:root /var/lib/php
chmod 755 /var/lib/php/sessions
chown -R www-data:root /var/run/php/
chown -R www-data:root /usr/lib/nginx/modules
chown -R www-data:root /usr/lib/php/5.6

install php-xdebug!
Activated php-opcache!

Tweak Nginx.conf

#Adjust client timeouts
 client_max_body_size 0;
 client_body_buffer_size 1k;
 client_header_buffer_size 1k;
 large_client_header_buffers 1 2k;
 client_body_timeout 15s;
 client_header_timeout 15s;
 keepalive_timeout 15s;
 send_timeout 15s;
 sendfile on;
 tcp_nopush on;
 tcp_nodelay on;
#Adjust output buffers
 fastcgi_buffers 256 48k;
 fastcgi_buffer_size 48k;
 fastcgi_connect_timeout 15s;
 fastcgi_send_timeout 15s;
 fastcgi_read_timeout 15s;
 fastcgi_busy_buffers_size 256k;
 #fastcgi_temp_file_write_size 256k;
 fastcgi_max_temp_file_size 0;
 reset_timedout_connection on;
 server_names_hash_bucket_size 100;

Restart nginx & php-fpm!

Field ‘xxx’ doesn’t have a default value

Edit /etc/mysql/my.cnf

# If applications support it, this stricter sql_mode prevents $
# mistakes like inserting invalid dates etc.


MariaDB [(none)]> SELECT @@sql_mode;
| @@sql_mode |
1 row in set (0.00 sec)