# touch /etc/mactab
# mcedit /etc/mactab
/etc/mactab For 3 cards
# You can rename your ethx with another name, example : nic01, etc.
eth0 00:23:B7:89:39:E2
eth1 00:08:A3:20:F8:29
eth2 00:50:BA:29:B7:32
# touch /etc/mactab
# mcedit /etc/mactab
# You can rename your ethx with another name, example : nic01, etc.
eth0 00:23:B7:89:39:E2
eth1 00:08:A3:20:F8:29
eth2 00:50:BA:29:B7:32
# aptitude install lvm2
# pvcreate /dev/sda3Now create a volume group descriptor at the start of the /dev/sda3 partition.Physical volume "/dev/sda3" successfully created
# pvcreate /dev/sda3 /dev/sda4Above command line is using when we want creating pvdisk from 2 partitions at oncePhysical volume "/dev/sda3" successfully created Physical volume "/dev/sda4" successfully created
# vgcreate vgm-disk /dev/sda3Or if you want creating volume group from more than one partitions, you can using command bellowVolume group "vgm-disk" successfully created
# vgcreate vgm-disk /dev/sda3 /dev/sda4Volume group "vgm-disk" successfully created
# vgscanReading all physical volumes. This may take a while... Found volume group "vgm-disk" using metadata type lvm2# vgdisplay--- Volume group --- VG Name vgm-disk System ID Format lvm2 Metadata Areas 1 Metadata Sequence No 1 VG Access read/write VG Status resizable MAX LV 0 Cur LV 0 Open LV 0 Max PV 0 Cur PV 1 Act PV 1 VG Size 110.86 GiB PE Size 4.00 MiB Total PE 28381 Alloc PE / Size 0 / 0 Free PE / Size 28381 / 110.86 GiB VG UUID A9fOwN-y7Xm-cFDE-ruFK-1xl1-kbRI-fp9IdN
# lvcreate -n lvm-disk -l 28381 vgm-diskLogical volume "lvm-disk" created -n is name of logical volume -l is PE (pyshical extend) 28381 size on volume group (vgm-disk), in this situation, I want it to use all partition.
# mkfs.ext3 /dev/vgm-disk/lvm-diskmke2fs 1.41.11 (14-Mar-2010) Filesystem label= OS type: Linux Block size=4096 (log=2) Fragment size=4096 (log=2) Stride=0 blocks, Stripe width=0 blocks 7266304 inodes, 29062144 blocks 1453107 blocks (5.00%) reserved for the super user First data block=0 Maximum filesystem blocks=0 887 block groups 32768 blocks per group, 32768 fragments per group 8192 inodes per group Superblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 4096000, 7962624, 11239424, 20480000, 23887872 Writing inode tables: done Creating journal (32768 blocks): done Writing superblocks and filesystem accounting information: done This filesystem will be automatically checked every 33 mounts or 180 days, whichever comes first. Use tune2fs -c or -i to override.
# mount /dev/vgm-disk/lvm-disk /mnt/lvmNow check it, If everything worked properly, you should now have a logical volume mounted at /mnt/lvm
# df -ahAdding a new diskFilesystem Size Used Avail Use% Mounted on /dev/sda1 37G 1.5G 34G 5% / proc 0 0 0 - /proc none 0 0 0 - /sys none 0 0 0 - /sys/fs/fuse/connections none 0 0 0 - /sys/kernel/debug none 0 0 0 - /sys/kernel/security none 1002M 208K 1002M 1% /dev none 0 0 0 - /dev/pts none 1006M 0 1006M 0% /dev/shm none 1006M 288K 1006M 1% /var/run none 1006M 0 1006M 0% /var/lock none 1006M 0 1006M 0% /lib/init/rw /dev/sdc1 147G 117G 23G 84% /mnt/sdc1 /dev/mapper/vgm--disk-lvm--disk 110G 188M 104G 1% /mnt/lvm
# pvdisplay--- Physical volume --- PV Name /dev/sda3 VG Name vgm-disk PV Size 110.86 GiB / not usable 352.50 KiB Allocatable yes (but full) PE Size 4.00 MiB Total PE 28381 Free PE 0 Allocated PE 28381 PV UUID mYSSjb-a50Y-GOcP-m30k-1BHL-430G-fFUzAb# lvdisplay--- Logical volume --- LV Name /dev/vgm-disk/lvm-disk VG Name vgm-disk LV UUID P5KCpv-2fBq-UKk5-TObN-ZySO-MMW0-ALmpmQ LV Write Access read/write LV Status available # open 0 LV Size 110.86 GiB Current LE 28381 Segments 1 Allocation inherit Read ahead sectors auto - currently set to 256 Block device 251:0# pvscanPV /dev/sda3 VG vgm-disk lvm2 [110.86 GiB / 0 free] Total: 1 [110.86 GiB] / in use: 1 [110.86 GiB] / in no VG: 0 [0 ]
# pvcreate /dev/sdb1Physical volume "/dev/sdb1" successfully created PV /dev/sda3 VG vgm-disk lvm2 [110.86 GiB / 0 free] PV /dev/sdb1 lvm2 [931.51 GiB] Total: 2 [1.02 TiB] / in use: 1 [110.86 GiB] / in no VG: 1 [931.51 GiB]
# pvdisplay--- Physical volume --- PV Name /dev/sda3 VG Name vgm-disk PV Size 110.86 GiB / not usable 352.50 KiB Allocatable yes (but full) PE Size 4.00 MiB Total PE 28381 Free PE 0 Allocated PE 28381 PV UUID mYSSjb-a50Y-GOcP-m30k-1BHL-430G-fFUzAb "/dev/sdb1" is a new physical volume of "931.51 GiB" --- NEW Physical volume --- PV Name /dev/sdb1 VG Name PV Size 931.51 GiB Allocatable NO PE Size 0 Total PE 0 Free PE 0 Allocated PE 0 PV UUID W570RU-hvnL-Ipdm-Jo1P-vN2n-TjRJ-GPTCOm
# vgextend vgm-disk /dev/sdb1Volume group "vgm-disk" successfully extended
# vgdisplay--- Volume group --- VG Name vgm-disk System ID Format lvm2 Metadata Areas 2 Metadata Sequence No 5 VG Access read/write VG Status resizable MAX LV 0 Cur LV 1 Open LV 1 Max PV 0 Cur PV 2 Act PV 2 VG Size 1.02 TiB PE Size 4.00 MiB Total PE 266847 Alloc PE / Size 28381 / 110.86 GiB Free PE / Size 238466 / 931.51 GiB VG UUID A9fOwN-y7Xm-cFDE-ruFK-1xl1-kbRI-fp9IdN
# lvextend -l +238466 /dev/vgm-disk/lvm-diskExtending logical volume lvm-disk to 931.51 GiB Logical volume lvm-disk successfully resized
# vgdisplay--- Volume group --- VG Name vgm-disk System ID Format lvm2 Metadata Areas 2 Metadata Sequence No 7 VG Access read/write VG Status resizable MAX LV 0 Cur LV 1 Open LV 0 Max PV 0 Cur PV 2 Act PV 2 VG Size 1.02 TiB PE Size 4.00 MiB Total PE 266847 Alloc PE / Size 266847 / 1.02 TiB Free PE / Size 0 / 0 VG UUID A9fOwN-y7Xm-cFDE-ruFK-1xl1-kbRI-fp9IdN
# df -ahFilesystem Size Used Avail Use% Mounted on /dev/sda1 37G 1.5G 34G 5% / proc 0 0 0 - /proc none 0 0 0 - /sys none 0 0 0 - /sys/fs/fuse/connections none 0 0 0 - /sys/kernel/debug none 0 0 0 - /sys/kernel/security none 1002M 208K 1002M 1% /dev none 0 0 0 - /dev/pts none 1006M 0 1006M 0% /dev/shm none 1006M 288K 1006M 1% /var/run none 1006M 0 1006M 0% /var/lock none 1006M 0 1006M 0% /lib/init/rw /dev/sdc1 147G 117G 23G 84% /mnt/sdc1 /dev/mapper/vgm--disk-lvm--disk 110G 188M 104G 1% /mnt/lvm
# e2fsck -f /dev/vgm-disk/lvm-diske2fsck 1.41.11 (14-Mar-2010) Pass 1: Checking inodes, blocks, and sizes Pass 2: Checking directory structure Pass 3: Checking directory connectivity Pass 4: Checking reference counts Pass 5: Checking group summary information /dev/vgm-disk/lvm-disk: 11/7266304 files (0.0% non-contiguous), 504100/29062144 blocks
# resize2fs /dev/vgm-disk/lvm-diskresize2fs 1.41.11 (14-Mar-2010) Resizing the filesystem on /dev/vgm-disk/lvm-disk to 273251328 (4k) blocks. The filesystem on /dev/vgm-disk/lvm-disk is now 273251328 blocks long
# mount /dev/vgm-disk/lvm-disk /mnt/lvm/
# df -ahEditing /etc/fstab file to match new filesystemFilesystem Size Used Avail Use% Mounted on /dev/sda1 37G 1.5G 34G 5% / proc 0 0 0 - /proc none 0 0 0 - /sys none 0 0 0 - /sys/fs/fuse/connections none 0 0 0 - /sys/kernel/debug none 0 0 0 - /sys/kernel/security none 1002M 208K 1002M 1% /dev none 0 0 0 - /dev/pts none 1006M 0 1006M 0% /dev/shm none 1006M 288K 1006M 1% /var/run none 1006M 0 1006M 0% /var/lock none 1006M 0 1006M 0% /lib/init/rw /dev/sdc1 147G 117G 23G 84% /mnt/sdc1 /dev/mapper/vgm--disk-lvm--disk 1.1T 200M 974G 1% /mnt/lvm
# cat /etc/fstab
/dev/sda1 / ext3 defaults 0 1 /dev/sda2 swap swap defaults 0 0 /dev/vgm-disk/lvm-disk /mnt/lvm lvm noatime 0 2 /dev/sdb1 /mnt/sdb1 ext3 defaults 1 1 proc /proc proc nodev,noexec,nosuid 0 0
Click here to enlarge |
Click to enlarge |
root@nebula:~# cd ~
root@nebula:~# cd .ssh/
root@nebula:~/.ssh# ls -1
known_hosts
root@nebula:~# touch authorized_keys
Next generate a SSH keypair: ssh-keygen -b 4096 -N '' -t rsa -f id_rsa
root@nebula:~# ssh-keygen -b 4096 -N '' -t rsa -f id_rsaGenerating public/private rsa key pair.Your identification has been saved in id_rsa.Your public key has been saved in id_rsa.pub.The key fingerprint is:90:74:ae:c9:24:7f:4c:46:3f:08:77:54:1b:23:d9:fb root@Nebula
Home: http://www.postgresql.org.Repository: SlackersDownload size: 4,26 MBInstalled size: 22,48 MBPackage filename: postgresql-9.0.4-i686-1cf.txz
#installpkg postgresql-9.0.4-i686-1cf.txz
# adduser postgres# passwd postgresChanging password for user postgres.New UNIX password:Retype new UNIX password:passwd: all authentication tokens updated successfully.
#mcedit /var/lib/pgsql/data/postgresql.confchange at the connections and authentication section, find the
#mcedit /var/lib/pgsql/data/pg_hba.confaddes this line to pg_hba.conf
host all all 192.168.110.0/24 md5
phpinfo();
and sure enough, Slackware‘s package was not built with the --with-pgsql
option.--with-pgsql
flag. Hmm, I'm really hate to replace my original PHP installation which was done in the “proper” way, ie. via the available slackpack. Who know what the hell I can possibly misconfigure and break!$ upgradepkg --install-new dovecot-2.0.15-i686-1cf.txzThen, start for configuration
$ cp -v /usr/doc/dovecot-2.0.15/example-config/* /etc/dovecot/First create user and group for dovecot
groupadd dovecot useradd -g dovecot dovecot useradd -g dovecot dovenullHere Bellow is my worked configuration : Dovecot.conf
# grep -v "#" /etc/dovecot/dovecot.conf protocols = imap pop3 listen = * base_dir = /var/run/dovecot/ login_greeting = Dovecot ready. dict {} !include conf.d/*.conf10-auth.conf
$ grep -v "#" /etc/dovecot/conf.d/10-auth.conf disable_plaintext_auth = yes auth_mechanisms = plain login !include auth-system.conf.ext10-mail.conf
$ grep -v "#" /etc/dovecot/conf.d/10-mail.conf mail_location = maildir:%h/Maildir auth_socket_path = /var/run/dovecot/auth-userdb mail_plugin_dir = /usr/lib/dovecot mail_plugins = $mail_plugins10-master.conf
$ grep -v "#" /etc/dovecot/conf.d/10-master.conf service imap-login { inet_listener imap { } inet_listener imaps { }} service pop3-login { inet_listener pop3 { } inet_listener pop3s { }} service lmtp { unix_listener lmtp { }} service imap {} service pop3 {} service auth { unix_listener auth-userdb { }} service auth-worker {} service dict { unix_listener dict { }}Dovecot-openssl.cnf
$ grep -v "#" /usr/doc/dovecot-2.0.15/dovecot-openssl.cnf [ req ] default_bits = 1024 encrypt_key = yes distinguished_name = req_dn x509_extensions = cert_type prompt = no [ req_dn ] C=ID ST= Indonesia L=MyCity O=Dovecot OU=IMAP server CN=imap.despro.lan emailAddress=postmaster@despro.lan [ cert_type ] nsCertType = server
$ cd /usr/doc/dovecot-2.0.15/ $ sh mkcert.shthis action will create /etc/ssl/private/dovecot.pem and /etc/ssl/certs/dovecot.pem have been created. Remember their locations because you have to insert them in 10-ssl.conf
$ grep -v "#" /etc/dovecot/conf.d/10-ssl.conf ssl_cert = ssl_key =20-imap.conf
$ grep -v "#" /etc/dovecot/conf.d/20-imap.conf protocol imap {mail_plugins = $mail_plugins imap_quota autocreate}
$ grep -v "#" /etc/dovecot/conf.d/20-pop3.conf protocol pop3 {mail_plugins = $mail_plugins}90-plugin.conf
$ grep -v "#" /etc/dovecot/conf.d/90-plugin.conf plugin { autocreate = Sent autocreate2 = Drafts autocreate3 = Junk autocreate4 = Trash autosubscribe = Sent autosubscribe2 = Drafts autosubscribe3 = Junk autosubscribe4 = Trash }90-quota.conf
$ grep -v "#" /etc/dovecot/conf.d/90-quota.conf plugin { quota = maildir:User quota }auth-system.conf.ext
$ grep -v "#" /etc/dovecot/conf.d/auth-system.conf.ext passdb { driver = shadow } userdb { driver = passwd }Done
root@nebula:# cat test.txtAfter
111111111111111111111111111111111111111111111111111
root@nebula:# sed -r "s/^(.{9})/\1SED/" test.txtatau
111111111SED11111111111111111111111111111111111111111
root@nebula:# sed -i -r "s/^(.{9})/\1SED/" test.txt-i memberitahu sed untuk langsung mengedit file tersebut (over write) output tidak akan ditampilkan dilayar
root@nebula:# sed -r "s/^(.{9})/\1SED/" test.txt > test_output.txt
# telnet localhost 110Will given the same results (except IP address and Hostname):
# telnet 192.168.110.254 110
# telnet nebula.despro.lan 110
Trying 127.0.0.1...Connected to localhost.Escape character is '^]'. <-- it means Ctrl + ]+OK Dovecot ready.user fmaster <-- your username+OKpass ******* <-- your password+OK Logged in.quit+OK Logging out.Connection closed by foreign host.Also check for secure POP connection on port 995
# openssl s_client -connect localhost:995Will given same result :
# openssl s_client -connect 192.168.110.254:995
# openssl s_client -connect nebula.despro.lan:995
CONNECTED(00000003)Done
---
---
+OK Dovecot ready.
quit
+OK Logging out
closed
$ telnet localhost 143 Trying ::1... Connected to localhost. Escape character is '^]'. * OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE STARTTLS AUTH=PLAIN] Dovecot ready. ^]check from remote host
$ telnet nebula.anekarupatera.lan 143 Trying 192.168.110.254... Connected to nebula.anekarupatera.lan. Escape character is '^]'. * OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE STARTTLS AUTH=PLAIN] Dovecot ready. ^]Check that it's allowing logins check from localhost
$ telnet localhost 143 Trying ::1... Connected to localhost. Escape character is '^]'. * OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE STARTTLS AUTH=PLAIN] Dovecot ready. a login diantokam ******** a OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS MULTIAPPEND UNSELECT CHILDREN NAMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES WITHIN CONTEXT=SEARCH LIST-STATUS] Logged in ^]check from remote host
$ telnet nebula.anekarupatera.lan 143 Trying 192.168.110.254... Connected to nebula.anekarupatera.lan. Escape character is '^]'. * OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE STARTTLS AUTH=PLAIN] Dovecot ready. a login diantokam ******** a OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS MULTIAPPEND UNSELECT CHILDREN NAMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES WITHIN CONTEXT=SEARCH LIST-STATUS] Logged in ^]check that it find inbox after login, do " b select inbox"
b select inbox * FLAGS (\Answered \Flagged \Deleted \Seen \Draft) * OK [PERMANENTFLAGS (\Answered \Flagged \Deleted \Seen \Draft \*)] Flags permitted. * 6 EXISTS * 0 RECENT * OK [UIDVALIDITY 1321690865] UIDs valid * OK [UIDNEXT 906] Predicted next UID * OK [HIGHESTMODSEQ 1] Highest b OK [READ-WRITE] Select completed.Check that it finds other mailboxes after login, do "d lsub "" *"
d lsub "" * * LSUB () "." "Sent" * LSUB () "." "Trash" * LSUB () "." "Drafts" d OK Lsub completed.Make a graceful exit
e logout * BYE Logging out e OK Logout completed.Note
^] = Ctrl + ]Done Source
cd /tmpand install it
wget http://www.igniterealtime.org/downloadServlet?filename=openfire/openfire-3.7.1-1.i386.rpm
rpm -ivh openfire-3.7.1-1.i386.rpm
/etc/init.d/crond startatau
service crond startcrond dapat langsung aktif saat kita menyalakan pc (saat boot) caranya dengan mengetikkan perintah dibawah ini :
chkconfig --level 2345 cron on <-- untuk menghidupkanAda tiga option untuk mengoperasikan crontab
chkconfig --level 2345 cron off <-- untuk mematikan
crontab -emerupakan perintah untuk melakukan penjadwalan dengan crontab, menambah maupun mengurangi tugas
crontab -lmerupakan perintah untuk menampilkan tugas yang sudah ada di dalam crontab -e
yum install ssmtpsetelah selesai instal, lakukan editing terhadap file configurasinya :
mcedit /etc/ssmtp/ssmtp.confdan isikan dengan
root=username@gmail.com mailhub=smtp.gmail.com:587 rewriteDomain= hostname=username@gmail.com UseSTARTTLS=YES AuthUser=username AuthPass=password FromLineOverride=YESTesting Create message.txt with and fill with
Subject: Message for you Message text starts here.and run ssmtp with bellow command and check your inbox :D
ssmtp diantokam@slackware.com < /tmp/ssmtp.txt
yum install esmtplakukan configurasi eSMTP sebagai berikut :
touch ~/.esmtprcisi dengan :
chmod 0710 /root/.esmtprc
mcedit root/.esmtprc
identity username@gmail.comMenggunakan CA dari mozilla.org
hostname smtp.gmail.com:587
username "username@gmail.com"
password "password"
starttls required
Home: http://www.postgresql.org.
Repository: Slackers
Download size: 4,26 MB
Installed size: 22,48 MB
Package filename: postgresql-9.0.4-i686-1cf.txz
#installpkg postgresql-9.0.4-i686-1cf.txz
# adduser postgres# passwd postgresChanging password for user postgres.New UNIX password:Retype new UNIX password:passwd: all authentication tokens updated successfully.
# yum install postgresql-server postgresql-devel postgresql-contrib postgresql#
# chmod 777 -R /tmp <-- make sure you do this !!!!
# /etc/rc.d/init.d/postgresql initdb
Initializing database: [ OK ]
# /etc/init.d/postgresql start
Starting postgresql service: [ OK ]
# /etc/init.d/postgresql stop
Stopping postgresql service: [ OK ]
# mcedit /var/lib/pgsql/data/postgresql.conf
# line 59: listen all
listen_addresses = '*'
# line 334: change log format
log_line_prefix = '%t %u %d '
port = 5432