THE LINUX STUFF

Wednesday, 27 June 2012

Win Tips1:Thunderbird profile backup ?

(1) Thunderbird profile backup in Windows?

Restoring the mail backup

1. Install Mozilla Thunderbird first if it is not installed yet, after installation do not run Mozilla Thunderbird when prompted to.
2. Move or copy the backup Thunderbird folder and place in c:\documents and settings\your-username\application data. If Thunderbird folder already exist then rename the existing folder and move it again.
3. After you have finished moving the Thunderbird folder, Open the Mozilla Thunderbird. You should have a fully configured and restored mail by now.

 Find the profile Thunderbird folder

They are located in different places for different versions of Windows and they may be assigned random file names that make them difficult to recognize.
On Windows 2000/XP/2003/Vista machines the location for your Thunderbird profile is:
C:\Documents and Settings\Shankar/Application Data\Thunderbird\Profiles\ickz8bn7.default---->

then copy this file remote system----->rename xxxx.default....

---------
LINUX:
Mozilla thunderbird stores your email and profile setting in a special directory called ~/.thunderbird i.e. /home/you/.thunderbird/ or ~/.thunderbird directory. All you have to do is backup this directory.

Task: Backup Thunderbird mail and profile

You need to backup thunderbird mail and profile to tape drive, use:
$ tar zcvf /dev/st0 /home/you/.mozilla-thunderbird/
To backup files to USP pen driver mounted at /media/disk, enter
$ cp -avr /home/you/.thunderbird/ /media/disk
You need to backup thunderbird mail and profile to a /backup directory:
# tar zcvf /backup/email-vivek-22jan2007.tar.gz /home/vivek/.thunderbird/
You can copy /backup/email-vivek-22jan2007.tar.gz file to a CD/DVD or USB pen.

Task: Restore Thunderbird mail and profile

Make sure Thunderbird is not running. Simply copy backup files from tape, USB pen or CD to your /home/you/.mozilla-thunderbird/ directory:
$ tar –zxvf /backup/email-vivek-22jan2007.tar.gz -C /home/vivek



How to Backup Thunderbird Email on Windows7

Backing up Mozilla Thunderbird email on Windows 7 is a simple process of archiving your Thunderbird profile. Follow these steps to backup emails for Thunderbird on Windows 7:
Step 1 Close Mozilla Thunderbird
Step 2 Viewing Hidden Files and Folders
  • select Start menu
  • search “folder options” and select Folder Options
  • select View tab
  • select “Show hidden files, folders, and drives
  • select Apply
  • select OK to close
Step 3 Locate and Archive your Profile
  • select file explorer
  • navigate to C:\Users\[Your Username]\AppData\Roaming\Thunderbird\Profiles
  • On Windows 7 & Vista Thunderbird data is stored at: C:\Users\<user name>\AppData\Roaming\Thunderbird\
  • locate *.profile (preceded with random 8 character set: ie. v03180j5.profile)
  • zip *.profile (right click v03180j5.profile and Add to Zip)*
Posted by Sankar Kodipilla at 06:16 1 comment:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest

Tuesday, 26 June 2012

Ubuntu Tips

==============================

How to use Update Manager to update your Ubuntu system 12.04

1.Click the gear icon on the far right end of the panel at the top of your Ubuntu 12.04 desktop.

2. Choose the Updates Available option.

3. Update Manager will open and refresh itself (or you can click the Check button to manually do it). 

4. By default all of the updates will be checked, but you can uncheck the ones you don't want. 

5. When you're ready to update, click the Install Updates button. 

6. Type in your password.

7. Click the Authenticate button to begin updating your Ubuntu 12.04 system.

============================== 

Howto- Install Skype in Ubuntu 12.04 Precise Pangolin

To get started go to this website and download a version for your system. You can choose a 32-bit or 64-bit version for your system.

When prompted, choose ‘Open with Ubuntu Software Center (default)’

skype_4_precise

Then click the ‘Install’ button to install it.

skype_4_precise_2

Enjoy!

skype_4_precise_3

 

===========================

Installing jdk7 in ubuntu 12.04 (64 bit)


This way has always worked for me:
Code:
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer

 

 

error:eclipse

/home/velammal/.eclipse/org.eclipse.platform_3.7.0_155965261/configuration/1340727186784.log.

 velammal@dcimobileteam1:~/.eclipse/org.eclipse.platform_3.7.0_155965261/configuration$ tail 1340727186784.log
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1386)

 

 

Posted by Sankar Kodipilla at 04:41 No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest

Monday, 25 June 2012

Boot Ubuntu Linux into Rescue mode to fix system

 Q:How do I boot my Ubuntu Linux server into Rescue mode to fix system?

A. You can boot Ubuntu Linux into rescue mode when things go wrong, there are several ways to work on fixing them. However, you must understand your system and what to fix in case of emergency.

Use this mode only if your system is unbootable. It is also recommended that you make backup of important data.

=> Start Computer / reboot computer

=> Put your Ubuntu install CD
=> Make sure BIOS is set to boot from CD

=> Now booting will start from Ubuntu install CD

=> You will see various option screen - select Recover a broken system

You will system is booting in to rescue mode; system will ask about Network and other information. This is required to setup rescue environment.

Now you will prompted to select root partition or device.
Next it will try to mount root device and it will notify the same.
Now you will see common rescue mode option such as Reinstall GRUB or open / execute a shell etc.

Now you are in rescue mode and you need to use your own knowledge to rescue the system. When things go wrong, there are several ways to work on fixing them.

Few things to remember....

The rescue-mode CD mounts your root filesystem at /target directory. Open or execute a shell and change directory to /target

# ls /target
# cd /target
# mount
 
If you need to run fsck command use fdisk -l command to find out partition name. Usually they are located at /dev/discs/discX/partY. For example repair 2nd partition (not mounted as /target) you may type command:

# ls -l /dev/discs/disc0
# fsck.ext3 /dev/discs/disc0/part1

To exit type command : # sync ;sync
# exit
# reboot
 
As I said earlier in rescue mode, there is no single command that I can recommend to fix problem. You need to use your own knowledge to rescue the system and don't forget to read command documentation before using any command.

Ubuntu Rescue Mode Step by step:

1.How to gain root user access without login?

  1. Easiest method (will not work if GRUB menu password is set)
    1. Boot-up computer
    2. If GRUB menu is hidden, press Esc to enter the GRUB menu
    3. Select Ubuntu, kernel 2.6.12-8-386 (recovery mode)
       
    4. Press Enter to boot
  2. Another method is described at How to use a Ubuntu installation CD to gain root user access?
2. How to modify kernel boot-up arguments, to gain root user access?

  1. Boot-up computer
  2. If GRUB menu is hidden, press Esc to enter the GRUB menu
  3. If GRUB password is set, press p to unlock the GRUB menu
  4. Select Ubuntu, kernel 2.6.12-8-386
     
  5. Press e to edit the commands before booting
  6. Select kernel /boot/vmlinuz-2.6.12-8-386 root=/dev/hda2 ro quiet splash
     
  7. Press e to edit the selected command in the boot sequence
  8. Add rw init=/bin/bash to the end of the arguments

    grub edit> kernel /boot/vmlinuz-2.6.12-8-386 root=/dev/hda2 ro quiet splash rw init=/bin/bash
     
  9. Press b to boot
3. How to use a Ubuntu installation CD to gain root user access?

  1. Boot-up computer into Ubuntu Installation CD
  2. At “boot:” prompt, add “rescue” to the argument
    boot: rescue
     
  3. Follow the instructions on screen
4. How to change root user/main user password if forgotten?

  1. Read How to gain root user access without login?
     
  2. To change root user password
    # passwd root
     
  3. To change main user password
    # passwd system_main_username
5. How to change GRUB menu password if forgotten?


  1. grub
    
    grub> md5crypt
    Password: ****** (ubuntu)
    Encrypted: $1$ZWnke0$1fzDBVjUcT1Mpdd4u/T961 (encrypted password)
    grub> quit
    
    sudo cp /boot/grub/menu.lst /boot/grub/menu.lst_backup
    sudo gedit /boot/grub/menu.lst

  2. Find this line
    ...
        password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
    ...
  3. Replace with the following line
    password --md5 $1$ZWnke0$1fzDBVjUcT1Mpdd4u/T961 (encrypted password above)
                                
  4. Save the edited file (sample/menu.lst_changegrubpasswordforgotten)
6. How to restore GRUB menu after Windows installation?

  1. Read How to use a Ubuntu installation CD to gain root user access?
     
  2. Assuming that /dev/hda is the location of /boot partition

  3. # grub-install /dev/hda

7. How to add Windows entry into GRUB menu?

  1. If you need to reinstall GRUB, read How do I check disk space and view the partition table?
     
  2. Launch System->Administration->Boot
     
  3. Click on Add.
  4. Choose a name such as "Windows XP" and the OS type is unknown.
  5. Assuming that /dev/hda1 is the location of Windows partition, choose that from the drop-down list
8. How to read Linux partitions (ext2, ext3) in Windows?

  1. Download Ext2fs

Posted by Sankar Kodipilla at 23:54 1 comment:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest

Linux Real Time Issue4

1. After our EMC storage admin had attached (only one) LUN to this server ,output of "fdisk -l " contain a lot of    /dev/sd* which don't have valid partition. You mean that all of them are belong to thae EMC storage LUN? And I have to make file system on all of them?

Thanks in advance

I currently have Oracle Linux RHEL5 running and have installed a HBA to
connect to the SAN(EMC). You can see the HBA from the SAN but cannot
see the SAN storage from the Linux box.
The question is how do I connect the Linux box to that space?
I have no port_name file in /sys/class/scsi_host/host* folder.something is wrong with it?


# uname -a
Linux mapor-linux 2.6.18-128.el5xen #1 SMP Wed Jan 21 09:07:41 EST 2009 x86_64 x86_64 x86_64 GNU/Linux
# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/cciss/c0d0p5 95G 54G 37G 60% /
/dev/cciss/c0d0p8 48G 26G 20G 58% /home
/dev/cciss/c0d0p7 48G 359M 45G 1% /tmp
/dev/cciss/c0d0p6 54G 3.0G 48G 6% /usr
/dev/cciss/c0d0p2 474G 180G 270G 40% /u01
/dev/cciss/c0d0p1 680M 36M 609M 6% /boot
tmpfs 16G 0 16G 0% /dev/shm
/dev/mapper/mpath0p1 493G 393G 75G 85% /backup
172.27.8.31:/storage 296G 189G 92G 68% /net
# fdisk -l

Disk /dev/cciss/c0d0: 899.8 GB, 899898718208 bytes
255 heads, 32 sectors/track, 215393 cylinders
Units = cylinders of 8160 * 512 = 4177920 bytes

Device Boot Start End Blocks Id System
/dev/cciss/c0d0p1 * 1 176 718064 83 Linux
/dev/cciss/c0d0p2 177 125917 513023280 83 Linux
/dev/cciss/c0d0p3 125918 151015 102399840 82 Linux swap / Sol aris
/dev/cciss/c0d0p4 151016 215393 262662240 5 Extended
/dev/cciss/c0d0p5 151016 176113 102399824 83 Linux
/dev/cciss/c0d0p6 176114 190293 57854384 83 Linux
/dev/cciss/c0d0p7 190294 202842 51199904 83 Linux
/dev/cciss/c0d0p8 202843 215391 51199904 83 Linux

Disk /dev/sda: 536.8 GB, 536870912000 bytes
255 heads, 63 sectors/track, 65270 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 1 65270 524281243+ 83 Linux

Disk /dev/sdb: 536.8 GB, 536870912000 bytes
255 heads, 63 sectors/track, 65270 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdb1 1 65270 524281243+ 83 Linux

Disk /dev/sdc: 536.8 GB, 536870912000 bytes
255 heads, 63 sectors/track, 65270 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdc1 1 65270 524281243+ 83 Linux

Disk /dev/sdd: 536.8 GB, 536870912000 bytes
255 heads, 63 sectors/track, 65270 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdd1 1 65270 524281243+ 83 Linux

Disk /dev/sde: 536.8 GB, 536870912000 bytes
255 heads, 63 sectors/track, 65270 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sde1 1 65270 524281243+ 83 Linux

Disk /dev/sdf: 536.8 GB, 536870912000 bytes
255 heads, 63 sectors/track, 65270 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdf1 1 65270 524281243+ 83 Linux

Disk /dev/sdg: 536.8 GB, 536870912000 bytes
255 heads, 63 sectors/track, 65270 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdg1 1 65270 524281243+ 83 Linux

Disk /dev/sdh: 536.8 GB, 536870912000 bytes
255 heads, 63 sectors/track, 65270 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdh1 1 65270 524281243+ 83 Linux

Disk /dev/dm-0: 536.8 GB, 536870912000 bytes
255 heads, 63 sectors/track, 65270 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/dm-0p1 1 65270 524281243+ 83 Linux

Disk /dev/dm-1: 536.8 GB, 536863993344 bytes
255 heads, 63 sectors/track, 65269 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/dm-1 doesn't contain a valid partition table

Disk /dev/sdi: 1073 MB, 1073741824 bytes
34 heads, 61 sectors/track, 1011 cylinders
Units = cylinders of 2074 * 512 = 1061888 bytes

Disk /dev/sdi doesn't contain a valid partition table

Disk /dev/sdj: 1073 MB, 1073741824 bytes
34 heads, 61 sectors/track, 1011 cylinders
Units = cylinders of 2074 * 512 = 1061888 bytes

Disk /dev/sdj doesn't contain a valid partition table

Disk /dev/sdm: 1073 MB, 1073741824 bytes
34 heads, 61 sectors/track, 1011 cylinders
Units = cylinders of 2074 * 512 = 1061888 bytes

Disk /dev/sdm doesn't contain a valid partition table

Disk /dev/sdp: 1073 MB, 1073741824 bytes
34 heads, 61 sectors/track, 1011 cylinders
Units = cylinders of 2074 * 512 = 1061888 bytes

Disk /dev/sdp doesn't contain a valid partition table

Disk /dev/sdq: 1073 MB, 1073741824 bytes
34 heads, 61 sectors/track, 1011 cylinders
Units = cylinders of 2074 * 512 = 1061888 bytes

Disk /dev/sdq doesn't contain a valid partition table

Disk /dev/sdr: 1073 MB, 1073741824 bytes
34 heads, 61 sectors/track, 1011 cylinders
Units = cylinders of 2074 * 512 = 1061888 bytes

Disk /dev/sdr doesn't contain a valid partition table

Disk /dev/sdw: 1073 MB, 1073741824 bytes
34 heads, 61 sectors/track, 1011 cylinders
Units = cylinders of 2074 * 512 = 1061888 bytes

Disk /dev/sdw doesn't contain a valid partition table

Disk /dev/sdx: 1073 MB, 1073741824 bytes
34 heads, 61 sectors/track, 1011 cylinders
Units = cylinders of 2074 * 512 = 1061888 bytes

Disk /dev/sdx doesn't contain a valid partition table
Posted by Sankar Kodipilla at 03:37 1 comment:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest

Filezilla Errors

FileZilla connection timed out error message




If you get this error message, you will need to go to Edit, Settings
Under the Connection option, find the timeout section
You will need to change the timeout in seconds to a higher number (i.e. 160)
Click ok
Try to connect again; the error message should be resolved


To View Overall:::Network Configrutaion
http://wiki.filezilla-project.org/Network_Configuration

Testing:
http://ftptest.net/

==============================
Filezilla Error: Failed to retrieve directory listing

 
Filezilla Error: Failed to retrieve directory listing
Error: Connection timed out

You might have faced this issue because of default setting of Connection in your Filezilla like this :

FTP >> Active Mode: Get External IP Address From This URL, Which pointed to http://ip.filezilla-project.org/ip.php .

This is the source of the problem. If you go to above mentioned URL, you will probably get a result of 127.0.0.1. If the Filezilla client needs the external address and is given 127.0.0.1 (localhost) then there will be problems in connection.

You need to configure your Filezilla client as mentioned below :

Open Filezilla, go to Edit >> Settings >> Click on Connection >> FTP: Choose Active >> Click on Connection >> FTP >> Active Mode: Select “Ask your operating system for the external IP address” >> Click on Connection >> FTP >> Passive Mode: Choose Fall Back to Active Mode >> Press OK.

Try connecting to your FTP site once again and it should work now.

If you are behind any firewall/security settings then make sure that they are configured to allow FTP access or disable the firewall/security settings and try again connecting to your FTP site.

If you have root access to your server then you may have a look to the logs (/var/log/secure and /var/log/messages files) for more information regarding FTP connectivity issue.

Connection Time Out in FTP

Usually Time Out Error occurs when we try to upload large files. We need to check following at our local system:

1. Make sure that the FTP settings in your client is correct like as hostname, username and password, port to connect etc.

2. Try enabling “passive mode” in FTP client.

3. Check personal firewall/security settings, programs like Norton Anti-Virus to make sure that they are configured to allow FTP access. Try turning these programs completely off and retry FTP.

4. Check for any timeout settings in local FTP client and try increasing this.

4. If you continue to have trouble, the time out via the FTP is most likely because of one or more dropped packets at your ISP or at any of the intermediate routers. When you connect to our server, you are usually going through 14-20 other routers before it gets to remote destination. If any one of them lose a packet it can cause problems with FTP. One way to get around this is to have a constant PING open – this keeps the connection through the different servers alive.

In Windows Machine :

open a DOS window on your computer and type the following, it will keep a ping open:
ping -t domainname.com

In Linux Machine, use the command line below:

ping domainname.com

PS : Replace “domainname.com” with your domain name. Then once your upload has completed, press Control-C to cancel the ping.
==============================
use Filezilla FTP client to manage files on many servers. I had a specific Filezilla client that refused to retrieve a directory listing. Other computers could connect to the same server just fine. Thusly I knew it was a client configuration problem.
I ended up with messages like this:
Response: 200 PORT command successful. Consider using PASV.
Command: LIST
Error: Connection timed out
Error: Failed to retrieve directory listing
I ran the Filezilla configuration wizard to diagnose the problem. The configuration wizard utility ran for a while reporting success until the very end. After timing out, I received the following messages:
Response: 200 PORT command successful
LIST
Response: 150 opening data connection
Response: 503 Failure of data connection.
Server sent invalid reply.
Connection closed
Searching the Internet led to not so helpful posts such as "Please read the Network Configuration guide.". After analyzing the situation, it turns out the solution isn't so obvious. My Client had the default setting of Connection -> FTP -> Active Mode: Get External IP Address From This URL. Which pointed to http://ip.filezilla-project.org/ip.php . This is the source of the problem. If you go to that URL, you will probably get a result of 127.0.0.1. If the Filezilla client needs the external address, and is given 127.0.0.1, then there will be problems indeed!
If you have a similar problem with Filezilla, and the problem persists even when the Windows Firewall is disabled,

here is what you need to do:
  • Open Filezilla, go to Edit -> Settings
  • Click on Connection -> FTP: Choose Active
  • Click on Connection -> FTP -> Active Mode: Select "Ask your operating system for the external IP address"
  • Click on Connection -> FTP -> Passive Mode: Choose Fall Back to Active Mode
  • Press OK.
Try connecting to your FTP site once again. Works!

Update: In some cases, and for reasons unknown, Filezilla just won't work. I have found that coreFTP is a nice FTP program that is free Windows software which includes the client FTP features you need. Features like SFTP (SSH), SSL, TLS, IDN, browser integration, site to site transfers, FTP transfer resume, drag and drop support, file viewing & editing, firewall support, custom commands, FTP URL parsing, command line transfers, filters, and much, much more!

==============================
I was connecting fine in active mode then this:
Command: PORT 10,0,0,101,235,118
Response: 501 Server cannot accept argument.
Command: PASV
Response: 227 Entering Passive Mode (22,11,55,33,195,182).
Command: LIST
Response: 150 Opening BINARY mode data connection.
Error: Connection timed out
Error: Failed to retrieve directory listing

it was switching to passive mode and trying port:
256*195+182=50102
I didn't see how to configure in filezilla what ports it used in the switch over. Seemed to use the same one each time so just opened ports 49152 - 50300 in the firewall.
Worked! got the directory listing.
===============================
I found two solutions that worked for me:

1, go to http://www.hotspotbot.com and down load Hot Spot Bot. Basically, the VPN will help you bypass firewall settings that could be on LAN or WAN routers. This solution worked but it was very slow. So,

2. Enable SFTP on the server and conect via SFTP. You may have to contact your hosting company or server administrator. In my case, I actually had to email a photo of my picture ID, but it was well worth it. It is fast, secure and reliable.

=================================

Status:   Resolving IP-Address for www.addinall.net
Status:   Connecting to 65.254.60.9:21...
Status:   Connection established, waiting for welcome message...
Response:   220---------- Welcome to Pure-FTPd [TLS] ----------
Response:   220-You are user number 2 of 50 allowed.
Response:   220-Local time is now 15:15. Server port: 21.
Response:   220-This is a private system - No anonymous login
Response:   220 You will be disconnected after 15 minutes of inactivity.
Command:   USER addinall
Response:   331 User addinall OK. Password required
Command:   PASS ********
Response:   230-User addinall has group access to: addinall
Response:   230 OK. Current restricted directory is /
Command:   SYST
Response:   215 UNIX Type: L8
Command:   FEAT
Response:   211-Extensions supported:
Response:    EPRT
Response:    IDLE
Response:    MDTM
Response:    SIZE
Response:    REST STREAM
Response:    MLST type*;size*;sizd*;modify*;UNIX.mode*;UNIX.uid*;UNIX.gid*;unique*;
Response:    MLSD
Response:    ESTP
Response:    PASV
Response:    EPSV
Response:    SPSV
Response:    ESTA
Response:    AUTH TLS
Response:    PBSZ
Response:    PROT
Response:   211 End.
Status:   Connected
Status:   Retrieving directory listing...
Command:   PWD
Response:   257 "/" is your current location
Command:   TYPE I
Response:   200 TYPE is now 8-bit binary
Command:   PASV
Response:   227 Entering Passive Mode (65,254,60,9,160,49)
Command:   LIST
Error:   Connection timed out
Error:   Failed to retrieve directory listing
Status:   Resolving IP-Address for www.addinall.net
Status:   Connecting to 65.254.60.9:21...
Status:   Connection established, waiting for welcome message...
Response:   220---------- Welcome to Pure-FTPd [TLS] ----------
Response:   220-You are user number 2 of 50 allowed.
Response:   220-Local time is now 15:23. Server port: 21.
Response:   220-This is a private system - No anonymous login
Response:   220 You will be disconnected after 15 minutes of inactivity.
Command:   USER addinall
Response:   331 User addinall OK. Password required
Command:   PASS ********
Response:   230-User addinall has group access to: addinall
Response:   230 OK. Current restricted directory is /
Status:   Connected
Status:   Retrieving directory listing...
Command:   PWD
Response:   257 "/" is your current location
Command:   TYPE I
Response:   200 TYPE is now 8-bit binary
Command:   PASV
Response:   227 Entering Passive Mode (65,254,60,9,234,232)
Command:   LIST
Error:   Connection timed out
Error:   Failed to retrieve directory listing
Status:   Resolving IP-Address for www.addinall.net
Trace:   ControlSocket.cpp(1003): CRealControlSocket::ContinueConnect(0p13a7fe0) m_pEngine=0p130d1c0 caller=0p1382d10
Status:   Connecting to 65.254.60.9:21...
Status:   Connection established, waiting for welcome message...
Trace:   CFtpControlSocket::OnReceive()
Response:   220---------- Welcome to Pure-FTPd [TLS] ----------
Response:   220-You are user number 3 of 50 allowed.
Response:   220-Local time is now 15:29. Server port: 21.
Response:   220-This is a private system - No anonymous login
Response:   220 You will be disconnected after 15 minutes of inactivity.
Trace:   CFtpControlSocket::SendNextCommand()
Command:   USER addinall
Trace:   CFtpControlSocket::OnReceive()
Response:   331 User addinall OK. Password required
Trace:   CFtpControlSocket::SendNextCommand()
Command:   PASS ********
Trace:   CFtpControlSocket::OnReceive()
Response:   230-User addinall has group access to: addinall
Response:   230 OK. Current restricted directory is /
Status:   Connected
Trace:   CFtpControlSocket::ResetOperation(0)
Trace:   CControlSocket::ResetOperation(0)
Status:   Retrieving directory listing...
Trace:   CFtpControlSocket::SendNextCommand()
Trace:   CFtpControlSocket::ChangeDirSend()
Command:   PWD
Trace:   CFtpControlSocket::OnReceive()
Response:   257 "/" is your current location
Trace:   CFtpControlSocket::ResetOperation(0)
Trace:   CControlSocket::ResetOperation(0)
Trace:   CFtpControlSocket::ParseSubcommandResult(0)
Trace:   CFtpControlSocket::ListSubcommandResult()
Trace:   CFtpControlSocket::SendNextCommand()
Trace:   CFtpControlSocket::TransferSend()
Command:   TYPE I
Trace:   CFtpControlSocket::OnReceive()
Response:   200 TYPE is now 8-bit binary
Trace:   CFtpControlSocket::TransferParseResponse()
Trace:   CFtpControlSocket::SendNextCommand()
Trace:   CFtpControlSocket::TransferSend()
Command:   PASV
Trace:   CFtpControlSocket::OnReceive()
Response:   227 Entering Passive Mode (65,254,60,9,159,9)
Trace:   CFtpControlSocket::TransferParseResponse()
Trace:   CFtpControlSocket::SendNextCommand()
Trace:   CFtpControlSocket::TransferSend()
Command:   LIST
Error:   Connection timed out
Trace:   CFtpControlSocket::ResetOperation(2114)
Trace:   CControlSocket::ResetOperation(2114)
Trace:   CFtpControlSocket::ResetOperation(2114)
Trace:   CControlSocket::ResetOperation(2114)
Error:   Failed to retrieve directory listing

Go to your site manager, click on Transfer Settings Tab.
Select the Transfer mode as "Active"
=============================
Status: Resolving address of xxx.com.ph
Status: Connecting to xxx.xxx.xxx.xxx:21...
Status: Connection established, waiting for welcome message...
Response: 220 FTP Server ready.
Command: USER ftp
Response: 331 Password required for ftp.
Command: PASS ********
Response: 230 User ftp logged in.
Status: Connected
Status: Retrieving directory listing...
Command: PWD
Response: 257 "/" is current directory.
Command: TYPE I
Response: 200 Type set to I
Command: PORT 203,177,6,3,24,247
Response: 200 PORT command successful
Command: LIST
Response: 425 Unable to build data connection: Connection refused
Error: Failed to retrieve directory listing

----->Response: 227 Entering Passive Mode (xxx,xxx,xxx,xxx,172,252).


=====================================
Status: Resolving address of xxx.com.ph
Status: Connecting to xxx.xxx.xxx.xxx:21...
Status: Connection established, waiting for welcome message...
Response: 220 FTP Server ready.
Command: USER ftp
Response: 331 Password required for ftp.
Command: PASS ********
Response: 230 User ftp logged in.
Command: SYST
Response: 215 UNIX Type: L8
Command: FEAT
Response: 211-Features:
Response: MDTM
Response: REST STREAM
Response: SIZE
Response: 211 End
Status: Connected
Status: Retrieving directory listing...
Command: PWD
Response: 257 "/" is current directory.
Command: TYPE I
Response: 200 Type set to I
Command: PASV
Response: 227 Entering Passive Mode (xxx,xxx,xxx,xxx,172,252).
Command: LIST
Error: Connection timed out
Error: Failed to retrieve directory listing

-------> 
See if you can change the transfer type under the transfer menu. If it is set to auto, change it to binary, and try that. If that doesn't work, try it in ascii.

=====================================


Try Cmd Promt:

ftp yourservername.com

it asks for username and password.

type help for commands

use dos or unix type commands

cd directoryname
for change directory to directoryname

try listing out directories by typing dir
dir for current directory and dir directoryname for listing directoryname

If a directory doesn't list with dir then try using ls instead of dir

I'm finding that the listing problem only occurs when listing with dir and only with directories with a larger number of files. The dir is the equivalent to the LIST (ls -l) used by filezilla.

I would like to know if this is the same with anybody else.  
========================
 
Posted by Sankar Kodipilla at 00:55 No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest

Wednesday, 20 June 2012

SmartSVN Installation Steps Error's

How to install subversion on Linux and make it working choose below link..
http://minisaha.wordpress.com/2008/02/18/how-to-install-subversion-on-linux-and-make-it-working/


SMARTSVN:

Download Latest Version:http://www.syntevo.com/smartsvn/download.html

JDK or jre download link:http://www.oracle.com/technetwork/java/javase/downloads/index.html

 Requirements

SmartSVN requires a Java Runtime Environment (JRE) 1.5 or higher to run. We recommend to use the latest JRE 1.6 to be able to use all features.
  • For Microsoft Windows 2000/XP/2003/Vista/7, you may choose the installer with JRE.
  • For Mac OS X, version 10.5 or newer, the necessary JRE is present on your system.
  • For other platforms, you can download platform-specific JRE packages from SUN's website.

Installation Instructions

  • unpack the downloaded file into a directory of your choice,
  • ensure, that the correct Java Runtime Environment is installed on your system,
  • start the application by using the launcher script from the bin directory
If the application fails to start, e.g. because you have an incompatible JRE version on your system, it might be necessary to set the SMARTSVN_JAVA_HOME environment variable to the root path of the Java Runtime Environment 1.6 from SUN. To create an icon on your desktop, you'll find suitable images in different sizes in the bin directory.

Fix smartsvn.sh so it will run

Use this command from the terminal if you don't know what to use:

gedit smartsvn.sh
Then at line 6 you will see the JAVA_HOME variable is commented out. Now you need to know where you installed java to, but on my CentOS 5.2 installation it was here:
JAVA_HOME=usr/java/latest
Save the smartsvn.sh file and try again, from the terminal:
sh smartsvn.sh
Hope that works for you.

 



Hi I am also having a problem

Can any one help? ./smartsvn.sh does not load

Java JRE installed - see below:

[root@centos usr]# ls -la

total 288
drwxr-xr-x  15 root root  4096 Oct 11 11:35 .
drwxr-xr-x  26 root root  4096 Nov 20 11:42 ..
drwxr-xr-x   2 root root 69632 Nov 20 11:22 bin
drwxr-xr-x   2 root root  4096 Mar  9  2009 etc
drwxr-xr-x   2 root root  4096 Mar  9  2009 games
drwxr-xr-x 132 root root 12288 Nov 20 10:17 include
drwxr-xr-x   3 root root  4096 Nov 20 11:22 java
drwxr-xr-x   6 root root  4096 Sep  4 02:02 kerberos
drwxr-xr-x 143 root root 69632 Nov 20 10:27 lib
drwxr-xr-x  17 root root  4096 Nov 20 10:21 libexec
drwxr-xr-x  11 root root  4096 Nov 19 16:19 local
drwxr-xr-x   2 root root 20480 Nov 20 10:21 sbin
drwxr-xr-x 276 root root 12288 Nov 20 10:19 share
drwxr-xr-x   4 root root  4096 Nov 19 16:33 src
lrwxrwxrwx   1 root root    10 Nov 19 16:19 tmp -> ../var/tmp
drwxr-xr-x   3 root root  4096 Nov 19 16:23 X11R6

[root@centos lib]# ls -la | more

total 276676
drwxr-xr-x   2 root root     4096 Nov 20 11:48 java
drwxr-xr-x   2 root root     4096 Mar 14  2007 java-1.3.1
drwxr-xr-x   2 root root     4096 Mar 14  2007 java-1.4.0
drwxr-xr-x   2 root root     4096 Mar 14  2007 java-1.4.1
drwxr-xr-x   2 root root     4096 Mar 14  2007 java-1.4.2
drwxr-xr-x   2 root root     4096 Mar 14  2007 java-1.5.0
drwxr-xr-x   2 root root     4096 Mar 14  2007 java-1.6.0
drwxr-xr-x   2 root root     4096 Mar 14  2007 java-ext

SmartSVN in Root directory

[root@centos /]# ls -la

total 190
drwxr-xr-x  26 root root  4096 Nov 20 11:42 .
drwxr-xr-x  26 root root  4096 Nov 20 11:42 ..
-rw-r--r--   1 root root     0 Nov 20 11:33 .autofsck
drwxr-xr-x   2 root root  4096 Mar 22  2007 .automount
-rw-r--r--   1 root root     0 Nov 20 10:34 .autorelabel
drwxr-xr-x   2 root root  4096 Nov 20 10:26 bin
drwxr-xr-x   4 root root  1024 Nov 20 10:20 boot
drwxr-xr-x  12 root root  4100 Nov 20 11:34 dev
drwxr-xr-x 119 root root 12288 Nov 20 16:10 etc
drwxr-xr-x   4 root root  4096 Nov 20 12:04 home
drwxr-xr-x  13 root root 12288 Nov 20 10:26 lib
drwx------   2 root root 16384 Nov 19 16:11 lost+found
drwxr-xr-x   2 root root  4096 Mar  9  2009 media
drwxr-xr-x   2 root root     0 Nov 20 11:33 misc
drwxr-xr-x   2 root root  4096 Mar  9  2009 mnt
drwxr-xr-x   2 root root     0 Nov 20 11:33 net
drwxr-xr-x   2 root root  4096 Mar  9  2009 opt
dr-xr-xr-x 154 root root     0 Nov 20 11:32 proc
drwxr-x---  17 root root  4096 Nov 20 16:10 root
drwxr-xr-x   2 root root 12288 Nov 20 10:22 sbin
drwxr-xr-x   2 root root  4096 Nov 19 16:12 selinux
drwxr-xr-x   3 root root  4096 Nov 20 11:43 SmartSVN
drwxr-xr-x   2 root root  4096 Mar  9  2009 srv
drwxr-xr-x  12 root root     0 Nov 20 11:32 sys
drwxr-xr-x   3 root root  4096 Sep 26 17:30 tftpboot
drwxrwxrwt  12 root root  4096 Nov 20 16:13 tmp
drwxr-xr-x  15 root root  4096 Oct 11 11:35 usr
drwxr-xr-x  28 root root  4096 Nov 19 16:46 var

SmartSVN not loading - What do I have to change in script (Shell)

[root@centos /]# cd /SmartSVN

[root@centos SmartSVN]# cd smartsvn-6_0_8
[root@centos smartsvn-6_0_8]# cd bin
[root@centos bin]# ls -la
total 48
drwxr-xr-x 2 root root  4096 Nov 20 12:09 .
drwxr-xr-x 7 root root  4096 Nov 20 11:30 ..
-rwxr--r-- 1 root root 10143 Nov 19 15:49 smartsvn-128x128.png
-rwxr--r-- 1 root root  1605 Nov 19 15:49 smartsvn-32x32.png
-rwxr--r-- 1 root root  2614 Nov 19 15:49 smartsvn-48x48.png
-rwxr--r-- 1 root root  3871 Nov 19 15:49 smartsvn-64x64.png
-rwxr--r-- 1 root root  2215 Nov 19 15:49 smartsvn.cmd
-rwxr--r-- 1 root root  3066 Nov 19 15:49 smartsvn.ico
-rwxr--r-- 1 root root  2719 Nov 20 12:09 smartsvn.sh
-rw-r--r-- 1 root root  2714 Nov 20 11:39 smartsvn.sh~
[root@centos bin]# ./smartsvn.sh
Exception in thread "main" java.lang.NoClassDefFoundError: smartsvn.VD
   at java.lang.Class.initializeClass(libgcj.so.7rh)
   at java.lang.Class.initializeClass(libgcj.so.7rh)
   at SmartSVN.main(SourceFile:11)
Caused by: java.lang.ClassNotFoundException: com.sun.java.swing.plaf.windows.WindowsLookAndFeel not found in gnu.gcj.runtime.SystemClassLoader{urls=[file:/SmartSVN/smartsvn-6_0_8/lib/smartsvn.jar], parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}
   at java.net.URLClassLoader.findClass(libgcj.so.7rh)
   at gnu.gcj.runtime.SystemClassLoader.findClass(libgcj.so.7rh)
   at java.lang.ClassLoader.loadClass(libgcj.so.7rh)
   at java.lang.ClassLoader.loadClass(libgcj.so.7rh)
   at java.lang.VMClassLoader.defineClass(libgcj.so.7rh)
   at java.lang.ClassLoader.defineClass(libgcj.so.7rh)
   at java.security.SecureClassLoader.defineClass(libgcj.so.7rh)
   at java.net.URLClassLoader.findClass(libgcj.so.7rh)
   at gnu.gcj.runtime.SystemClassLoader.findClass(libgcj.so.7rh)
   at java.lang.ClassLoader.loadClass(libgcj.so.7rh)
   at java.lang.ClassLoader.loadClass(libgcj.so.7rh)
   at java.lang.Class.forName(libgcj.so.7rh)
   at java.lang.Class.initializeClass(libgcj.so.7rh)
   ...2 more
Posted by Sankar Kodipilla at 04:21 No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest

Linux Real Time Issues-3

Q: Hello friends,
I am using opensuse 10.3 and I want to create a live CD. There are number of live CDs are available on net but I want to create my own so that I can customize it according to my requirement.
Kindly suggest me the steps to create.

Ans:i,

One of many ways to create your own distro

visit:

http://www.linuxfromscratch.org/

=================================================
Posted by Sankar Kodipilla at 00:19 No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest

Linux Real Time Issues-2

Q:Hi,

I migrate to RHEL6.2 and now I have problem initialization network cards.
My problem is :

I installed OS as a server and when I want to configure the network, I see there are 4 connections for example :
eth0 ,eth1,eth2,eth3.
And when I place these Hard disk(has this version of OS6.2) on to another HP Server or HP Blade.
And when system restart, the network shows:
eth4, eth5,eth6, eth7
It shows that the system remain the previous network configuration somewhere
when I delete all of them and reconfigure again, it shows again number 4,5,6,7.
I configured net devices on /etc/sysconfig/networking/devices
with the name ifcfg-eth0,ifcfg-eth1,ifcfg-eth2,ifcfg-eth3 with static IP 1.1.1.1/24,2.2.2.2/24,3.3.3.3/24,4.4.4.4/24
and when I restart service NetworkManager
some of my device name doesn't change.
I found that the uuid and HWADDR stay in configuration file .and for example on my server when I config the server as the same as above and run ifconfig:
I saw eth0 and eth3 but the eth6, eth7 doesn't change.
I need the urgent help.
Please help me to solve.
I need to setup network connection on Blade servers with 4 connection
for DB.

Regards

Ans: 

1.Network-Manager configure it?
Thanks!


2.I have seen this happen while cloning centos 6.x virtual machines.

The problem is that udev caches the mac addresses of the nic cards so when
you swap the disks to a new box. It sees them as new devices and assigns
new the numbers.

I believe I was able to keep this from happening by removing the mac
addresses from the /etc/sysconfig/network-scripts/ifcfg-eth* files and
then when booting the cloned vm up for the first time (or in your case, the
other blade), boot to single user mode, remove (or rename)
/etc/udev/rules.d/70-persistent-net.rules.

Then reboot again. udev should recreate the 70-persistent-net.rules file
with the new mac addresses and use them as eth0, eth1, eth2 and eth3.

HTH
George


Thanks a lot for your guidance. I saw the path you had been referred to it and now I'm trying on some servers. One server on Blade and the other on HP DL380.
I'm trying. I hope I can start network connection correctly.

Regards



3.Hi,
I could change the /etc/udev/rules.d/70*net.rules
but when I change the network connection on Blade system the device number would changed too. For example eth0 --> eth4 and so on..
Also it seem there is somewhere in configuration files that limited us that only 1 or 2 connection can be talk to each other on different servers.
Now I configured networks connections 4 address 1.1.1.10,2.2.2.10,3.3.3.10,4.4.4.10 and on the other server I set the network as : 1.1.1.1 2.2.2.2 3.3.3.3 4.4.4.4
but only ip range 4 can ping each other I also disable iptables, but the other connections don't ping each others


4.hese are not packages - these are the flatfiles Linux uses to manage the
network interfaces.

For each of your network cards, you should have a file under
/etc/sysconfig/network-scripts/ifcfg-eth[0|1|2|3]

One of mine off a Centos 6 box looks like:

cb6 obsr> cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=none
HWADDR=00:0c:19:02:ff:38
NM_CONTROLLED=yes
ONBOOT=yes
IPADDR=192.168.10.57
NETMASK=255.255.255.0
DNS2=4.4.4.4
TYPE=Ethernet
GATEWAY=192.168.10.1
DNS1=8.8.8.8
IPV6INIT=no
USERCTL=no


To make the OS drives "portable" between machines, try editing out the
HWADDR - put a # in front of it.
Then try removing the udev file and reboot - since your ifcfg-eth# files
are no longer bound to the mac addresses, udev should reassign them as
0,1,2,3
============================================
Posted by Sankar Kodipilla at 00:18 2 comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest

Linux Real Time Issues-1

-------------------------------------------
Q:Dear Friends,

I am running one application with Ubuntu 10.10. The application is working
fine.

Now I want to set a cron job in such a way so that it will fire a sql query
and create a .csv file and then it should send a mail to a particular
person with the attachment.

So for that I have set a cron job using command 'crontab -e' as below

0 21 * * * mysql -uroot -p'<pwd>' rnl_db -B -e "select * from \`Status\`;"
| sed 's/\t/","/g;s/^/"/;s/$/"/;s/\n/ /g' > status_report.csv | mail -s
"Status Report" email@removed

It fires a sql command, it is creating a file but it doesn't send a mail.

Could anybody can help me to come out from this problem?
How can I send mail with attachment using cron?
Is there any other way?

Thanks & regards,

Ans:

1. Instead of using the mail command, try using mutt.

http://www.mutt.org/doc/man_page.html

something like this should work :
export EMAIL="Me email@removed" && mutt -s "subject" -a
/home/user/directory/file*.xls -- email@removed, email@removed <
/home/user/directory/message.txt

-a is the file to attach
-s is the subject
user1, user2 are the recipients
and message.txt is the body of the email

2. Hi,

" > status_report.csv | " is a part of your script

> means redirection and standard output of process will send to "status_report.csv"

Then pipe sign "|" means send standard output of process will be standard
input of next command.

">" and "|" together has no meaning you can use "tee" command.

Tee has one input and two outputs.


3. The shell is never getting to your mail command.
Once you used the > to redirect standard output
to the status_report.csv file there was no data to
feed to the pipe | so even if the mail command
could run, it would have had nothing to mail.
Here is one possible solution that may work for you:
1) Replace the pipe | with a semi-colon ;
this will cause the mail to run as a completely separate command
2) add <status.report.csv to end of the mail command
This will tell the mail command to mail out the file you just created.


4.
(1) Is it port 25 open

check

# netstat -ntpl | grep :25


(2) is iptable is active

iptables -L

if yes then

# iptables -f
# service iptables stop
#chkconfig iptbales off

(3) is selinux is working

to check

# getenforce
if 1

then

setenforce = 0 (TEMPERORY SOLUTION)

(4)

what is the size of csv file

send me the out put of /var/log/maillog
Posted by Sankar Kodipilla at 00:14 No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest

Tuesday, 19 June 2012

How do I fix “Ubuntu is running in low-graphics mode?

1. Look in your /var/log/Xorg.0.log.old or /var/log/Xorg.0.log. The error (if there is one) will be at the tail end of the file. Another good place to look is the log files in /var/log/gdm/* (or /var/log/lightdm/* in oneiric).

2.Follow these commands:
sudo apt-get update
sudo apt-get -d install --reinstall gdm
sudo apt-get remove --purge gdm
sudo apt-get install gdm
select GDM when prompted
sudo reboot
That fixed it for me :)

3.Try delete your /etc/X11/xorg.conf and restart.
Before restart, run
sudo apt-get install xserver-xorg-video-ati xserver-xorg-video-radeon

Posted by Sankar Kodipilla at 03:55 No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest

Thursday, 14 June 2012

Top Ten Tomcat Configuration Tips

1. Configuring the Admin Web Application

Most commercial J2EE servers provide a fully functional administrative interface, and many of these are accessible as web applications. The Tomcat Admin application is on its way to becoming a full-blown Tomcat 

administration tool rivaling these commercial offerings. First included in Tomcat 4.1, Admin already provides control over contexts, data sources, and users and groups. You can also control resources such as initialization parameters, as well as users, groups, and roles in a variety of user databases. The list of capabilities will be expanded upon in future releases, but the present implementation has proven itself to be quite useful.


The Admin web application is defined in the auto-deployment file CATALINA_BASE/webapps/admin.xml.

You must edit this file to ensure that the path specified in the docBase attribute of the Context element is absolute; that is, the absolute path of CATALINA_HOME/server/webapps/admin. Alternatively, you could just remove the auto-deployment file and specify the Admin context manually in your server.xml file. On machines that will not be managed by this application, you should probably disable it altogether by simply removing CATALINA_BASE/webapps/admin.xml.

If you're using a UserDatabaseRealm (the default), you'll need to add a user and a role to the CATALINA_BASE/conf/tomcat-users.xml file. For now, just edit this file, and add a role named "admin" to your users database:
<role name="admin"/>
You must also have a user who is assigned to the "admin" role. Add a user line like this after the existing user entries (changing the password to something a bit more secure):
<user name="admin" password="deep_dark_secret" roles="admin"/>
Once you've performed these steps and restarted Tomcat, visit the URL http://localhost:8080/admin, and you should see a login screen. The Admin application is built using container-managed security and the Jakarta Struts framework. Once you have logged in as a user assigned to the admin role, you will be able to use the Admin application to configure Tomcat.

2. Configuring the Manager Web Application

The Manager web application lets you perform simple management tasks on your web applications through a more simplified web user interface than that of the Admin web app.

The Manager web application is defined in the auto-deployment file CATALINA_BASE/webapps/manager.xml.

You must edit this file to ensure that the path specified in the docBase attribute of the Context element is absolute; that is, the absolute path of CATALINA_HOME/server/webapps/manager.

If you're using the default UserDatabaseRealm, you'll need to add a user and role to the CATALINA_BASE/conf/tomcat-users.xml file. For now, just edit this file, and add a role named "manager" to your users database:
<role name="manager"/>
 
You must also have a user who is assigned the "manager" role. Add a user line like this after the existing user entries (changing the password to something a bit more secure):
<user name="manager" password="deep_dark_secret" roles="manager"/>
 
Then restart Tomcat and visit the URL http://localhost/manager/list to see the plain-text manager interface, or http://localhost/manager/html/list for the simple HTML manager interface. Either way, your Manager application should now be working.

The Manager application lets you install new web applications on a non-persistent basis, for testing. If we have a web application in /home/user/hello and want to test it by installing it under the URI /hello, we put "/hello" in the first text input field (for Path) and "file:/home/user/hello" in the second text input field (for Config URL).

The Manager also allows you to stop, reload, remove, or undeploy a web application. Stopping an application makes it unavailable until further notice, but of course it can then be restarted. Users attempting to access a stopped application will receive an error message, such as 503 - This application is not currently available.

Removing a web application removes it only from the running copy of Tomcat -- if it was started from the configuration files, it will reappear the next time you restart Tomcat (i.e., removal does not remove the web application's content from disk).

3. Deploying a Web Application

There are two ways of deploying a web application on the filesystem:
1. Copy your WAR file or your web application's directory (including all of its content) to the $CATALINA_BASE/webapps directory.

2. Create an XML fragment file with just the Context element for your web application, and place this XML file in $CATALINA_BASE/webapps. The web application itself can then be stored anywhere on your filesystem.

If you have a WAR file, you can deploy it by simply copying the WAR file into the directory CATALINA_BASE/webapps. The filename must end with an extension of ".war". Once Tomcat notices the file, it will (by default) unpack it into a subdirectory with the base name of the WAR file. It will then create a context in memory, just as though you had created one by editing Tomcat's server.xml file. However, any necessary defaults will be obtained from the DefaultContext element in Tomcat's server.xml file.

Another way to deploy a web app is by writing a Context XML fragment file and deploying it into the CATALINA_BASE/webapps directory. A context fragment is not a complete XML document, but just one Context element and any subelements that are appropriate for your web application. These files are like Context elements cut out of the server.xml file, hence the name "context fragment."

For example, if we wanted to deploy the WAR file MyWebApp.war along with a realm for accessing parts of that web application, we could use this fragment:

<!--  
  Context fragment for deploying MyWebApp.war  
 -->
<Context path="/demo" docBase="webapps/MyWebApp.war" 
         debug="0" privileged="true">
  <Realm className="org.apache.catalina.realm.UserDatabaseRealm"                
         resourceName="UserDatabase"/> 
</Context>
 
Put that in a file called "MyWebApp.xml," and copy it into your CATALINA_BASE/webapps directory.

These context fragments provide a convenient method of deploying web applications; you do not need to edit the server.xml file and, unless you have turned off the default liveDeploy feature, you don't have to restart Tomcat to install a new web application.

4. Configuring Virtual Hosts

The Host element normally needs modification only when you are setting up virtual hosts. Virtual hosting is a mechanism whereby one web server process can serve multiple domain names, giving each domain the appearance of having its own server. In fact, the majority of small business web sites are implemented as virtual hosts, due to the expense of connecting a computer directly to the Internet with sufficient bandwidth to provide reasonable response times and the stability of a permanent IP address. 

Name-based virtual hosting is created on any web server by establishing an aliased IP address in the Domain Name Service (DNS) data and telling the web server to map all requests destined for the aliased address to a particular directory of web pages. Since this article is about Tomcat, we don't try to show all of the ways to set up DNS data on various operating systems. If you need help with this, please refer to DNS and Bind, by Paul Albitz and Cricket Liu (O'Reilly). For demonstration purposes, I'll use a static hosts file, since that's the easiest way to set up aliases for testing purposes.

To use virtual hosts in Tomcat, you just need to set up the DNS or hosts data for the host. For testing, making an IP alias for localhost is sufficient. You then need to add a few lines to the server.xml configuration file:

<Server port="8005" shutdown="SHUTDOWN" debug="0">
  <Service name="Tomcat-Standalone">
    <Connector className="org.apache.coyote.tomcat4.CoyoteConnector"
   port="8080" minProcessors="5" maxProcessors="75"
   enableLookups="true" redirectPort="8443"/>
    <Connector className="org.apache.coyote.tomcat4.CoyoteConnector"
   port="8443" minProcessors="5" maxProcessors="75"
   acceptCount="10" debug="0" scheme="https" secure="true"/>
      <Factory className="org.apache.coyote.tomcat4.CoyoteServerSocketFactory"
   clientAuth="false" protocol="TLS" />
    </Connector>
    <Engine name="Standalone" defaultHost="localhost" debug="0">
      <!-- This Host is the default Host -->
      <Host name="localhost" debug="0" appBase="webapps"
       unpackWARs="true" autoDeploy="true">
        <Context path="" docBase="ROOT" debug="0"/>
        <Context path="/orders" docBase="/home/ian/orders" debug="0"
                       reloadable="true" crossContext="true">
        </Context>
      </Host>
      <!-- This Host is the first "Virtual Host": www.example.com -->
      <Host name="www.example.com" appBase="/home/example/webapp">
        <Context path="" docBase="."/>
      </Host>
    </Engine>
  </Service>
</Server>
Tomcat's server.xml file, as distributed, contains only one virtual host, but it is easy to add support for additional virtual hosts. The simplified version of the server.xml file in the previous example shows in bold the overall additional structure needed to add one virtual host. Each Host element must have one or more Context elements within it; one of these must be the default Context for this host, which is specified by having its relative path set to the empty string (for example, path="").

5. Configuring Basic Authentication

Container-managed authentication methods control how a user's credentials are verified when a web app's protected resource is accessed. When a web application uses basic authentication (BASIC in the web.xml file's auth-method element), Tomcat uses HTTP basic authentication to ask the web browser for a username and password whenever the browser requests a resource of that protected web application. With this authentication method, all passwords are sent across the network in base64-encoded text.

Note: using basic authentication is generally considered insecure because it does not strongly encrypt passwords, unless the site also uses HTTPS or some other form of encryption between the client and the server (for instance, a virtual private network). Without this extra encryption, network monitors can intercept (and misuse) users' passwords. But, if you're just starting to use Tomcat, or if you just want to test container-managed security with your web app, basic authentication is easy to set up and test. Just add <security-constraint> and <login-config> elements to your web app's web.xml file, and add the appropriate <role> and <user> elements to your CATALINA_BASE/conf/tomcat-users.xml file, restart Tomcat, and Tomcat takes care of the rest.

The example below shows a web.xml excerpt from a club membership web site with a members-only subdirectory that is protected using basic authentication. Note that this effectively takes the place of the Apache web server's .htaccess files.

<!--
  Define the Members-only area, by defining
  a "Security Constraint" on this Application, and
  mapping it to the subdirectory (URL) that we want
  to restrict.
 -->
<security-constraint>
  <web-resource-collection>
    <web-resource-name>
      Entire Application
    </web-resource-name>
    <url-pattern>/members/*</url-pattern>
  </web-resource-collection>
  <auth-constraint>
      <role-name>member</role-name>
  </auth-constraint>
</security-constraint>
<!-- Define the Login Configuration for this Application -->
<login-config>
  <auth-method>BASIC</auth-method>
  <realm-name>My Club Members-only Area</realm-name>
</login-config>
 

6. Configuring Single Sign-On

Once you've set up your realm and method of authentication, you'll need to deal with the actual process of logging the user in. More often than not, logging into an application is a nuisance to an end user, and you will need to minimize the number of times they must authenticate. By default, each web application will ask the user to log in the first time the user requests a protected resource. This can seem like a hassle to your users if you run multiple web applications and each application asks the user to authenticate. Users cannot tell how many separate applications make up any single web site, so they won't know when they're making a request that crosses a context boundary, and will wonder why they're being repeatedly asked to log in.

The "single sign-on" feature of Tomcat 4 allows a user to authenticate only once to access all of the web applications loaded under a virtual host. To use this feature, you need only add a SingleSignOn Valve element at the host level. This looks like the following:
<Valve className="org.apache.catalina.authenticator.SingleSignOn" debug="0"/> 
 
The Tomcat distribution's default server.xml contains a commented-out single sign-on Valve configuration example that you can uncomment and use. Then, any user who is considered valid in a context within the configured virtual host will be considered valid in all other contexts for that same host.
There are several important restrictions for using the single sign-on valve:
  • The valve must be configured and nested within the same Host element that the web applications (represented by Context elements) are nested within.
  • The Realm that contains the shared user information must be configured either at the level of the same Host or in an outer nesting.
  • The Realm cannot be overridden at the Context level.
  • The web applications that use single sign-on must use one of Tomcat's built-in authenticators (in the <auth-method> element of web.xml), rather than a custom authenticator. The built-in methods are basic, digest, form, and client-cert authentication.
  • If you're using single sign-on and wish to integrate another third-party web application into your web site, and the new web application uses only its own authentication code that doesn't use container-managed security, you're basically stuck. Your users will have to log in once for all of the web applications that use single sign-on, and then once again if they make a request to the new third-party web application. Of course, if you get the source and you're a developer, you could fix it, but that's probably not so easy to do.
  • The single sign-on valve requires the use of HTTP cookies.

7. Configuring Customized User Directories

Some sites like to allow individual users to publish a directory of web pages on the server. For example, a university department might want to give each student a public area, or an ISP might make some web space available on one of its servers to customers that don't have a virtually hosted web server. 

In such cases, it is typical to use the tilde character (~) plus the user's name as the virtual path of that user's web site:
http://www.cs.myuniversity.edu/~username 
http://members.mybigisp.com/~username
 
Tomcat gives you two ways to map this on a per-host basis, using a couple of special Listener elements. The Listener's className attribute should be org.apache.catalina.startup.UserConfig, with the userClass attribute specifying one of several mapping classes. If your system runs Unix, has a standard /etc/passwd file that is readable by the account running Tomcat, and that file specifies users' home directories, use the PasswdUserDatabase mapping class:

<Listener className="org.apache.catalina.startup.UserConfig" directoryName="public_html" userClass="org.apache.catalina.startup.PasswdUserDatabase"/>
 
Web files would need to be in directories such as /home/users/ian/public_html or /users/jbrittain/public_html. Of course, you can change public_html to be whatever subdirectory into which your users put their personal web pages.
In fact, the directories don't have to be inside of a user's home directory at all. If you don't have a password file but want to map from a user name to a subdirectory of a common parent directory such as /home, use the HomesUserDatabase class:

<Listener className="org.apache.catalina.startup.UserConfig" directoryName="public_html" homeBase="/home" userClass="org.apache.catalina.startup.HomesUserDatabase"/>
 
In this case, web files would be in directories such as /home/ian/public_html or /home/jasonb/public_html. This format is more useful on Windows, where you'd likely use a directory such as C:\home.
These Listener elements, if present, must be inside of a Host element, but not inside of a Context element, as they apply to the Host itself.

8. Using CGI Scripts with Tomcat

Tomcat is primarily meant to be a servlet/JSP container, but it has many capabilities rivalling a traditional web server. One of these is support for the Common Gateway Interface (CGI), which provides a means for running an external program in response to a browser request, typically to process a web-based form. CGI is called "common" because it can invoke programs in almost any programming or scripting language: Perl, Python, awk, Unix shell scripting, and even Java are all supported options. However, you probably wouldn't run a Java application as a CGI due to the start-up overhead; elimination of this overhead was what led to the original design of the servlet specification. Servlets are almost always more efficient than CGIs because you're not starting up a new operating-system-level process every time somebody clicks on a link or button.

Tomcat includes an optional CGI servlet that allows you to run legacy CGI scripts; the assumption is that most new back-end processing will be done by user-defined servlets and JSPs.
To enable Tomcat's CGI servlet, you must do the following:
  1. Rename the file servlets-cgi.renametojar (found in CATALINA_HOME/server/lib/) to servlets-cgi.jar, so that the servlet that processes CGI scripts will be on Tomcat's CLASSPATH.
  2. In Tomcat's CATALINA_BASE/conf/web.xml file, uncomment the definition of the servlet named cgi (this is around line 241 in the distribution).
  3. Also in Tomcat's web.xml, uncomment the servlet mapping for the cgi servlet (around line 299 in the distributed file). Remember, this specifies the HTML links to the CGI script.
  4. Either place the CGI scripts under the WEB-INF/cgi directory (remember that WEB-INF is a safe place to hide things that you don't want the user to be able to view, for security reasons), or place them in some other directory within your context and adjust the cgiPathPrefix initialization parameter of the CGIServlet to identify the directory containing the files. This specifies the actual location of the CGI scripts, which typically will not be the same as the URL in the previous step.
  5. Restart Tomcat, and your CGI processing should now be operational.
The default directory for the servlet to locate the actual scripts is WEB-INF/cgi. As has been noted, the WEB-INF directory is protected against casual snooping from browsers, so this is a good place to put CGI scripts, which may contain passwords or other sensitive information. For compatibility with other servers, though, you may prefer to keep the scripts in the traditional directory, /cgi-bin, but be aware that files in this directory may be viewable by the curious web surfer. Also, on Unix, be sure that the CGI script files are executable by the user under which you are running Tomcat.

9. Changing Tomcat's JSP Compiler

In Tomcat 4.1 (and above, presumably), compilation of JSPs is performed by using the Ant program controller directly from within Tomcat. This sounds a bit strange, but it's part of what Ant was intended for; there is a documented API that lets developers use Ant without starting up a new JVM. This is one advantage of having Ant written in Java. Plus, it means you can now use any compiler supported by the javac task within Ant; these are listed in the javac page of the Apache Ant manual. It is easy to use because you need only an <init-param> with a name of "compiler" and a value of one of the supported compiler names:

<servlet> 
<servlet-name>jsp</servlet-name> 
 <servlet-class> org.apache.jasper.servlet.JspServlet </servlet-class> 
 <init-param> <param-name>logVerbosityLevel</param-name> <param-value>WARNING</param-value> </init-param> 
 <init-param> <param-name>compiler</param-name> 
 <param-value>jikes</param-value> </init-param> 
 <load-on-startup>3</load-on-startup> 
</servlet>
 
Of course, the given compiler must be installed on your system, and the CLASSPATH may need to be set, depending on which compiler you choose.

10. Restricting Access to Specific Hosts

Sometimes you'll only want to restrict access to Tomcat's web app to only specified host names or IP addresses. This way, only clients at those specified sites will be served content. Tomcat comes with two Valves that you can configure and use for this purpose: RemoteHostValve and RemoteAddrValve.

These Valves allow you to filter requests by host name or by IP address, and to allow or deny hosts that match, similar to the per-directory Allow/Deny directives in Apache httpd. If you run the Admin application, you might want to only allow access to it from localhost, as follows:

<Context path="/path/to/secret_files" ...> <Valve className="org.apache.catalina.valves.RemoteAddrValve" allow="127.0.0.1" deny=""/> 
</Context> 
 
If no allow pattern is given, then patterns that match the deny attribute patterns will be rejected, and all others will be allowed. Similarly, if no deny pattern is given, patterns that match the allow attribute will be allowed, and all others will be denied.
Jason Brittain is a Senior Software Engineer at Symantec Corporation's Network and Gateway Security Solutions Team, working on the AntiSpam product. He has contributed to many Apache Jakarta projects, and has been an active open source software developer for several years. 

Error's:
I am getting an error while deploying war file in webapps folder of tomcat 6.
The error is : Deploy of war file
1.getConfigured
2.authentication error
3.Cannot deploy the war file becoz of previous errors.

2.Dynamic Domains pointing to the same application 
Hi
How would i be able to create dynamic domains for the users.

Lets say my application is www.app.com and a user should be able to create his/her site like www.ravi.app.com . Please let me know how would i be able to do this.

3.Deploying war file in Tomcat server 
Hi there,
I am having a war file located not in the tomcat root directory ie. say the war file is located at some directory like this (E:\personal\sample.war) i want to deploy it without taking it to the root directory.Can any one suggest how..

  • Hi..
    i hope you already found the solution for the issue you mentioned. if not just follow these steps.. create a xml and place it in %tomcat_home%/conf/catalina/localhost folder and update the docBase attribute value to point to the location where your actual build is present. If you need any additional information you can contact me back on jagannath.kadimi@datafarminc.com

 
 
Posted by Sankar Kodipilla at 23:26 No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Newer Posts Older Posts Home
Subscribe to: Posts (Atom)

Search This Blog

About Me

My photo
Sankar Kodipilla
View my complete profile

Followers

Blog Archive

  • ►  2021 (4)
    • ►  September (1)
    • ►  February (3)
  • ►  2020 (8)
    • ►  October (1)
    • ►  July (1)
    • ►  June (2)
    • ►  May (1)
    • ►  February (3)
  • ►  2019 (4)
    • ►  July (1)
    • ►  May (1)
    • ►  March (2)
  • ►  2018 (18)
    • ►  December (1)
    • ►  July (1)
    • ►  June (1)
    • ►  May (7)
    • ►  April (3)
    • ►  March (5)
  • ►  2017 (4)
    • ►  October (2)
    • ►  August (2)
  • ►  2016 (4)
    • ►  December (3)
    • ►  April (1)
  • ►  2015 (1)
    • ►  April (1)
  • ►  2013 (15)
    • ►  April (4)
    • ►  March (4)
    • ►  January (7)
  • ▼  2012 (198)
    • ►  December (13)
    • ►  November (22)
    • ►  October (18)
    • ►  September (14)
    • ►  August (22)
    • ►  July (57)
    • ▼  June (17)
      • Win Tips1:Thunderbird profile backup ?
      • Ubuntu Tips
      • Boot Ubuntu Linux into Rescue mode to fix system
      • Linux Real Time Issue4
      • Filezilla Errors
      • SmartSVN Installation Steps Error's
      • Linux Real Time Issues-3
      • Linux Real Time Issues-2
      • Linux Real Time Issues-1
      • How do I fix “Ubuntu is running in low-graphics mode?
      • Top Ten Tomcat Configuration Tips
      • 6 Good security practices every Linux admin must...
      • Linux: 25 PHP Security Best Practices For Sys Admins
      • MRTG Installation and Configuration.
      • JDK RPM Installation for Linux (32-bit) and Requir...
      • How to Transfer Thunderbird Settings and Email on ...
      • Adding Fonts to Fontconfig and Geany editor in centos
    • ►  May (20)
    • ►  April (3)
    • ►  January (12)
  • ►  2011 (28)
    • ►  December (11)
    • ►  November (17)

Total Pageviews

Subscribe To

Posts
Atom
Posts
All Comments
Atom
All Comments
Travel theme. Theme images by mammamaart. Powered by Blogger.