Showing posts with label DianseH - Linux Server. Show all posts
Showing posts with label DianseH - Linux Server. Show all posts

Saturday, August 9, 2008

How to add Swap on Running system (Linux Slackware)

Swap needed by our system even not recomended for better runnings. Sometimes we have not enough our SWAP for some reason, so we need add more space SWAP for our Linux Box. The Question is "how to add swap on Running System without shutdown or restart?"

Tidak sedikit kita menemukan kasus dimana Linux Box kita yang sedang running kehabisan SWAP. Saya tidak akan menjelaskan kenapa itu terjadi, namun akan mencoba membagi informasi mengenai penambahan swap pada system linux yang sedang running (hasil pencarian dari google.com).

Tested on Slackware 12.0 and working properly.

That is :

1. Check your swap capacity

root@dianseh:~# free -m
total used free shared buffers cached
Mem: 2025 2021 4 0 158 453
-/+ buffers/cache: 1942 83
Swap: 3988 3988 0

2. Make sure the system have enough space Hardisk

root@dianseh:~# df -H
Filesystem Size Used Avail Use% Mounted on
/dev/hda2 21G 2.1G 19G 10% /
/dev/hda3 56G 949M 55G 2% /home

3. We'll alocated 1GB for SWAP from directory /home

root@dianseh:/home# dd if=/dev/zero of=swapfile bs=1024 count=1048576
1048576+0 records in
1048576+0 records out
1073741824 bytes (1.1 GB) copied, 30.0159 s, 35.8 MB/s

4. Please check swapfile in directory /home

root@dianseh:/home# ls -l
total 1049600
drwxr-x--- 18 root root 464 2008-07-07 17:57 /master
-rw-r--r-- 1 root root 1073741824 2008-07-10 14:19 swapfile

5. You need change swapfile's
privilages for security reason

root@dianseh:/home# chmod 600 swapfile

6. Now, make swapfile active on your system

root@dianseh:/home# mkswap swapfile
Setting up swapspace version 1, size = 1073737 kB
no label, UUID=58de3638-3a1d-4a3d-a559-fcf40054367

7. This time how to get swapfile running on Linux Box.

root@dianseh:/home# swapon swapfile

8. We have 1GB added on system.

root@dianseh:~# free -m
total used free shared buffers cached
Mem: 2025 2021 4 0 158 453
-/+ buffers/cache: 1942 83
Swap: 3988 3988 1024

9. Finishing, need add one line entry to /etc/fstab :

/home/swapfile swap swap defaults 0 0

10. Done, Good Luck

What about your steps?

"Google search can help you find something"



reference :

1. Linux Howto

2. www.slackware.org

3. www.netadmintools.com

How To Install Cacti on Slackware

This sections about mini how to install cacti on Slackware (12.0). Isone mung iki, Peace!

All done with simple step :

Packages was installed on my system:
1. Apache/2.2.4 (Unix)
2.PHP 5.2.5 (cli) enables : with-snmp, with-zlib, with-gd, enable-ucd-snmp-hack
3.Mysql-5.0.27
4.rrdtool-1.2.23-i486-1gds
5.Net-snmp-5.4

1. Extract the cacti distribution tarball on web directory
root@dianseh:# cd /var/www/htdocs/
root@dianseh:# tar zxvf cacti-version.tar.gz
root@dianseh:# mv cacti-version cacti
root@dianseh:# cd cacti

2. Created the user and group
root@dianseh:# groupadd cacti
root@dianseh:# useradd -g cacti cacti


3. Create the MySQL database, import the default database, create username and password for cacti:
root@dianseh:# mysqladmin --user=root -p create cacti
root@dianseh:# mysql cacti <> GRANT ALL ON cacti.* TO cactiuser@localhost IDENTIFIED BY 'yourpassword';
mysql> flush privileges;

4. Edit include/config.php and specify the database type, name, host, user and password for your Cacti configuration.
$database_type = "mysql";
$database_default = "cacti";
$database_hostname = "localhost";
$database_username = "cactiuser";
$database_password = "yourpassword";


5. Change directory permissions
root@dianseh# chown -R cacti:cacti rra/ log/

6. Add a line to your crontab
root@dianseh# su - cacti
cacti@dianseh# crontab -e
*/5 * * * * php /var/www/htdocs/cacti/poller.php > /dev/null 2>&1

cacti@dianseh# exit


7. Try to open full path url http://cactiserver/cacti/

All done with following those step carefully.

Begitu ceritanya, cacti saya sudah dapat berjalan dengan mengikuti langkah-langkah tersebut di atas.

Selamat mencoba, Good Luck

Reference :
1. http://www.cacti.net/downloads/docs/html/unix_configure_cacti.html