Hi all,
I am very much pleased to announce Christmas/New year gift for you people. We just started our new Linux/Unix forums to resolve our issues which we are facing on day to day basis at work as well as home. Please join hands with us to help others who are in need.
The forums can be accessed at http://forums.linuxnix.com
The forums are free to all
The forums does not require to register but we suggest you to register and post questions.
As a www.linuxnix.com admin I am very much awaited to see all you there discussing on various issues faced by you in Linux/Unix which will benefit us all.
Thanks,
Admin
http://www.linuxnix.com
http://forums.linuxnix.com is activate for Public
0 comments 12/30/2010 10:58:00 AM Posted by Surendra Kumar AnneLabels: General
Facing Issue With Blogger. Posts On Apache Will Be Delayed
0 comments 12/30/2010 10:48:00 AM Posted by Surendra Kumar AnneLabels: General
Hi all,
We are facing issues with posting apache posts on linuxnix.com. This is because the apache code is messing up with html rendring of blogger. So we are not able to post Virtulhost codes in the site. We will come up with a solution to resolve this issue. Mean time we are continuing with other posts. We will let you people know when we will start the apache posting once again.
Thanks,
Admin
http://www.linuxnix.com
How To Access Web Server Through IP Address?
0 comments 12/25/2010 10:12:00 AM Posted by Surendra Kumar AnneLabels: Advanced Servers, DNS Servers, How-To's
How To Install Apache Server Source Package On Linux Server?
0 comments 12/24/2010 10:12:00 AM Posted by Surendra Kumar AnneLabels: Advanced Servers, DNS Servers
How To Install Apache Server On Ubuntu Machine?
0 comments 12/22/2010 09:30:00 PM Posted by Surendra Kumar AnneLabels: Advanced Servers, DNS Servers, Ubuntu
How to install an Apache Server on ubuntu machine(A debian system)?
Step1 : Check if the package is installed or not
#dpkg -l | grep apache
Step2 : Install the package if you did not get any output
#apt-get install apache*
Step3 : Now start the apache service
#service apache2 restart
#chkconfig apache2 on
Step5 : Check if the web server is running or not by accessing local host
#elinks localhost
Or
Here is the screen shot showing the test web page when apache is installed
Apache Server Installation On Redhat Linux
0 comments 12/19/2010 06:51:00 PM Posted by Surendra Kumar AnneLabels: Advanced Servers, Apache Server, DNS Servers
How we can install Apache web server on Redhat linux?
Ans : The simplest way to install Apache on redhat machine is to use yum command.
Follow below steps :
To install and check if the web server is running with default test page.
Step1: Check if the package is installed or not
#rpm -qa | grep httpd
Step2 : Install the package if you did not get any output
#yum install httpd
Step3 : Now start the apache service
#service httpd restart
Step4 : On the service at booting time
#chkconfig httpd on
Step5 : Check if the web server is running or not by accessing local host
#elinks localhost
or
Access localhost from browser
When you access the server through browser red-hat Linux will present you with a test page as shown below
Many How to's Related To Apache Web Server Is Going To Come On linuxnix.com
1 comments 12/14/2010 04:27:00 PM Posted by Surendra Kumar AnneLabels: Advanced Servers, Apache, Basic-Servers, Servers, Web Servers
Hi all,
From today on words we are planing to provide in depth knowledge base on many Howto's related to Apache web server. Some of the howto's which we are going to present are as follows.
2. Apache installation[Redhat/Debian]
3. Apache installation through source
4. Apache ip based web access
5. Apache host based web access
5a.Hosting multiple SSL websites on single host
7. Apache SSL based web access
8. Apache integration with AD(Active Directory) authentication
12.Apache fine tuning
How To Configure And Install Sendmail In Linux?
0 comments 12/13/2010 11:55:00 PM Posted by Surendra Kumar AnneLabels: How-To's, Mail Servers
Send mail is one of the old and widely used mail delivery agent/Mail system.
How To Upgrade An Installed Source Package?
0 comments 12/12/2010 10:18:00 PM Posted by Surendra Kumar AnneLabels: How-To's, Package-Mgmt
I have installed a package from source, now I want to upgrade the older version to new version which is available.
How can I upgrade already installed source package on my system?
Ans : This question arises to all the admins who do installation from source package. To upgrade a source package follow the same steps to you have did at the time of first installation through source. Package as shown below..
Step1: unpack the new source code in tmp directory.
#cd /tmp
#tar xvfz packagname.tar.gz
#cd packagename
#./configure –prefix=/path/to/old/installation
#make
#make check
#make install
Step2 : Now check what is the version if its updated to new version for example
If you install squid then execute below command
#squid -v
Troubleshooting Steps Of Tomcat Server
0 comments 12/10/2010 09:25:00 PM Posted by Meghana M BhombhoreLabels: Tomcat, Troubleshooting
Troubleshooting Steps to check whether the Tomcat server is runing or not?
Step1 : Check ps command output
#ps -ef | grep tomcat
Step2 : Check with nmap whether port 8080 is opened or not?
#nmap localhost
Step3 : Check with telnet command as shown in below by executing GET / HTTP/1.0 Host: localhost command once logged in to server at 8080 port.
#telnet localhost 8080 Trying 127.0.0.1... Connected to localhost.localdomain (127.0.0.1). Escape character is '^]'. GET / HTTP/1.0 Host: localhost
This command should output hte test tomcat page.
Enjoy the troubleshooting:)
How To Install Apache Tomcat on Linux(Redhat/Ubuntu)?
1 comments 12/10/2010 09:08:00 PM Posted by Meghana M BhombhoreLabels: Advanced Servers, How-To's
How to install Apache tomcat on Linux(Redhat/Ubuntu)?
What is Apache tomcat?
Ans : ApacheTomcat is an open source web application server which supports J2ee Servlets, JavaServer, Pages(JSP) and API's. Tomcat should not be confused with Apache web server which an HTTP web server.
---Wikipedia.
Some terminology about Apache tomcat.
Apache Tomcat can be configured by editing server.xml file. Those who knows apache web server. This server.xml can be taken as synonimas to httpd.conf file.
Servlet is defined as a way add dynamic content to a Web server using the Java platform. And a servlet container is a compiled, executable program. The servlet container name is tomcat is catalina.
Pre requists for Apache tomcat are
1. java
2. JDK
Step by step for installing Apache tomcat
Note : Avoide installing tomcat from reposatories, always prefer to install it from source downloaded from apache site.
Step1 : Install all the prequistes
Redhat :
#yum install java
Ubuntu :
#apt-get install java
Step2 : Download tomcat source package and uncompress it.
Redhat/Ubuntu
#cd /opt
#wget http://www.trieuvan.com/apache/tomcat/tomcat-6/v6.0.29/bin/apache-tomcat-6.0.29.tar.gz
#tar xvfz apache-tomcat-6.0.29.tar.gz
Step3 : Setup the paths for Catalina and others.
Setting catalina paths
Redhat/ubuntu
CATALINA_HOME=/opt/apache-tomcat-6.0.29
CATALINA_BASE=/opt/apache-tomcat-6.0.29
Setting java paths
Check what java versions are installed in your system
#update-alternatives --config java
This command will display which is default java version used by your machine.
Example output :
# update-alternatives --config java
There are 2 programs which provide 'java'.
Selection Command
-----------------------------------------------
1
/usr/lib/jvm/jre-1.4.2-gcj/bin/java
*+ 2
/usr/lib/jvm/jre-1.6.0-openjdk/bin/java
Enter to keep the current selection[+], or type selection number:
If you see above the default java version is 1.6 so set the path to /usr/lib/jvm/jre-1.6.0-openjdk
JAVA_HOME=/usr/lib/jvm/jre-1.6.0-openjdk
JDK_HOMe=$JAVA_HOME
Step4 : Now start tomcat server
#/opt/apache-tomcat-6.0.29/bin/sartup.sh
Sample output.
Using CATALINA_BASE: /opt/apache-tomcat-5.5.26
Using CATALINA_HOME: /opt/apache-tomcat-5.5.26
Using CATALINA_TMPDIR: /opt/apache-tomcat-5.5.26/temp
Using JRE_HOME:
/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/
Step5 : By default Apache Tomcat will be hosted onlocalhost : 8080 port by default. So try to access the site with web browser
http://localhost:8080
or
http://localhost:8080
or
http://systemname:8080
Stay tuned to other posts about troubleshooting tomcat installation.
How To Set Java Path In Linux?
0 comments 12/10/2010 08:58:00 PM Posted by Meghana M BhombhoreLabels: How-To's
How to set java path in Linux?
Ans : Check where java is installed by using below command
#update-alternatives --config java
This command will show installed java packages in your machine.
Example output :
# update-alternatives --config java
There are 2 programs which provide 'java'.
Selection ----------------------------------------------- 1 /usr/lib/jvm/jre-1.4.2-gcj/bin/java *+ 2
From above you can see java version in use it. 1.6.
Setting java path(In Temporary way)
#JAVA_HOME=/usr/lib/jvm/jre-1.6.0-openjdk #export $JAVA_HOME
Setting java path (In Permanent way)
Edit ~/.bashrc and place below two lines in that file and save the file.
Vi ~/.bashrc
JAVA_HOME=/usr/lib/jvm/jre-1.6.0-openjdk export $JAVA_HOME
Now save the file and exit, then logout and login to make those changes to reflect.
Command
/usr/lib/jvm/jre-1.6.0-openjdk/bin/java
How to Set Priority for a service at booting of Linux
0 comments 12/10/2010 07:25:00 AM Posted by Surendra Kumar AnneLabels: Booting, Hacks
This is possible with renaming of the scripts located in running configuration(rc) folders. As you people know that
all the startup scripts are stored in rc1.d, rc2.d etc... each of these folders corresponding to scripts to be started in that run-level
for example.. if you want to start some script in runlevel 1 they are kept in /etc/rc1.d folder so that when Linux is booting up these scripts are executed at runlevel 1.
So how can i set priority to my scripts/services?
Just go in to one of the rc folders, you can see all the scripts which are started in that runlevel..
if you observe those scripts, these scripts will start with different numbers. here are some for your reference.
K09apache2
K15pulseaudio
K20acpi-support
K20kerneloops
K20saned
K20speech-dispatcher
K20virtualbox-ose
K20virtualbox-ose-guest-utils
K74bluetooth
README
S30killprocs
S70dns-clean
S70pppd-dns
S90single
so the script(services) start sequence will be like K09apache2 then K15pulseaudio so on.. so if you want to give priority to your service just name with less number.. as shown below..
K09apache2
K01pulseaudio
K20acpi-support
K20kerneloops
K20saned
K20speech-dispatcher
K20virtualbox-ose
K20virtualbox-ose-guest-utils
K74bluetooth
README
S30killprocs
S70dns-clean
S70pppd-dns
S90single
So now the first script/service which start in this list is K01pulseaudio
Please comment your thoughts on this..
How To Change The Java Version In Linux?
0 comments 12/10/2010 01:16:00 AM Posted by Surendra Kumar AnneLabels: How-To's
This post is regarding how to change java version if multiple java versions are installed?
Check what are the java versions are installed on your system
#java -version
Example output
OpenJDK Runtime Environment (build 1.6.0-b09)
OpenJDK Client VM (build 1.6.0-b09, mixed mode)
So now I want to change the one version to another version.
If more than one java is installed. Execute below command to see how many java versions are installed? And what is the default version (Default version will be indicated by *)
#update-alternatives --config java
This command will display which is default java version used by your machine..
Example output.
# update-alternatives --config java
There are 2 programs which provided 'java'.
Selection Command
-----------------------------------------------
1. /usr/lib/jvm/jre-1.4.2-gcj/bin/java
*+ 2 /usr/lib/jvm/jre-1.6.0-openjdk/bin/java
Enter to keep the current selection[+], or type selection number:
So if you want to change the java version from 1.6 (now 2 is default version as shown) to 1.4 just press “1” with out quotes.
Please let us know if you know other way of changing java version.
How To Enable Verbose Mode For SSH Logins?
0 comments 12/09/2010 06:43:00 AM Posted by Surendra Kumar AnneLabels: How-To's, SSH, Troubleshooting
How we can login to remote server through ssh?
#ssh user@servername
or
#ssh -l user servername
or
#ssh ip-add
So when you will execute the above command you will get the password prompt. But if you want to see what will happen when you execute ssh command you have to enable verbose or debugging mode. To do this we have to apply -v option at the time of login as shown in below example.
#ssh -v surendra@ftp2.linuxnix.com
root@krishna:/home/surendra# ssh -v surendra_a@ftp2.linuxnix.com
OpenSSH_5.5p1 Debian-4ubuntu4, OpenSSL 0.9.8o 01 Jun 2010
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to ftp2.linuxnix.com [92.32.56.78] port 22.
debug1: Connection established.
debug1: permanently_set_uid: 0/0
debug1: identity file /root/.ssh/id_rsa type -1
debug1: identity file /root/.ssh/id_rsa-cert type -1
debug1: identity file /root/.ssh/id_dsa type -1
debug1: identity file /root/.ssh/id_dsa-cert type -1
debug1: Remote protocol version 1.99, remote software version OpenSSH_4.0
debug1: match: OpenSSH_4.0 pat OpenSSH_4*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.5p1 Debian-4ubuntu4
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5 none
debug1: kex: client->server aes128-ctr hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Host 'ftp2.linuxnix.com' is known and matches the RSA host key.
debug1: Found key in /root/.ssh/known_hosts:1
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Next authentication method: publickey
debug1: Trying private key: /root/.ssh/id_rsa
debug1: Trying private key: /root/.ssh/id_dsa
debug1: Next authentication method: keyboard-interactive
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Next authentication method: password
surendra_a@ftp2.linuxnix.com's password:
debug1: Authentication succeeded (password).
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
debug1: Sending environment.
debug1: Sending env LANG = en_IN
Last login: Thu Dec 9 20:02:47 2010 from 1.23.6.79
After logout
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug1: channel 0: free: client-session, nchannels 1
Connection to ftp2.linuxnix.com closed.
Transferred: sent 2072, received 2072 bytes, in 27.7 seconds
Bytes per second: sent 74.8, received 74.8
debug1: Exit status 0
So if you want more verboseness you can use up to 3rd level(-vvv) as shown below
#ssh -vvv surendra_a@ftp2.linuxnix.com
NIC Bonding In Linux
2 comments 11/30/2010 08:36:00 AM Posted by Surendra Kumar AnneLabels: Administration, Advanced Servers, Network Troubleshooting
1. Link aggregation
2. Channel Bonding
3. NIC Bonding
4. NIC teaming
5. Network card Bonding
6. Ethernet bonding
7. Trunking
8. Etherchannel
9. Multi-link truning(MLT)
10.Network bonding
11.Network Fault Tolerance(NFT)
12.Port channel
13.Smartgroup
14.EtherTrunk
1. High bandwidth
2. Redundancy/resilience
Before Clustering softwares come in to existing this technique is widely used to provide redundancy to a high end server. After cluster software introduced its used to enhance the cluster redundancy.
In this post we will see how can we achieve Nic bonding.
Nic bonding will work with the help of bonding driver in kernel.
eth1
bnd0
Step1 : Create bond interface file with following content in it
vi /etc/syconfig/network-scripts/ifcfg-bnd0
DEVICE=bnd0
IPADDR=192.168.0.234
NETWORK=192.168.0.0
NETMASK=255.255.255.0
BOOTPROTO=none
ONBOOT=yes
GATEWAY=192.168.0.1
save and exit the file
Step2 : Now create a bnd0 virtual interface in modprobe.conf as shown below
alias bnd0 bonding
options bnd0 miimon=100 mode=6
Save and exit the file
Let me explain what actually the above two lines indicates
Line1 : (alias bnd0 bonding) to load the bonding module in to kernel
Line2 : Indicate the option for thie bond interface
miimon is nothing but to MONitor with MIItool to check the availability of other interfaces.
mode is to specify whether the bond is configured as load balancing or fail over. Here its load-balancing which means data transmission will be shared between two interfaces. To know more about modes click here
Step3 : Load the module in to kernel with modprob command to update this changes to kernel
#modprob bonding
Step4 : edit interface card details of both physical devices
For eth0
vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
USERCTL=no
ONBOOT=yes
MASTER=bnd0
SLAVE=yes
BOOTPROTO=none
For eth1
vi /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth1
USERCTL=no
ONBOOT=yes
MASTER=bnd0
SLAVE=yes
BOOTPROTO=none
Save and exit the files
The above thing is self explanatory for many admins but let me explain to new people.
DEVICE Indicates what is the device name
USERCTL Indicates that can user control this device(here its no)
ONBOOT Indicates that at the boot time do this device should be up?
MASTER Is this device has master? Then what it is(here its bnd0)
SLAVE Is this device acting as slave?
BOOTPROTO What about getting ip add from what protocol?(its set to none which indicate its a static IP)
Step5 : Restart the network service and see the output of ifconfig for your self.
#service network restart
#ifconfig
Questions & Answers
1. How can we say my data is flowing in which path?
Ans : Link aggregation(bonding driver) will take care of sending all the frames of particular session in same path. This is called as ordering of frames.
2. Can we bond more than 2 NIC?
Ans : Yes we can, follow the same procedure. In fact there is no limit but linux server do have limit to have total number of NIC cards.
Tips on implementing NIC bonding
1. Enable spanning tree for switches, with out which network speed reduces.
2. Be careful if you’re doing this over a remote ssh.
Failed To Make Swap Directory Cache (13) Permission Denied
2 comments 11/25/2010 10:35:00 PM Posted by Surendra Kumar AnneLabels: Proxy Servers
When installing squid as cache server you have to create cache folder with “squid -z” command with out quotes. But when you are trying this you will see
/usr/local/squid/sbin# ./squid -z
2010/04/29 22:39:16
Creating Swap Directories
FATAL : Failed to make swap directory /usr/local/squid/var/cache: (13) Permission denied
Squid Cache (Version 2.5.STABLE5) : Terminated abnormally.
CPU Usage : 0.000 seconds = 0.000 user + 0.000 sys
This is due to that /usr/local/squid/var/cache folder is not owned by effective user. To resolve this issue follow below steps
Step1 : Create squid user(A normal user) if the squid user is not there
#useradd squid
Step2 : Specify the effective user entry in squid.conf file with squid as username by editing it.
#vi /usr/local/squid/etc/squid.conf
change the entry from
# cache_effective_user nouser
to
cache_effective_user squid
Save the file now
Step3 : Now change the ownership of the cache folder to squid user
#chown -R squid.squid /usr/local/squid/var/cache
Step4 : Now create cache directory with squid -z command
#squid -z
Now you will be out of issue.
How To Change The Date In Linux?
0 comments 11/25/2010 10:14:00 PM Posted by Surendra Kumar AnneLabels: Basics, How-To's
How can we change the date/time in linux?
Ans : Changing date in linux is bit confusing. If you want to change date in GUI its very much easy and if you want to change it when it comes to CLI its bit hard to remember it.
Date is the command to check whats the present date
#date
To change the date use below command
#date MMDDHHMMYYYY.ss
MM => Two digit month value
DD => Two digit day value
HH => Two digit hour value
MM => Two digit minuite value
YYYY => Four digit year value
ss => Two digit seconds value(very rare we will be using this)
Example1 : I want to change the date to Nov 24 1:36 PM 2010
#date 112413362010
Example2 : I want to change the date to Jan 9th 8:05.04 AM 2010
#date 010908052010.04
Now the date will be changed to your required date.