Archive for the 'LinuX' Category

Apr 17 2017

Solution for hung_task_timeout_secs

Published by kusuma under LinuX

Solution for hung_task_timeout_secs


By default Linux uses up to 40% of the available memory for file system caching. After this mark has been reached the file system flushes all outstanding data to disk causing all following IOs going synchronous. For flushing out this data to disk this there is a time limit of 120 seconds by default. In the case here the IO subsystem is not fast enough to flush the data withing 120 seconds. As IO subsystem responds slowly and more requests are served, System Memory gets filled up resulting in the above error, thus serving HTTP requests.


I tested this theory with the following:
Change vm.dirty_ratio and vm.dirty_backgroud_ratio

someuser@servercore [/home/someuser]$ sudo sysctl -w vm.dirty_ratio=10
someuser@servercore [/home/someuser]$ sudo sysctl -w vm.dirty_background_ratio=5

Commit Change

someuser@servercore [/home/someuser]# sudo sysctl -p

Make it permanent

When the server seemed more stable and no Kernel/Swap/Memory Panic for a week, I edited /etc/sysctl.conf file to make these permanent after reboot.

someuser@servercore [/home/someuser]$ sudo vi /etc/sysctl.conf

ADD 2 lines at the bottom

vm.dirty_background_ratio = 5
vm.dirty_ratio = 10

Save and exit.

someuser@servercore [/home/someuser]$ sudo reboot

That’s it. I never had this issue .. ever again..

saduran dari

No responses yet

Sep 20 2016

Bermasalah dengan suexec

Published by kusuma under LinuX

apt-get install apache2-suexec-custom
cd /etc/apache2/suexec
nano www-data
replace the line “/var/www” with “/home” (without “” )
restart apache
end of history. cha-chaaaan!
it’s work

No responses yet

Aug 05 2016

Cara Mount Network Storage di Ubuntu server Permanenet

Published by kusuma under LinuX

Pertama isnstall dulu perlengkapannya antara lain seperti dibawah ini :

1. apt-get install cifs-utils

2. apt-get install smbclient

Saya asumsikan network storagenya di pasword !!

BUat file untuk menyimpan pasword networknya.langkahnya sebagai berikut :

1. nano /root/.smbcredentials

2.isi di dalamnya dengan format seperti berikut

3. chmod 700 /root/.smbcredentials

Setelah selesai diatas kita edit fstabnya langkahnya. jgn lupa fstab dibackup seperti berikut:

1. cp /etc/fstab /etc/fstab_old

2. nano /etc/fstab

di tulis dipaling bawah :

//    /var/www/html        cifs    credentials=/root/.smbcredentials,iocharset=utf8,file_mode=0777,dir_mode=0777 0 0

maksudnya : = ip network storage yang bisa diping oleh si server
web  = folder di storage kalo sub folder biasanya ndak bisa mending root folder saja
/var/www/html = folder html sebagai letak mount storagenya

3. buat folder html dulu langkahnya

mkdir /var/www/html

4. langkah terakhir ketik

mount -a

No responses yet

Jul 29 2016

Mengaktifkan Mod_Rewrite

Published by kusuma under LinuX

Caranya, buka terminal (ctrl+alt-T) :
lalu ketikkan srtipt bertikut :

sudo a2enmod rewrite
sudo /etc/init.d/apache2 restart

kemudian edit file /etc/apache2/sites-available/default dan ganti AllowOverride None menjadi AllowOverride All,
Seperti contoh :

<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all

kemudian reboot komputer anda.

Untuk mengetahui apakan mod_rewrite aktif atau tidak dapat kita ketahui melalui phpinfo, caranya dengan mambuat file info.php pada /var/www, dan isi dengan

<?php phpinfo(); ?>

Save lalu buka browser dan lihat dengan mengetikkan:

pada apache2handler, bagian loaded modules cari mod_rewrite, jika sudah ada maka mod_rewrite sudah aktif.
Semoga bermanfaat…

No responses yet

Feb 25 2015

Apache di ubuntu 12:04

Published by kusuma under LinuX

Apache 2 Web Server on Ubuntu 12.04 LTS (Precise Pangolin)

Updated Friday, January 10th, 2014 by Linode

This tutorial explains how to install and configure the Apache web server on Ubuntu 12.04 (Precise Pangolin). All configuration will be done through the terminal; make sure you are logged in as root via SSH. If you have not followed the getting started guide, it is recommended that you do so prior to beginning this guide. Also note that if you’re looking to install a full LAMP stack, you may want to consider using our LAMP guides.

Set the Hostname

Before you begin installing and configuring the components described in this guide, please make sure you’ve followed our instructions for setting your hostname. Issue the following commands to make sure it is set properly:

hostname -f

The first command should show your short hostname, and the second should show your fully qualified domain name (FQDN).

Install Apache 2

Make sure your package repositories and installed programs are up to date by issuing the following commands:

apt-get update
apt-get upgrade --show-upgraded

Enter the following command to install the Apache 2 web server, its documentation and a collection of utilities.

apt-get install apache2 apache2-doc apache2-utils

Edit the main Apache configuration file to adjust the resource use settings. The settings shown below are a good starting point for a Linode 1GB.

KeepAlive Off


<IfModule mpm_prefork_module>
StartServers 2
MinSpareServers 6
MaxSpareServers 12
MaxClients 80
MaxRequestsPerChild 3000

Install Support for Scripting

The following commands are optional, and should be run if you want to have support within Apache for server-side scripting in PHP, Ruby, Python, or Perl.

To install Ruby support, issue the following command:

apt-get install libapache2-mod-ruby

To install Perl support, issue the following command:

apt-get install libapache2-mod-perl2

To install Python support, issue the following command:

apt-get install libapache2-mod-python

If you need support for MySQL in Python, you will also need to install Python MySQL support:

apt-get install python-mysqldb

Your PHP application may require additional dependencies included in Ubuntu. To check for available PHP dependencies run apt-cache search php, which will provide a list of package names and descriptions. To install, issue the following command:

apt-get install libapache2-mod-php5 php5 php-pear php5-xcache

Issue the following command to install the php5-suhosin package, which provides additional security to your PHP installation:

apt-get install php5-suhosin

If you’re also hoping to run PHP with MySQL, then also install MySQL support:

apt-get install php5-mysql

No responses yet

Next »