Posts

Showing posts with the label Linux

LINUX REDHAT BOOK. Now available on this site !

Do you interest in Linux Redhat ? Let's have a book of Linux Redhat on this website. Contact me : smiertx@gmail.com if you interest with this book. >> Tersedia dalam Bahasa Indonesia. >> Available on English. Here are the content list : CHAPTER 1 INSTALLATION RED HAT ENTERPRISE LINUX 4 INTRODUCTION INSTALLATION RAID AND LVM  CHAPTER 2 POST INSTALLATION RED HAT ENTERPRISE LINUX 4 KOMPILE LAST STABLE KERNEL TUNING KERNEL PARAMETER HARDENING LINUX File /etc/login/defs File /etc/security/limits.conf File /etc/pam.d/system-auth File /etc/bashrc Service running on system startup Change run-level CUSTOMIZING LINUX DESKTOP CHAPTER 3 USER DAN GROUP ADMINISTRATION ADD GROUP ADD USER CHANGE GROUP PARAMETER CHANGE USER PARAMETER SUDO CHAPTER 4 SETTING NETWORK DI LINUX SETTING HOSTNAME SETTING GLOBAL NETWORK CONFIGURATION SETTING INTERFACE NETWORK SETTING VIRTUAL IP INTERFACE NETWORK MANAGE NETWORK SERVICE NETWORK BONDING LINUX...

Change datadir mysql

If we want to change our datadir mysql, you should follow this steps : Stopping mysql service # /etc/init.d/mysqld stop Move or copy your original datadir directory to your new destination # mv /old/ /new/ Change ownership of new directory to user and group mysql # chown -R mysql:mysql /new/ Find your ib_logfile on new directory and delete it # rm -rf ib_logfile* Change datadir parameter on my.cnf # vi /etc/my.cnf Start your mysql server # /etc/init.d/mysql.server start

Bypass proxy on Linux environment

After we define proxy on our environment, we wanna bypass proxy for specific address. Here the way, edit your /etc/bashrc # vi /etc/bashrc --------- export http_proxy=http://aa.bb.cc.dd:xxxx export no_proxy="localhost, 10.0.0.0/8, 192.168.0.0/16, aaa.com" --------- Just relogin to your shell, and it changes. It's simple as blinking your eyes :p

Free memory from SAR and free -m command

Sometimes we confuse about is a system have an inadequate memory after look after "sar" and "free" command or not. Sar description about memory allocation : Total: how much physical memory the machine has Used: amount of used (kernel + user + buffers + cache) memory Free: how much unallocated memory Shared: how much is shared via shm, mmap, shlibs, etc. Buffers: how much is preallocated to unused kernel buffers Cached: how much is preallocated to unsued filesystem buffer cache free –m description about memory allocation : Used: amount of system memory that is actually in use. This is the first line 'used' - (buffers + cache) Free: amount of memory that isn't actually busy. This is the first line 'free' + buffers + cache. For example : # free -m total used free shared buffers cached Mem: 8007 7989 17 0 120 7053 -/+ buffers/cache: 815 7191 Swap: ...

Tuning Red Hat Cluster Manager

view manual entry for clumembd # man clumembd Parameter tuning for inproper default configuration of Red Hat Cluster Manager clumembd%broadcast_primary_only If set, this causes the cluster to only send broadcast packets on the NIC with the IP matching the member name and the loopback device. This is only used when using broadcast heartbeat mode, and is ignored when multicast mode is used. Current value : 0 New value : 1 cluster%msgsvc_noarp If set to "yes", the cluster will no longer use an internal ARP table for connection checks. If you are seeing "Not in subnet" messages, try changing this option to "yes". Changing this requires a full restart of the cluster software on all nodes to take effect. Current value : no New value : yes clumembd%adaptive Cluster membership daemon will allow a grace period for over-loaded members based on the previous amount of time between heartbeat packets Current value : no New value : yes clumembd%interval Heartbeat inter...

Linux GRUB Recovery

If you find GRUB screen when startup your machine like this, Here the ways to solve that : 1. First step GNU GRUB version 0.95 (640K lower / 3072K upper memory) [ Minimal BASH-like line editing is supported. For the first word, TAB lists possible command completions. Anywhere else TAB lists the possible completions of a device/filename.] grub> find /boot/grub/stage1 (hd0,1) it means linux at hda1, it probably give different result on your machine. if it didn't show any result, go forward to step 2. grub> root (hd0,1) grub> setup (hd0) grub> quit Then reboot your machine ... if you still find GRUB screen, go to step 2. 2. Second step GNU GRUB version 0.95 (640K lower / 3072K upper memory) [ Minimal BASH-like line editing is supported. For the first word, TAB lists possible command completions. Anywhere else TAB lists the possible completions of a device/filename.] grub> root (hd0,1) grub> kernel /vmlinuz-2.x.xx-xx.EL ro root=/dev/hda1 if you don't remember what...

max simultaneous connections on apache

To know how much max simultaneous connection that can be handled by apache, try to look at apache parameter : # /usr/sbin/httpd -l Compiled in modules: core.c prefork.c http_core.c mod_so.c That means apache using prefork.c module for Multi Processing Modules purpose. Prefork process multiple child with any of child handle 1 connection at one time. Try to look at httpd.conf # more /etc/httpd/conf/httpd.conf ---------------------------------------------- # StartServers: number of server processes to start # MinSpareServers: minimum number of server processes which are kept spare # MaxSpareServers: maximum number of server processes which are kept spare # MaxClients: maximum number of server processes allowed to start # MaxRequestsPerChild: maximum number of requests a server process serves StartServers 8 MinSpareServers 5 MaxSpareServers 20 MaxClients 150 MaxRequestsPerChild 1000 ----------------------------------...

Setting SSH Gateway with iptables

Case : user smiertx allow access ssh and ping on 10.10.10.0/24 and 10.10.20.0/24 networks user ikhyar only allow access ssh and ping on 10.10.10.11 and 10.10.20.11 servers Edit iptables config file # vi /etc/sysconfig/iptables # Firewall configuration written by system-config-securitylevel # Manual customization of this file is not recommended. *filter :INPUT ACCEPT [0:0] :FORWARD ACCEPT [0:0] :OUTPUT ACCEPT [0:0] :RH-Firewall-1-INPUT - [0:0] :smiertx - [0:0] :ikhyar - [0:0] -A INPUT -j RH-Firewall-1-INPUT -A FORWARD -j RH-Firewall-1-INPUT -A OUTPUT -m owner --gid-owner smiertx -j smiertx -A OUTPUT -m owner --gid-owner ikhyar -j ikhyar -A RH-Firewall-1-INPUT -i lo -j ACCEPT -A RH-Firewall-1-INPUT -p icmp --icmp-type any -j ACCEPT -A RH-Firewall-1-INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT -A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited -A smiertx -d 10.10.10.0/255.255.255.0 -j A...

Nmap on Linux

Nmap is a very powerful tool with lots of options and features to visualize your network. Check which services are running on various hosts and find suspicious malicious programs running in your network. Even though Nmap is the swiss-army knife for network scanning, most of its benefits can be gained by the average Network Administrator without diving deep in to its complications. Chances are, most of the time you will find yourself using common switches even if you know all of them. The basic syntax for Nmap is: nmap 192.168.0.1 the above command scans the given host with defaults - standard TCP connect method (-sT option) and known ports (those specified in the /etc/services file. You may need to scan a whole subnet, in which case you can use: nmap 192.168.0.1/24 nmap 192.168.0.* both the command would do the same here. One of the simplest scan methods that I come up with almost every day is the Ping Scan: nmap -sP 192.168.0.1 Starting nmap 3.70 ( http://www.insecure.org/nmap/ ) at 2...

Setting Mail Server with Qmail on Fedora 3 part6

26. Installing Qqtrap # cd /home/vpopmail # mkdir -p qtrap/logs # cd qtrap # cp /downloads/qmailrocks/scripts/qtrap/qtrap-2.0.0 ./qtrap.sh # vi qtrap.sh whitelist_check () { case $WHITELIST in address@somewhere.com|address@somewhereelse.com|*entiredomain.com) echo $SENDER found in whitelist on `date "+%D %H:%M:%S"` >> /home/vpopmail/qtrap/logs/qtrap.log exit 0;; *) ;; esac } checkall () { case $BANNED_WORDS in porn|PORN|Sex|SEX) printout $BANNED_WORDS echo MESSAGE DROPPED from $SENDER because of $BANNED_WORDS on `date "+%D %H:%M:%S"` >> /home/vpopmail/qtrap/logs/qtrap.log exit 99;; *) ;; esac } # touch /home/vpopmail/qtrap/logs/qtrap.log # chown -R vpopmail:vchkpw /home/vpopmail/qtrap # chmod -R 755 /home/vpopmail/qtrap # cd /home/vpopmail/domains/yourdomain.com # vi .qmail-default | /home/vpopmail/qtrap/qtrap.sh | /home/vpopmail/bin/vdelivermail '' delete 27. Maintaining your qmail server Starting Courier-imap on boot - make sure the following 2...

Setting Mail Server with Qmail on Fedora 3 part5

21. Installing Squirrelmail # tar zxvf squirrelmail-1.4.4.tar.gz # mv squirrelmail-1.4.4 /var/www/html/webmail # mkdir /var/sqattachements # chown -R apache:apache /var/sqattachements # cd /var/www/html/webmail # chown -R apache:apache data # cd config # ./conf.pl General ------- 1. Domain : 1.2.3.4 (Enter the IP of your server here. Don't be an idiot and actually use 1.2.3.4) 2. Invert Time : false 3. Sendmail or SMTP : SMTP IMAP Settings -------------- 4. IMAP Server : localhost 5. IMAP Port : 143 6. Authentication type : login 7. Secure IMAP (TLS) : false 8. Server software : other 9. Delimiter : detect SMTP Settings ------------- 4. SMTP Server : localhost 5. SMTP Port : 25 6. POP before SMTP : false 7. SMTP Authentication : login 8. Secure SMTP (TLS) : false try to open in your browser http://www.yourdomain.com/webmail Username: postmaster@smiert.org Password: your_password # cd /var/www/html/webmail/plugins # tar zxvf change_pass-2.7-1.4.x.tar.gz # cd /var/www/html/webmail//c...

Setting Mail Server with Qmail on Fedora 3 part4

16. Starting Qmail # /downloads/qmailrocks/scripts/util/qmr_inst_check # qmailctl stop # qmailctl start # qmailctl stat You should see an output like this: /service/qmail-send: up (pid 29956) 2 seconds /service/qmail-send/log: up (pid 29960) 2 seconds /service/qmail-smtpd: up (pid 29963) 2 seconds /service/qmail-smtpd/log: up (pid 29968) 2 seconds /service/qmail-pop3d: up (pid 29971) 2 seconds /service/qmail-pop3d/log: up (pid 29972) 2 seconds messages in queue: 0 messages in queue but not yet preprocessed: 0 Congratulations, Qmail is now officially up and running and you should be able to send and receive mail on the server. Let's test your new server's POP3 service... telnet localhost 110 you should see something like this: Trying 192.168.1.10... Connected to 192.168.1.10. Escape character is '^]'. +OK user postmaster@smiert.org +OK pass your_password +OK list +OK 1 323 (there's your message!) . quit +OK Connection closed by foreign host. And now let's test yo...

Setting Mail Server with Qmail on Fedora 3 part3

11. Installing Vqadmin Vqadmin is simply a nice web based interface that will let us manage Vpopmail. Through the interface we can create new domains, new users, net quotas, enable services and much more. # cd /downloads/qmailrocks # tar zxvf vqadmin-2.3.6.tar.gz # cd vqadmin-2.3.6 # ./configure --enable-cgibindir=/var/www/cgi-bin --enable-htmldir=/var/www/html # make && make install-strip Vqadmin should install itself in the cgi-bin directory of your default website. Now you will need to add the following to your server's Apache configuration file (httpd.conf) # vi /etc/httpd/conf/httpd.conf deny from all Options ExecCGI AllowOverride AuthConfig Order deny,allow Within the Apache master config file you have to set the "AllowOveride" option to "All". Example: AllowOverride All # cd /var/www/cgi-bin/vqadmin Now you will want to create a .htaccess file to password protect the Vqadmin interface. # vi .htaccess AuthType Basic AuthUserFile /var/www/cgi-bin/.h...

Setting Mail Server with Qmail on Fedora 3 part2

6. Building the daemontools # cd /package/admin/daemontools-0.76 You will need to patch daemontools with an additional errno patch: # cd /package/admin/daemontools-0.76/src # patch # cd /package/admin/daemontools-0.76 # package/install 7. Checking qmail itself installation # ps ax you should see the daemon "svscanboot" running. If you see "svscanboot" running, you're in good shape. 8. Installing ezmlm as mailing list add-on to Qmail # cd /downloads/qmailrocks/ # tar zxvf ezmlm-0.53-idx-0.41.tar.gz # cd ezmlm-0.53-idx-0.41 # make && make setup 9. Setting up autorespond for mailboxes. # cd /downloads/qmailrocks # tar zxvf autorespond-2.0.5.tar.gz # cd autorespond-2.0.5 # make && make install 10. Installing vpopmail Vpopmail allows us to do virtual domain mail hosting. When used with mysql, all domain information (domain name, email users, passwords etc.) are all stored in a handy mysql database. The actual mail messages are NOT stored in the databa...

Setting Mail Server with Qmail on Fedora 3 part1

1. Getting the package and setting up environtment for installation Make a work directory # mkdir /downloads Change directory to working directory # cd /downloads Copy qmailrocks package to working directory # cp {dir package source}/qmailrocks.tar.gz . Extract this package # tar zxvf qmailrocks.tar.gz 2. Executing additional script Executing script for pre-installation # /downloads/qmailrocks/scripts/install/qmr_install_linux-s1.script Executing script for patching qmail # /downloads/qmailrocks/scripts/util/qmail_big_patches.script 3. Building Qmail # cd /usr/src/qmail/qmail-1.03 # make man && make setup check # ./config-fast mail.smiert.org 4. Setting up secure certificate Generate a secure certificate that will be used to encrypt your server's TLS encrypted SMTP sessions... # make cert Here's a sample of my cert configs. Country Name (2 letter code) [GB]:ID State or Province Name (full name) [Berkshire]:West Java Locality Name (eg, city) [Newbury]:Bandung Organizatio...

Plan on next month

I need to documented all of my research since 3 years ago ( first time I meet Linux ) ... At first i want to write about qmail ( mail server ), howto build it on Redhat Box ... Then I need to compose Asterisk Server ( SIP Server ) book, It's all about VOIP ... At last I want to write about Helix Server, Helix Mobile Producer tutorial ... Just wait and see ...

Installing Drupal and some additional modules on on Redhat Linux

Get all of this files on here # tar zxvf drupal-5.1.tar.gz # mv drupal-5.1 drupal # mv drupal /var/www/html/ # mysql –u root –p create database drupal; use drupal; GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES ON drupal.* TO 'root'@'localhost' IDENTIFIED BY 'password'; FLUSH PRIVILEGES; # cd /var/www/html/drupal/ # rm -rf install.php INSTALL.txt LICENSE.txt MAINTAINERS.txt UPGRADE.txt INSTALL.mysql.txt INSTALL.pgsql.txt CHANGELOG.txt # cd /usr/local/src/rhel/source/ # tar zxvf Pleroma-5.x-1.x-dev.tar.gz # mv Pleroma /var/www/html/drupal/themes/ # rm -rf bluemarine/ chameleon/ garland/ pushbutton/ ubiquity/ # tar zxvf captcha-5.x-3.0-rc1.tar.gz # mv captcha /var/www/html/drupal/modules/ # tar zxvf chatroom-5.x-1.7.tar.gz # mv chatroom /var/www/html/drupal/modules/ # tar zxvf securelogin-5.x-1.x-dev.tar.gz # mv securelogin /var/www/html/drupal/modules/ # tar zxvf smileys-5.x-1.2-beta.tar.gz # mv smileys /...

Customize your Gnome Desktop on Redhat Linux

Install skin xmms Get your xmms skin here or here Xmms skin on zip format, then move that zip file to /usr/share/xmms/Skins/ Install Gnome Themes Get your Gnome themes here Extract your downloaded file, on my example like this ... # tar zxvf MacOS-X Aqua Theme.tar.gz Move extracted folder to /usr/share/themes/ # mv MacOS-X /usr/share/themes/ Install Gnome Icons Get your Gnome icons here Extract your downloaded file, on my example like this ... # tar zxvf MacOS-X Icons Theme.tar.gz Move extracted folder to /usr/share/icons/ # mv MacOS-X /usr/share/icons/ Install Gnome Desktop Manager Themes Get your GDM themes here Extract your downloaded file, on my example like this ... # tar zxvf SleekDragon GDM.tar.gz Move extracted folder to /usr/share/gdm/themes/ # mv SleekDragon /usr/share/gdm/themes/ Setting up Gnome Splash screen Move your picture file to /usr/share/pixmaps/splash/ directory ... Setting up your desktop wallpaper Move your picture file to /usr/share/wallpapers/ directory ...

Install Mplayer and Codecs on Redhat Linux

Get your Mplayer and codecs # tar -jxvf windows-codecs.tar.bz2 # mv essential-20050412 codecs # mv codecs /usr/local/lib/ # tar -jxvf MPlayer-1.0pre7try2.tar.bz2 # cd MPlayer-1.0pre7try2 # ./configure --enable-gui # make && make install

Compile Kernel on Redhat Linux

Get your last stable kernel at here On my example, last stable kernel was 2.6.22.1 but now 2.6.23.12 # mv linux-2.6.22.1.tar.bz2 /usr/src # tar jxvf linux-2.6.22.1.tar.bz2 # ln -s linux-2.6.22.1 linux # cd /usr/src/linux # vi /etc/modprobe.conf alias eth0 pcnet32 #alias scsi_hostadapter mptbase #alias scsi_hostadapter1 mptscsih alias snd-card-0 snd-ens1371 options snd-card-0 index=0 install snd-ens1371 /sbin/modprobe --ignore-install snd-ens1371 && /usr/sbin/alsactl restore >/dev/null 2>&1 || : remove snd-ens1371 { /usr/sbin/alsactl store >/dev/null 2>&1 || : ; }; /sbin/modprobe -r --ignore-remove snd-ens1371 alias usb-controller ehci-hcd alias usb-controller1 uhci-hcd # make clean && make mrproper # cp /boot/config-2.6.9-5.EL ./.config # make menuconfig # make rpm # cd /usr/src/redhat/RPMS/i386/ # rpm -ivh kernel-2.6.22.1-1.i386.rpm # mkinitrd /boot/initrd-2.6.22.1.img 2.6.22.1 # vi /boot/grub/menu.lst default=0 timeout=5 splashimage=(hd0,0)/grub/sp...