Pages

Saturday, March 29, 2014

Connection Mysql 5 Lambat


Connection mysql lambat karena Server selalu akan nge-resolve name dari client yang connect.

solusinya  Edit file my.cnf

kalo di centos :

#vim /etc/my.cnf 

Kemudian tambahkan dibaris terakhir :

skip-name-resolve


Kemudian Simpan dan restart service Mysqld

#service mysqld Restart

Thursday, March 20, 2014

Mengenal Keluarga Linux


Mengenal Varian Distro-Distro Linux
Distro Linux (singkatan dari distribusi Linux) adalah sebutan untuk sistem operasi komputer dan aplikasinya, merupakan keluarga Unix yang menggunakan kernel Linux. Distribusi Linux bisa berupa perangkat lunak bebas dan bisa juga berupa perangkat lunak komersial seperti Red Hat Enterprise, SuSE, dan lain-lain.

Ada banyak distribusi atau distro Linux yang telah muncul. Beberapa bertahan dan besar, bahkan sampai menghasilkan distro turunan, contohnya adalah Distro Debian GNU/Linux. Distro ini telah menghasilkan puluhan distro anak, antara lain Ubuntu, Knoppix, Xandros, DSL, dan sebagainya.
Untuk mendapatkan distro linux, anda dapat mendownloadnya langsung dari situs distributor distro bersangkutan, atau membelinya dari penjual lokal.
Terdapat banyak distribusi Linux (lebih dikenali sebagai distro) yang dibuat oleh individu, grup, atau lembaga lain. Masing-masing disertakan dengan program sistem dan program aplikasi tambahan, di samping menyertakan suatu program yang memasang keseluruhan sistem di komputer (installer program).
Inti di setiap distribusi Linux adalah kernel, koleksi program dari proyek GNU (atau proyek lain), cangkang (shell), dan aturcara utilitas seperti pustaka (libraries), kompilator, dan penyunting (editor). Kebanyakan sistem juga menyertakan aturcara dan utilitas yang bukan-GNU. Bagaimanapun, utilitas tersebut dapat dipisahkan dan sistem ala UNIX masih tersedia. Beberapa contoh adalah aturcara dan utiliti dari BSD dan sistem grafik-X (X-Window System). X menyediakan antarmuka grafis (GUI) yang umum untuk Linux.
Distribusi-distribusi Linux dapat dikategorikan berdasarkan sistem manajemen paket, bebas dan tidak, tujuan pembuatan, perangkat lunak dasar yang digunakan, dan lain sebagainya.

Wednesday, March 19, 2014

How Do I Change Existing User's Home Directory to other location?

You need to use the usermod command to set the user's new login directory. The syntax is as follows:


usermod -m -d /path/to/new/home/dir userNameHere

Where:
-d dirnanme : Path to new login (home) directory.
-m : The contents of the current home directory will be moved to the new home directory, which is created if it does not already exist.

In this example set the user's new login directory to /mnt/home/kusdi from /home/kusdi :

# usermod -m -d /users/v/vivek kusdi

change default home directory on centos



# vim /etc/default/useradd

change
HOME=/home to HOME=/mnt/home

Tuesday, March 18, 2014

Cara Menambahkan modul file acl di webmin Centos


Pada server linux kita mengenal ACL (Access List) yaitu sebuah perintah untuk menambahkan hak akses data terhadap user atau group. Yang membedakan dengan perintah chmod adalah dengan ACL ini kita dapat memberikan hak akses banyak user kepada suatu folder .

Sebagai contoh dengan kita menggunakan user A dan mengeksekusi  perintah chmod 700 /data maka pada /data hanya user A saja yang memiliki akses RWX sedang user lain tidak akan punya akses. Beda halnya dengan kita menggunakan ACL , kita dapat menambahkan akses folder untuk banyak user , contoh di folder /data akan ada banyak access list , user A = rx , user B rwx , user C = r dan seterusnya.

Pada tutorial ini saya tidak akan membahas untuk melakukan hal itu dengan perintah manual akan tetapi itu dapat kita lakukan dengan menambahkan module pada webmin .

Caranya :

1. Download webmin module acl disini 

2. Buka webmin di browser http://localhost:10000 dan login dengan user root linux anda

3. Masuk ke menu webmin –> webmin configuration –> webmin modules

Gambar 1. Webmin Module


4. Pilih install from local file dan arahkan ke hasil unduhan tadi

5. Pilih install module dan biarkan proses instalasi  selesai

6. Reload webmin kemudian buka System  –> File Acls

Friday, March 14, 2014

file_get_contents not working on ubuntu

I have problem : php file_get_contents not working .

solution :

open   php configuration  file :

#vim /etc/php5/apache2/php.ini

edit value
file_get_contents=on 









Command to get file size



#du -hs  /home/kusdi 

Result :
128G kusdi

or

#ls -l 

or

$ls -lh




regards.




Friday, March 7, 2014

How to change Hostname on centos linux


Edit betwork :

# sudo nano /etc/sysconfig/network

edit this line :
HOSTNAME=myserver.kusdi.com


edit host :

#vim /etc/hosts

add a line after localhost :

127.0.0.1               localhost.localdomain localhost
192.9.19.1              myserver.kusdi.com myserver

run hostname :

#hostname myserver.kusdi.com
#hostname 
myserver.kusdi.com

Restart Networking

#/etc/init.d/network restart



Thursday, March 6, 2014

You don't have permission to access / on web server centos


You don't have permission to access / on web server centos

#vim /etc/sysconfig/selinux 


change selinux value to disabled

SELINUX=disabled

restart apache 

#service httpd restart








How do I mount a folder from another folder / partition


I will mounting data_xxx from  mnt folder to home

#mount --bind /home/mnt/data_xxx  /home/kusdi/data_xxx

#df -h

How to Show Linux Partitions with Command



ow do I display or show a list of all hard disk drive partitions under Linux operating systems?

Please Open Applications > Accessories > Terminal :

#fdisk -l

result :

Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0004c0a8

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        6375    51200000   83  Linux
/dev/sda2            6375      120454   916344832   83  Linux
/dev/sda3          120454      121602     9216000   82  Linux swap / Solaris




How to Allow MySQL Client to Connect remote MySQL server


You can Allow remote Mysql server from other IP with this script :

$ mysql -u root -p
Enter password:

mysql> use mysql

mysql> GRANT ALL ON *.* to root@'192.168.1.4' IDENTIFIED BY 'your-root-password'; 

mysql> FLUSH PRIVILEGES;



Monday, March 3, 2014

Install Webmin on CentOS or Redhat using yum



Installing Webmin on CentOS or Redhat is extremely easy using yum. Yum also allows you to keep Webmin update to date extremely easy (yum update)

#nano /etc/yum.repos.d/webmin.repo
or you can using editor vi/vim for editing webmin.repo


Paste the following text

[Webmin]
name=Webmin Distribution Neutral
#baseurl=http://download.webmin.com/download/yum
mirrorlist=http://download.webmin.com/download/yum/mirrorlist
enabled=1

CTRL+O to save then CTRL+X to exit.

Install the GPG key.

#wget http://www.webmin.com/jcameron-key.asc
#rpm --import jcameron-key.asc

and then install webmin 
#yum install webmin

Once Webmin has finished installing you should be load the following address in your browser. 
http://youripaddress:10000

Good luck.

chown Command on centos


How do I use chmod and chown command under Linux / Unix operating systems?

Use the chown command to change file owner and group information.
Use the chmod command to change file access permissions such as read, write, and access.


chown command changes the user and/or group ownership of for given file.
The syntax is:

chown [owner user] [file]
or
chown [owner-user]:[owner-group] [file]
or
chown [owner-user]:[owner-group] [directory]


Examples :
we have a file document.txt at directory home/kusdi

#ls -l
sample output :
#-rwxrwxr-x 1 root root 0 Aug 31 05:48 document.txt

and then , we will change user and group ownership to user "kusdi" and group "system"

#chmod kusdi:system document.txt
#ls -l

output :
#-rwxrwxr-x 1 kusdi system 0 Aug 31 05:48 document.txt




Sunday, March 2, 2014

Cara merubah Password root Linux centos / ubuntu

pertama login sebagai super user 

#su

#passwd root

masukan new passwordnya :

New password :
Confirm Password :

cara burning iso Linux ke CD/DVD pada Ubuntu


1. Masukan sebuah CD blank kedalam komputer.

click Cancel .

Menambah user ke dalam sudoers pada ubuntu/linux



login SU


#su 

kemudian  rubah  akses  /etc/sudoers 
untuk defaultnya -r--r----- sudoers

Edit akses user (u) menjadi rwx agar sudoers bisa di edit oleh si root
#chmod u=rwx

Warning : setelah selesai di edit maka kembalikan akses file /etc/sudoers ke semula.

Edit file :

#vim  /etc/sudoers

tambahkan script berikut ini :
kusdi   ALL=(ALL:ALL) ALL

setelah script ini :
root    ALL=(ALL:ALL) ALL

sehingga menjadi seperti ini :
root    ALL=(ALL:ALL) ALL
kusdi   ALL=(ALL:ALL) ALL


kemudian simpan :
tekan  Esc  kemudian 
:wq
enter


selamat mencoba 

Menambahkan user sebagai root pada centos atau ubuntu



login SU

#su 

masukan password rootnya.

kemudian  rubah  akses  /etc/sudoers 
untuk defaultnya -r--r----- sudoers

Edit akses user (u) menjadi rwx agar sudoers bisa di edit oleh si root
#chmod u=rwx

Warning : setelah selesai di edit maka kembalikan akses file /etc/sudoers ke semula.

Edit file :

#vim  /etc/sudoers

tambahkan script berikut ini :
kusdi   ALL=(ALL:ALL) ALL

setelah script ini :
root    ALL=(ALL:ALL) ALL

sehingga menjadi seperti ini :
root    ALL=(ALL:ALL) ALL
kusdi   ALL=(ALL:ALL) ALL


kemudian simpan :
tekan  Esc  kemudian 
:wq
enter


selamat mencoba