<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-4866942919376580688</id><updated>2012-01-01T19:22:31.055+05:30</updated><title type='text'>Fedora --&gt; Debian Sid --&gt; Gentoo</title><subtitle type='html'>A die hard fedora fan from 7--&amp;gt;11. Moves to debian sid to get the most up to date system. Here finds out the good old wine can play most of the Windows games he likes. Now hunt for a OS begins with latest wine. Arch ---&amp;gt; No (latest) wine for amd64. And it ends at Gentoo. Now journey of learning a completely source based OS starts from here. :)</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://mann-linuxproject.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4866942919376580688/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://mann-linuxproject.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Mann</name><uri>http://www.blogger.com/profile/02912625514121067807</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>7</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4866942919376580688.post-3952473686584005247</id><published>2010-06-27T12:39:00.007+05:30</published><updated>2010-06-27T20:08:10.754+05:30</updated><title type='text'>Setting X3270 in Gentoo</title><content type='html'>&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;A common way to access Mainframe is using a 3270 terminal emulator running on a PC. There are a lot of 3270 terminal emulators available for both Windows and Linux. &lt;/span&gt;&lt;a href="http://x3270.bgp.nu/"&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;x3270&lt;/span&gt;&lt;/a&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt; is one such terminal emulator for Linux. The best thing is that it is open source and free as in "free beer". It is present in the official software repositories of major Linux distributions and can be easily installed.&lt;/span&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;To install it in Gentoo, emerge the package net-misc/suite3270.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#FF0000;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;emerge --verbose net-misc/suite3270&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;Unlike most other applications, it is a pure X application and therefore more work is needed to set it up correctly.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;The most common error you will encounter at first run will be(If you run from terminal):&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#FF0000;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;Warning: Cannot convert string "-*-helvetica-bold-r-normal--14-*-100-100-p-*-iso8859-1" to type FontStruct&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;And you will left with a very small application window. Please note that maximizing or resizing window will not work on x3270. If you try to increase the font size by going into Options --&gt; Font, you will be greeted with one more error message.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://2.bp.blogspot.com/_1re-4T5zH7k/TCciOSZTpOI/AAAAAAAAAPA/SQoKlRWCD7Y/s1600/snapshot58.jpeg"&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;&lt;img src="http://2.bp.blogspot.com/_1re-4T5zH7k/TCciOSZTpOI/AAAAAAAAAPA/SQoKlRWCD7Y/s400/snapshot58.jpeg" border="0" alt="" id="BLOGGER_PHOTO_ID_5487392299825734882" style="cursor: pointer; width: 309px; height: 400px; " /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;Now click on the keyboard icon in the application window and  you will land up with one more error message in the terminal.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#FF0000;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;Warning: Cannot convert string "-*-fixed-medium-r-semicondensed-*-12-*-*" to type FontStruct&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;As you can guess all the three error messages are related to Fonts. The first error message indicates that x3270 cannot find the helvetica 100 DPI font. &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;For Gentoo the above and other 100 DPI fonts can be installed by emerging the package media-fonts/font-adobe-100dpi&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#FF0000;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;emerge --verbose media-fonts/font-adobe-100dpi&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#FF0000;"&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;The second error Message indicates that the x3270 can't find the 3270 fonts that were installed with the package. A temporary and per session solution will be using xset to set the path correctly.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#FF0000;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;xset fp+ /usr/share/fonts/x3270/&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#FF0000;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;xset fp rehash&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;You can check the current font paths searched by X server using&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#FF0000;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;xset q&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;The output will be like:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#FF0000;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;Font Path:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#FF0000;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;  built-ins,/usr/share/fonts/x3270/&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#FF0000;"&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;Please note that font path shown above is for Gentoo and may differ per distribution. To permanently add x3270 fonts to X server font path, you will need to edit the xorg.conf file. The file will usually be present in /etc/X11/. Create the file if it doesn't exist already. For an existing file add the following line in the Files Section.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#FF0000;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;FontPath        "/usr/share/fonts/x3270"&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#FF0000;"&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;For a new file add the following section.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#FF0000;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;Section "Files"&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#FF0000;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;    FontPath        "/usr/share/fonts/x3270"&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#FF0000;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;EndSection&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;&lt;span class="Apple-style-span"  style="color:#FF0000;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;The third error message indicates that x3270 can't find the fixed-medium-r-semicondensed font of size * x 12.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;In Gentoo you can install the above and various misc X fonts by emerging package media-fonts/font-misc-misc.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#FF0000;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;emerge --verbose media-fonts/font-misc-misc&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#FF0000;"&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;After installing above fonts you have to restart your X server. This can be done by simply logging off and again logging on. Hopefully you will not find any other error messages related to fonts, if you do follow the same procedure as for x3270 fonts to add your installed fonts in X server font path.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;I am always very lazy to read the documentation and therefore it took me one day to figure out how to copy and paste in x3270. Normal Ctrl-V does not work if you are pasting in a x3270 dialog box. You have to use middle mouse button to paste. x3270 automatically copies a text once you select it.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"   style="font-family:arial, sans-serif;font-size:180%;"&gt;&lt;span class="Apple-style-span"  style="font-size:18px;"&gt;&lt;b&gt;&lt;span class="Apple-style-span"   style=" font-weight: normal;  font-family:Georgia, serif;font-size:16px;"&gt;&lt;a href="http://2.bp.blogspot.com/_1re-4T5zH7k/TCdhjX9fRQI/AAAAAAAAAPI/hhOB6JXU17U/s1600/screen1.png"&gt;&lt;img src="http://2.bp.blogspot.com/_1re-4T5zH7k/TCdhjX9fRQI/AAAAAAAAAPI/hhOB6JXU17U/s400/screen1.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5487461931329471746" style="cursor: pointer; width: 349px; height: 400px; " /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;Reference:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;&lt;a href="http://x3270.bgp.nu/documentation-faq.html"&gt;http://x3270.bgp.nu/documentation-faq.html&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://forum.sabayonlinux.org/viewtopic.php?f=57&amp;amp;t=15841&amp;amp;start=0"&gt;http://forum.sabayonlinux.org/viewtopic.php?f=57&amp;amp;t=15841&amp;amp;start=0&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;&lt;a href="http://www.mail-archive.com/linux-390@vm.marist.edu/msg29388.html"&gt;http://www.mail-archive.com/linux-390@vm.marist.edu/msg29388.html&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4866942919376580688-3952473686584005247?l=mann-linuxproject.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mann-linuxproject.blogspot.com/feeds/3952473686584005247/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4866942919376580688&amp;postID=3952473686584005247' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4866942919376580688/posts/default/3952473686584005247'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4866942919376580688/posts/default/3952473686584005247'/><link rel='alternate' type='text/html' href='http://mann-linuxproject.blogspot.com/2010/06/setting-x3270-in-gentoo.html' title='Setting X3270 in Gentoo'/><author><name>Mann</name><uri>http://www.blogger.com/profile/02912625514121067807</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_1re-4T5zH7k/TCciOSZTpOI/AAAAAAAAAPA/SQoKlRWCD7Y/s72-c/snapshot58.jpeg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4866942919376580688.post-1475420864949969628</id><published>2009-07-27T22:51:00.003+05:30</published><updated>2009-07-27T23:02:17.796+05:30</updated><title type='text'>TTY and PTS</title><content type='html'>tty is a Unix command that prints to standard output the name of the file connected to standard input. The name of the program comes from teletypewriter, abbreviated "TTY".&lt;br /&gt;&lt;br /&gt;pts stands for pseudo terminal slave. A terminal (or console) is a keyboard/screen combination you sit and type at. Old UNIX boxes would have dozens of them hanging off the back, all connected with miles of cable. A pseudo terminal provides just the same facility only without the hardware. In other words, it's an xterm window or a konsole window, or whatever utility you use. They pop into life as you ask for them and get given sequential numbers: pts/0, then pts/1 and so on.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4866942919376580688-1475420864949969628?l=mann-linuxproject.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mann-linuxproject.blogspot.com/feeds/1475420864949969628/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4866942919376580688&amp;postID=1475420864949969628' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4866942919376580688/posts/default/1475420864949969628'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4866942919376580688/posts/default/1475420864949969628'/><link rel='alternate' type='text/html' href='http://mann-linuxproject.blogspot.com/2009/07/tty-and-pts.html' title='TTY and PTS'/><author><name>Mann</name><uri>http://www.blogger.com/profile/02912625514121067807</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4866942919376580688.post-8298313918020600340</id><published>2007-10-20T11:22:00.000+05:30</published><updated>2008-12-10T12:43:16.531+05:30</updated><title type='text'>Running Servlets on Windows XP</title><content type='html'>&lt;div&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;20/10/2007&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;In my last blog, I wrote about how to run servlets in Fedora. As most of us use Windows not Fedora, so it forced me to write on running servlets in Windows XP. For my surprise it is more simple and easy than Fedora. So let's start.....&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;1. &lt;span style="color: rgb(0, 0, 153);"&gt;We need two things for running servlets in Windows XP: Sun Java SDK of course and tomcat. If you don't have Sun Java SDK, download the latest from &lt;/span&gt;&lt;a href="http://72.5.124.55/javase/downloads/index.jsp"&gt;http://72.5.124.55/javase/downloads/index.jsp&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;Download tomcat6 Windows Service Installer package from&lt;/span&gt; &lt;a href="http://tomcat.apache.org/download-60.cgi"&gt;http://tomcat.apache.org/download-60.cgi&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;2. &lt;span style="color: rgb(0, 0, 153);"&gt;Install Java SDK. Now we have to set the environment variables for Java else we have to type the whole path of java compiler and interpreter each time to compile and run any Java Program. For doing that&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;i. &lt;span style="color: rgb(0, 0, 153);"&gt;Go to &lt;span style="color: rgb(255, 0, 0);"&gt;Start -&gt; Control Panel&lt;/span&gt;. If its not in &lt;span style="color: rgb(255, 0, 0);"&gt;Classical view&lt;/span&gt; then choose '&lt;span style="color: rgb(255, 0, 0);"&gt;switch to Classical View&lt;/span&gt;'. Double click on &lt;span style="color: rgb(255, 0, 0);"&gt;System&lt;/span&gt; icon. Now you'll be seeing a &lt;span style="color: rgb(255, 0, 0);"&gt;System Properties&lt;/span&gt; dialog box similar to the following.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_1re-4T5zH7k/Rxm0FrPw94I/AAAAAAAAAHo/3ZBKWmFPexs/s1600-h/system1.PNG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5123324060711843714" style="" alt="" src="http://2.bp.blogspot.com/_1re-4T5zH7k/Rxm0FrPw94I/AAAAAAAAAHo/3ZBKWmFPexs/s400/system1.PNG" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;ii. &lt;span style="color: rgb(0, 0, 153);"&gt;Now click on &lt;span style="color: rgb(255, 0, 0);"&gt;Advanced&lt;/span&gt; tab, You will see a button named &lt;span style="color: rgb(255, 0, 0);"&gt;Environment Variables&lt;/span&gt; at the Bottom of it. Click on it and now you'll see a dialog box similar to the following.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_1re-4T5zH7k/Rxm0n7Pw95I/AAAAAAAAAHw/FSq9Lnq9x8s/s1600-h/system2.PNG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5123324649122363282" style="" alt="" src="http://3.bp.blogspot.com/_1re-4T5zH7k/Rxm0n7Pw95I/AAAAAAAAAHw/FSq9Lnq9x8s/s400/system2.PNG" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;iii. &lt;span style="color: rgb(0, 0, 153);"&gt;On &lt;span style="color: rgb(255, 0, 0);"&gt;User variables&lt;/span&gt;, click on &lt;span style="color: rgb(255, 0, 0);"&gt;New&lt;/span&gt;. Now for Variable name enter &lt;span style="color: rgb(255, 0, 0);"&gt;'path'&lt;/span&gt; and for Variable value enter the path of your JDK bin files directory. If you didn't change your default installation directory during installation it'll be something like &lt;span style="color: rgb(255, 0, 0);"&gt;'C:\Program Files\Java\jdk1.6.0_03\bin\'&lt;/span&gt; where jdk1.6.0_03 will be replaced by your version of Java SDK. Click OK.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_1re-4T5zH7k/Rxm1BrPw96I/AAAAAAAAAH4/JpQMvOqT1DQ/s1600-h/system3.PNG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5123325091503994786" style="" alt="" src="http://2.bp.blogspot.com/_1re-4T5zH7k/Rxm1BrPw96I/AAAAAAAAAH4/JpQMvOqT1DQ/s400/system3.PNG" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;iv. &lt;span style="color: rgb(0, 0, 153);"&gt;Check that you correctly set the environment variable. Start -&gt; Run. Type cmd. Now in Command Prompt type&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;java -version&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;It should give the output like this.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_1re-4T5zH7k/Rxm1g7Pw97I/AAAAAAAAAIA/BIlh4U0crko/s1600-h/system4.PNG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5123325628374906802" style="" alt="" src="http://3.bp.blogspot.com/_1re-4T5zH7k/Rxm1g7Pw97I/AAAAAAAAAIA/BIlh4U0crko/s400/system4.PNG" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;3. &lt;span style="color: rgb(0, 0, 153);"&gt;Install tomcat6. Start Tomcat by finding its start program in the Programs Menu (located in the Start menu). Look under Apache tomcat 6.0 and click Monitor Tomcat. In your notification area on taskbar Apache Tomcat icon will come. Double click on it and you'll see a dialog box. Start tomcat If it is not already started.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_1re-4T5zH7k/Rxm2KbPw98I/AAAAAAAAAII/EMulSBS1QkQ/s1600-h/system9.PNG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5123326341339477954" style="" alt="" src="http://1.bp.blogspot.com/_1re-4T5zH7k/Rxm2KbPw98I/AAAAAAAAAII/EMulSBS1QkQ/s400/system9.PNG" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;For more information on installation and setup tomcat visit the following links:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://tomcat.apache.org/tomcat-6.0-doc/index.html"&gt;http://tomcat.apache.org/tomcat-6.0-doc/index.html&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.yorku.ca/jhuang/examples/tomcat-install.html"&gt;http://www.yorku.ca/jhuang/examples/tomcat-install.html&lt;/a&gt; (A little outdated though)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;4. &lt;span style="color: rgb(0, 0, 153);"&gt;Check the tomcat installation by typing &lt;/span&gt;&lt;a href="http://localhost:8080/"&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;http://localhost:8080/&lt;/span&gt;&lt;/a&gt;&lt;span style="color: rgb(0, 0, 153);"&gt; in your browser. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_1re-4T5zH7k/Rxm2hbPw99I/AAAAAAAAAIQ/UvmqMKn9OEY/s1600-h/system5.PNG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5123326736476469202" style="" alt="" src="http://1.bp.blogspot.com/_1re-4T5zH7k/Rxm2hbPw99I/AAAAAAAAAIQ/UvmqMKn9OEY/s400/system5.PNG" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;5. &lt;span style="color: rgb(0, 0, 153);"&gt;Now for compiling java servlets program you have to set the &lt;span style="color: rgb(255, 0, 0);"&gt;CLASSPATH&lt;/span&gt; environment variable to include the servlet-api.jar package path which will be &lt;span style="color: rgb(255, 0, 0);"&gt;'C:\Program Files\Apache Software Foundation\Tomcat 6.0\lib\servlet-api.jar'&lt;/span&gt; for default installation directory. Change the path if you changed the installation directory. Now again set it using the same procedure for setting environment variables for Java. Remember to click on New button of User variables&lt;br /&gt;not System variables.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_1re-4T5zH7k/RxnLoLPw-AI/AAAAAAAAAIo/g74j5Imq8Vg/s1600-h/system7.PNG"&gt;&lt;img style="cursor: pointer;" src="http://4.bp.blogspot.com/_1re-4T5zH7k/RxnLoLPw-AI/AAAAAAAAAIo/g74j5Imq8Vg/s400/system7.PNG" alt="" id="BLOGGER_PHOTO_ID_5123349942184769538" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;6. &lt;span style="color: rgb(0, 0, 153);"&gt;Now we'll take a sample servlet program and will name it as &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;MyHelloWorld.java&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 0, 0);"&gt;import java.io.*;&lt;br /&gt;import java.text.*;&lt;br /&gt;import java.util.*;&lt;br /&gt;import javax.servlet.*;&lt;br /&gt;import javax.servlet.http.*;&lt;br /&gt;public class MyHelloWorld extends HttpServlet {&lt;br /&gt;public void doGet(HttpServletRequest request,&lt;br /&gt;HttpServletResponse response)&lt;br /&gt;throws IOException, ServletException&lt;br /&gt;{&lt;br /&gt;response.setContentType("text/html");&lt;br /&gt;PrintWriter out = response.getWriter();&lt;br /&gt;out.println("&amp;lt;html&amp;gt;");&lt;br /&gt;out.println("&amp;lt;body&amp;gt;");&lt;br /&gt;out.println("&amp;lt;head&amp;gt;");&lt;br /&gt;out.println("&amp;lt;title&amp;gt;Hello World!&amp;lt;/title&amp;gt;");&lt;br /&gt;out.println("&amp;lt;/head&amp;gt;");&lt;br /&gt;out.println("&amp;lt;body&amp;gt;");&lt;br /&gt;out.println("&amp;lt;h1&amp;gt;Hello World!&amp;lt;/h1&amp;gt;");&lt;br /&gt;out.println("&amp;lt;/body&amp;gt;");&lt;br /&gt;out.println("&amp;lt;/html&amp;gt;");&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;Save it using notepad as &lt;span style="color: rgb(255, 0, 0);"&gt;MyHelloWorld.java&lt;/span&gt;. Now compile it using javac command from the command prompt.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_1re-4T5zH7k/Rxm29bPw9-I/AAAAAAAAAIY/mS8joJU3u08/s1600-h/system8.PNG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5123327217512806370" style="" alt="" src="http://1.bp.blogspot.com/_1re-4T5zH7k/Rxm29bPw9-I/AAAAAAAAAIY/mS8joJU3u08/s400/system8.PNG" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;7. &lt;span style="color: rgb(0, 0, 153);"&gt;Now go to the tomcat installation directory. For default installation it would be &lt;span style="color: rgb(255, 0, 0);"&gt;C:\Program Files\Apache Software Foundation\Tomcat 6.0&lt;/span&gt; here You will find &lt;span style="color: rgb(255, 0, 0);"&gt;webapp&lt;/span&gt; directory. Inside &lt;span style="color: rgb(255, 0, 0);"&gt;webapp&lt;/span&gt; directory make a directory named &lt;span style="color: rgb(255, 0, 0);"&gt;test&lt;/span&gt;. In this directory we will keep our web applications. Inside &lt;span style="color: rgb(255, 0, 0);"&gt;test&lt;/span&gt;, create directory &lt;span style="color: rgb(255, 0, 0);"&gt;WEB-INF&lt;/span&gt;. Inside &lt;span style="color: rgb(255, 0, 0);"&gt;WEB-INF&lt;/span&gt; create directory &lt;span style="color: rgb(255, 0, 0);"&gt;classes&lt;/span&gt;. Now inside &lt;span style="color: rgb(255, 0, 0);"&gt;classes&lt;/span&gt; we'll keep both our source and class files.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;8. &lt;span style="color: rgb(0, 0, 153);"&gt;Copy the &lt;span style="color: rgb(255, 0, 0);"&gt;MyHelloWorld.java&lt;/span&gt; and &lt;span style="color: rgb(255, 0, 0);"&gt;MyHelloWorld.class&lt;/span&gt; files to the directory &lt;span style="color: rgb(255, 0, 0);"&gt;classes&lt;/span&gt;. Now to run our servlet we have to write our own &lt;span style="color: rgb(255, 0, 0);"&gt;web.xml&lt;/span&gt; file in the &lt;span style="color: rgb(255, 0, 0);"&gt;WEB-INF&lt;/span&gt; directory. Tomcat server reads the file &lt;span style="color: rgb(255, 0, 0);"&gt;web.xml&lt;/span&gt; to get information about the servlets. We'll open a file in notepad and copy and paste the following contents in the file. Save the file in the &lt;span style="color: rgb(255, 0, 0);"&gt;WEB-INF&lt;/span&gt; directory with the name &lt;span style="color: rgb(255, 0, 0);"&gt;web.xml&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;&amp;lt;web-app xmlns="http://java.sun.com/xml/ns/javaee"&lt;br /&gt;xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&lt;br /&gt;xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"&lt;br /&gt;version="2.5"&amp;gt;&lt;br /&gt;&amp;lt;servlet&amp;gt;&lt;br /&gt;&amp;lt;servlet-name&amp;gt;MyHelloWorld&amp;lt;/servlet-name&amp;gt;&lt;br /&gt;&amp;lt;servlet-class&amp;gt;MyHelloWorld&amp;lt;/servlet-class&amp;gt;&lt;br /&gt;&amp;lt;/servlet&amp;gt;&lt;br /&gt;&amp;lt;servlet-mapping&amp;gt;&lt;br /&gt;&amp;lt;servlet-name&amp;gt;MyHelloWorld&amp;lt;/servlet-name&amp;gt;&lt;br /&gt;&amp;lt;url-pattern&amp;gt;/servlet/MyHelloWorld&amp;lt;/url-pattern&amp;gt;&lt;br /&gt;&amp;lt;/servlet-mapping&amp;gt;&lt;br /&gt;&amp;lt;/web-app&amp;gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;In the file the tags &lt;span style="color: rgb(255, 0, 0);"&gt;&amp;lt;servlet-name&amp;gt;&lt;/span&gt; and &lt;span style="color: rgb(255, 0, 0);"&gt;&amp;lt;servlet-class&amp;gt;&lt;/span&gt; gives the information about &lt;span style="color: rgb(102, 0, 0);"&gt;servlet-name&lt;/span&gt; and &lt;span style="color: rgb(102, 0, 0);"&gt;servlet-class&lt;/span&gt; and the tag &lt;span style="color: rgb(255, 0, 0);"&gt;&amp;lt;url-pattern&amp;gt;&lt;/span&gt; tells about the URL pattern to run the servlet.&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;p&gt;9. &lt;span style="color: rgb(0, 0, 153);"&gt;Now stop and restart Tomcat from the icon in Taskbar. To run the sevlet type address&lt;/span&gt;&lt;br /&gt;&lt;a href="http://localhost:8080/test/servlet/MyHelloWorld"&gt;http://localhost:8080/test/servlet/MyHelloWorld&lt;/a&gt;&lt;/p&gt;&lt;div&gt;&lt;a href="http://4.bp.blogspot.com/_1re-4T5zH7k/Rxm3wLPw9_I/AAAAAAAAAIg/--v-Ik4hyOM/s1600-h/system10.PNG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5123328089391167474" style="" alt="" src="http://4.bp.blogspot.com/_1re-4T5zH7k/Rxm3wLPw9_I/AAAAAAAAAIg/--v-Ik4hyOM/s400/system10.PNG" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4866942919376580688-8298313918020600340?l=mann-linuxproject.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mann-linuxproject.blogspot.com/feeds/8298313918020600340/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4866942919376580688&amp;postID=8298313918020600340' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4866942919376580688/posts/default/8298313918020600340'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4866942919376580688/posts/default/8298313918020600340'/><link rel='alternate' type='text/html' href='http://mann-linuxproject.blogspot.com/2007/10/running-servlets-on-windows-xp.html' title='Running Servlets on Windows XP'/><author><name>Mann</name><uri>http://www.blogger.com/profile/02912625514121067807</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_1re-4T5zH7k/Rxm0FrPw94I/AAAAAAAAAHo/3ZBKWmFPexs/s72-c/system1.PNG' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4866942919376580688.post-3247386862054428189</id><published>2007-10-18T13:22:00.000+05:30</published><updated>2008-12-10T12:43:17.294+05:30</updated><title type='text'>Running Servlets on Fedora 7</title><content type='html'>&lt;span style="font-size:130%;"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;18/10/2007&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;&lt;br /&gt;I was wondering for last two days to compile and run my java servlet programs on Fedora. But I couldn't find any useful information on internet. After much research and trial and errors I finally got to run servlets on Fedora. And this is how I did this, I think this might be useful for another novice like me. I have used the backward approach for this tutorial. It means problems first and then the solutions. Of course I could have used the straight approach like do this this and this and you are done. But I think that wont be much useful as you wouldn't know what thing is needed for what.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;1. &lt;span style="color: rgb(0, 0, 153);"&gt;First thing first, before running servlets you need to compile them. And for that you need Sun Java SDK installed on your system. I'm assuming that you have it already on your system. If not you can go through this blog to find how to install it in Fedora.&lt;br /&gt;&lt;a href="http://mann-linuxproject.blogspot.com/2007/07/finally-jdk-is-installed.html"&gt;http://mann-linuxproject.blogspot.com/2007/07/finally-jdk-is-installed.html&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;2. &lt;span style="color: rgb(0, 0, 153);"&gt;For compiling and running you also need tomcat installed on your system. You can choose Tomcat alone or with Apache. I preferred the second one. Install Apache by the command&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;yum install httpd&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;and install Tomcat on Fedora by the command&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;yum install tomcat5 tomcat5-webapps tomcat5-admin-webapps&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;here tomcat5 is the latest version for fedora.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;3. &lt;span style="color: rgb(0, 0, 153);"&gt;Here is one sample program that I copied and pasted from a tutorial site. We'll use this sample program for our part of tutorial.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;import java.io.*;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;import java.text.*;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;import java.util.*;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;import javax.servlet.*;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;import javax.servlet.http.*;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;public class DemoServlet extends HttpServlet {&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;public void doGet(HttpServletRequest request, &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;HttpServletResponse response)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;throws IOException, ServletException&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;response.setContentType("text/html");&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;PrintWriter out = response.getWriter();&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;out.println("&amp;lt;html&amp;gt;");&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;out.println("&amp;lt;body&amp;gt;");&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;out.println("&amp;lt;head&amp;gt;");&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;out.println("&amp;lt;title&amp;gt;Hello World!&amp;lt;/title&amp;gt;");&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;out.println("&amp;lt;/head&amp;gt;");&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;out.println("&amp;lt;body&amp;gt;");&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;out.println("&amp;lt;h1&amp;gt;Hello World!&amp;lt;/h1&amp;gt;");&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;out.println("&amp;lt;/body&amp;gt;");&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;out.println("&amp;lt;/html&amp;gt;");&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;Type the program in a text editor and save the file as &lt;span style="color: rgb(255, 0, 0);"&gt;DemoServlet.java&lt;/span&gt;.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;So like every java program, we'll use &lt;span style="color: rgb(255, 0, 0);"&gt;javac&lt;/span&gt; to compile the program.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;javac DemoServlet.java&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;Even if you didn't did any typing mistakes, you are more likely to get the errors&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;DemoServlet.java:4: package javax.servlet does not exist&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;import javax.servlet.*;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;^&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;DemoServlet.java:5: package javax.servlet.http does not exist&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;import javax.servlet.http.*;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;^&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;If this is the case it means that our &lt;span style="color: rgb(255, 0, 0);"&gt;CLASSPATH&lt;/span&gt; environment is not set. Workaround for this problem is to &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;append the line&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;export CLASSPATH=/usr/share/java/servletapi5.jar&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;to your &lt;span style="color: rgb(255, 0, 0);"&gt;.bash_profile&lt;/span&gt; or &lt;span style="color: rgb(255, 0, 0);"&gt;.bashrc&lt;/span&gt; file. These files will be in your home directory and will be hidden. &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;Or one can alternatively type the above command each time he logins to compile servlet programs.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;After adding the line you have to do a logout and login to reset the environment variables. Now again compile the program. Now it should not give the above errors and if you have typed the program correctly it'll compile successfully. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;4. &lt;span style="color: rgb(0, 0, 153);"&gt;So we have compiled the program now how to run it. We can't just type &lt;span style="color: rgb(255, 0, 0);"&gt;java DemoSevlet&lt;/span&gt; to run the program here. Now we need Tomcat. login as root and make a directory in the tomcat web-application directory by the command&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;mkdir /var/lib/tomcat5/webapps/test&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;In this directory make another directory WEB-INF&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;mkdir /var/lib/tomcat5/webapps/test/WEB-INF&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;Inside this directory make directory classes&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;mkdir /var/lib/tomcat5/webapps/test/WEB-INF/classes&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;Inside classes directory we'll keep our servlet source and corresponding compiled class files. So copy the &lt;span style="color: rgb(255, 0, 0);"&gt;DemoServlet.java &lt;/span&gt;and &lt;span style="color: rgb(255, 0, 0);"&gt;DemoServlet.class&lt;/span&gt; files to this directory.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;cp /path/to/DemoServlet.java /var/lib/tomcat5/webapps/test/WEB-INF/classes/&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;cp /path/to/DemoServlet.class /var/lib/tomcat5/webapps/test/WEB-INF/classes/&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;Replace &lt;span style="color: rgb(255, 0, 0);"&gt;/path/to&lt;/span&gt; with your own paths to &lt;span style="color: rgb(255, 0, 0);"&gt;DemoServlet.java &lt;/span&gt;and &lt;span style="color: rgb(255, 0, 0);"&gt;DemoServlet.class&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;Now in WEB-INF directory we'll create &lt;span style="color: rgb(153, 0, 0);"&gt;web.xml&lt;/span&gt; file which will give information about our servlets to Tomcat server.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;While you are still logged as root go to the directory&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;cd /var/lib/tomcat5/webapps/test/WEB-INF/&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;Create the file web.xml using gedit&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;gedit web.xml&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;Now you should enter the following contents in the file and then save and quit. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;&amp;lt;?xml version="1.0" encoding="ISO-8859-1"?&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;&amp;lt;web-app xmlns="http://java.sun.com/xml/ns/j2ee"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;version="2.4"&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;&amp;lt;servlet&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;&amp;lt;servlet-name&amp;gt;DemoServlet&amp;lt;/servlet-name&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;&amp;lt;servlet-class&amp;gt;DemoServlet&amp;lt;/servlet-class&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;&amp;lt;/servlet&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;&amp;lt;servlet-mapping&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;&amp;lt;servlet-name&amp;gt;DemoServlet&amp;lt;/servlet-name&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;&amp;lt;url-pattern&amp;gt;/servlet/DemoServlet&amp;lt;/url-pattern&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;&amp;lt;/servlet-mapping&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;&amp;lt;/web-app&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;In the file the tags &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;&amp;lt;servlet-name&amp;gt; &lt;span style="color: rgb(0, 0, 153);"&gt;and&lt;/span&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;&amp;lt;servlet-class&amp;gt; &lt;span style="color: rgb(0, 0, 153);"&gt;gives the information about &lt;/span&gt;servlet-name &lt;span style="color: rgb(0, 0, 153);"&gt;and&lt;/span&gt; servlet-class &lt;span style="color: rgb(0, 0, 153);"&gt;and the tag&lt;/span&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;&amp;lt;url-pattern&amp;gt; &lt;span style="color: rgb(0, 0, 153);"&gt;tells about the URL pattern to run the servlet.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;5. &lt;/span&gt;Start the Apache server by command&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;service httpd start&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Now test Apache Server by typing address &lt;a href="http://localhost/"&gt;http://localhost/&lt;/a&gt; in your browser.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_1re-4T5zH7k/RxdIM7Pw91I/AAAAAAAAAHQ/fAfzy9KX1Ak/s1600-h/Screenshot-Test+Page+for+the+Apache+HTTP+Server+on+Fedora+-+Mozilla+Firefox.png"&gt;&lt;img id="BLOGGER_PHOTO_ID_5122642488056674130" style="cursor: pointer;" alt="" src="http://1.bp.blogspot.com/_1re-4T5zH7k/RxdIM7Pw91I/AAAAAAAAAHQ/fAfzy9KX1Ak/s400/Screenshot-Test+Page+for+the+Apache+HTTP+Server+on+Fedora+-+Mozilla+Firefox.png" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;Start the Tomcat server&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;service tomcat5 start&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;Test Tomcat server by typing address &lt;a href="http://localhost:8080/"&gt;http://localhost:8080/&lt;/a&gt; in your browser&lt;/span&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_1re-4T5zH7k/RxdIWLPw92I/AAAAAAAAAHY/S1TpZaJ4f80/s1600-h/Screenshot-Apache+Tomcat-5.5.23+-+Mozilla+Firefox.png"&gt;&lt;img id="BLOGGER_PHOTO_ID_5122642646970464098" style="cursor: pointer;" alt="" src="http://2.bp.blogspot.com/_1re-4T5zH7k/RxdIWLPw92I/AAAAAAAAAHY/S1TpZaJ4f80/s400/Screenshot-Apache+Tomcat-5.5.23+-+Mozilla+Firefox.png" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;Run your servlet by typing address &lt;a href="http://localhost:8080/test/servlet/DemoServlet"&gt;http://localhost:8080/test/servlet/DemoServlet&lt;/a&gt; in your browser.&lt;/span&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_1re-4T5zH7k/RxdIcLPw93I/AAAAAAAAAHg/M5b82eUkb44/s1600-h/Screenshot-Hello+World%21+-+Mozilla+Firefox.png"&gt;&lt;img id="BLOGGER_PHOTO_ID_5122642750049679218" style="cursor: pointer;" alt="" src="http://2.bp.blogspot.com/_1re-4T5zH7k/RxdIcLPw93I/AAAAAAAAAHg/M5b82eUkb44/s400/Screenshot-Hello+World%21+-+Mozilla+Firefox.png" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4866942919376580688-3247386862054428189?l=mann-linuxproject.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mann-linuxproject.blogspot.com/feeds/3247386862054428189/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4866942919376580688&amp;postID=3247386862054428189' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4866942919376580688/posts/default/3247386862054428189'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4866942919376580688/posts/default/3247386862054428189'/><link rel='alternate' type='text/html' href='http://mann-linuxproject.blogspot.com/2007/10/running-servlets-on-fedora-7.html' title='Running Servlets on Fedora 7'/><author><name>Mann</name><uri>http://www.blogger.com/profile/02912625514121067807</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_1re-4T5zH7k/RxdIM7Pw91I/AAAAAAAAAHQ/fAfzy9KX1Ak/s72-c/Screenshot-Test+Page+for+the+Apache+HTTP+Server+on+Fedora+-+Mozilla+Firefox.png' height='72' width='72'/><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4866942919376580688.post-7767105243920060211</id><published>2007-07-16T10:35:00.000+05:30</published><updated>2007-10-21T14:27:52.188+05:30</updated><title type='text'>Linux: Blocking a Website</title><content type='html'>&lt;span style="font-size:130%;"&gt;&lt;span style="COLOR: rgb(255,0,0)"&gt;16/07/07&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="COLOR: rgb(0,0,153)"&gt;I learned today how to block a website using &lt;span style="COLOR: rgb(255,0,0)"&gt;iptables&lt;/span&gt; command. You just have to type the following&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="COLOR: rgb(255,0,0)"&gt;iptables -I INPUT -s &lt;source&gt;-d 0/0 -j DROP&lt;/source&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="COLOR: rgb(0,0,153)"&gt;I blocked &lt;span style="COLOR: rgb(0,102,0)"&gt;orkut&lt;/span&gt; by using&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="COLOR: rgb(255,0,0)"&gt;iptables -I INPUT -s www.orkut.com -d 0/0 -j DROP&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,153)"&gt;It is recommended to use&lt;span style="COLOR: rgb(102,0,0)"&gt; IP addresses&lt;/span&gt; instead of &lt;span style="COLOR: rgb(102,0,0)"&gt;hostname&lt;/span&gt;. But I used&lt;span style="COLOR: rgb(102,0,0)"&gt; hostname&lt;/span&gt;, so that my roommates have no difficulty in deleting the rule.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="COLOR: rgb(0,0,153)"&gt;To know all the possible &lt;span style="COLOR: rgb(102,0,0)"&gt;IP addresses &lt;/span&gt;of a website, use&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="COLOR: rgb(255,0,0)"&gt;host &lt;hostname&gt;&lt;hostname&gt;&lt;/hostname&gt;&lt;/hostname&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="COLOR: rgb(0,0,153)"&gt;Most of the times it'll give more than one addresses, so you have to define a rule for every &lt;span style="COLOR: rgb(102,0,0)"&gt;IP address&lt;/span&gt; using the same syntax and it is highly recommended to use &lt;span style="COLOR: rgb(102,0,0)"&gt;IP addresses&lt;/span&gt; than the &lt;span style="COLOR: rgb(102,0,0)"&gt;hostname&lt;/span&gt;.&lt;/span&gt;&lt;br /&gt;&lt;span style="COLOR: rgb(0,0,153)"&gt;To delete the rule, the syntax is same. You have to only replace I with D&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="COLOR: rgb(255,0,0)"&gt;i&lt;/span&gt;&lt;span style="COLOR: rgb(255,0,0)"&gt;ptables -D INPUT -s &lt;source&gt;-d 0/0 -j DROP&lt;/source&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="COLOR: rgb(0,0,153)"&gt;In my case I used&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="COLOR: rgb(255,0,0)"&gt;iptables -D INPUT -s www.orkut.com -d 0/0 -j DROP&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,153)"&gt;I also edited my &lt;span style="COLOR: rgb(255,0,0)"&gt;/etc/rc.d/rc.local&lt;/span&gt; file so that this rule will automatically load during boot time. I also edited one entry there.&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,153)"&gt; I deleted the line&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="COLOR: rgb(0,102,0)"&gt;echo 1 &gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;&lt;br /&gt;&lt;span style="COLOR: rgb(0,0,153)"&gt;This line was for enabling my computer to forward the &lt;span style="COLOR: rgb(102,0,0)"&gt;ip packets&lt;/span&gt; from other computer to internet using my computer as gateway. So instead of setting the value of &lt;span style="COLOR: rgb(153,0,0)"&gt;ip_forward&lt;/span&gt; by &lt;span style="COLOR: rgb(255,0,0)"&gt;echo&lt;/span&gt; command,&lt;/span&gt; I &lt;/span&gt;&lt;span style="COLOR: rgb(0,0,153)"&gt;edited the Linux kernel config file:&lt;/span&gt; &lt;span style="COLOR: rgb(102,0,0)"&gt;/etc/sysctl.conf&lt;/span&gt;&lt;br /&gt;&lt;span style="COLOR: rgb(0,0,153)"&gt;and set the following value&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="COLOR: rgb(0,102,0)"&gt;net.ipv4.ip_forward = 1&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="COLOR: rgb(0,0,153)"&gt;I searched a lot for iptables. There were many useful sites. The one that helped me most is&lt;/span&gt;&lt;br /&gt;&lt;a href="http://www.yolinux.com/TUTORIALS/"&gt;http://www.yolinux.com/TUTORIALS/&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4866942919376580688-7767105243920060211?l=mann-linuxproject.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mann-linuxproject.blogspot.com/feeds/7767105243920060211/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4866942919376580688&amp;postID=7767105243920060211' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4866942919376580688/posts/default/7767105243920060211'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4866942919376580688/posts/default/7767105243920060211'/><link rel='alternate' type='text/html' href='http://mann-linuxproject.blogspot.com/2007/07/blocking-website.html' title='Linux: Blocking a Website'/><author><name>Mann</name><uri>http://www.blogger.com/profile/02912625514121067807</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4866942919376580688.post-6414286642915028233</id><published>2007-06-27T16:10:00.000+05:30</published><updated>2008-12-10T12:43:21.536+05:30</updated><title type='text'>Fedora: Frontech TV Tuner Card Installation</title><content type='html'>&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="COLOR: rgb(255,0,0)"&gt;13/06/07- I cannot install my TV tuner card in fedora (this problem is irrelevant to my project, but i want it to be solved)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_1re-4T5zH7k/RoQY9OLJWKI/AAAAAAAAABg/Okw7LgOnRjA/s1600-h/0606.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5081213719636695202" style="FLOAT: left; MARGIN: 0pt 10px 10px 0pt; CURSOR: pointer" alt="" src="http://4.bp.blogspot.com/_1re-4T5zH7k/RoQY9OLJWKI/AAAAAAAAABg/Okw7LgOnRjA/s320/0606.jpg" border="0" /&gt;&lt;/a&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="FONT-STYLE: italic"&gt;Symptoms:&lt;/span&gt;&lt;br /&gt;&lt;span style="COLOR: rgb(0,0,153)"&gt;I am unable to use my &lt;span style="COLOR: rgb(153,0,0)"&gt;frontech&lt;/span&gt; TV tuner card model number &lt;span style="COLOR: rgb(153,0,0)"&gt;jil-0606&lt;/span&gt;. Fedora cannot recognize this card.&lt;/span&gt;&lt;br /&gt;&lt;span style="FONT-STYLE: italic"&gt;Causes:&lt;/span&gt;&lt;br /&gt;&lt;span style="COLOR: rgb(0,0,153)"&gt;Its a cheap card and manufacture didn't provide the sufficient information on its &lt;span style="COLOR: rgb(153,0,0)"&gt;EEPROM&lt;/span&gt;. So fedora cannot recognize it automatically and hence driver is not loaded.&lt;/span&gt;&lt;br /&gt;&lt;span style="FONT-STYLE: italic"&gt;&lt;br /&gt;&lt;br /&gt;Solutions tried:&lt;/span&gt;&lt;br /&gt;&lt;span style="COLOR: rgb(0,0,153)"&gt;&lt;span style="COLOR: rgb(0,0,0)"&gt;1.&lt;/span&gt; From internet and using the commands &lt;span style="COLOR: rgb(255,0,0)"&gt;dmesg &lt;/span&gt;and &lt;span style="COLOR: rgb(255,0,0)"&gt;Lspci -v&lt;/span&gt;, i was able to figure out that it is &lt;span style="COLOR: rgb(153,0,0)"&gt;saa7130&lt;/span&gt; chip based card. The thing to do here is to figure out the card type and tuner number by yourself and load the modules .&lt;/span&gt;&lt;br /&gt;&lt;span style="COLOR: rgb(0,0,153)"&gt;&lt;span style="COLOR: rgb(0,0,0)"&gt;2.&lt;/span&gt; But in fedora there are 108 cards with different tuner number number. The last tuner number I tried was 71 and the list was more than 71 I think. So I sticked to card number 3 and tried different variations of tuner number from 1 to 71. I used &lt;span style="COLOR: rgb(255,0,0)"&gt;modprobe saa7134 card=3 tuner=x&lt;/span&gt; command where &lt;span style="COLOR: rgb(153,0,0)"&gt;x&lt;/span&gt; is the tuner number.&lt;/span&gt;&lt;br /&gt;&lt;span style="COLOR: rgb(0,0,153)"&gt;I used &lt;span style="COLOR: rgb(255,0,0)"&gt;dmesg&lt;/span&gt; after each &lt;span style="COLOR: rgb(255,0,0)"&gt;modprobe&lt;/span&gt; to see what system the tuner belongs. I used &lt;span style="COLOR: rgb(255,0,0)"&gt;TvTime&lt;/span&gt; to check whether these settings are working. After checking each module, i had to unload them by &lt;span style="COLOR: rgb(255,0,0)"&gt;rmmod saa7134&lt;/span&gt; command, so that the next module can be loaded.&lt;/span&gt;&lt;br /&gt;&lt;span style="COLOR: rgb(0,0,153)"&gt;&lt;span style="COLOR: rgb(0,0,0)"&gt;3.&lt;/span&gt; I got the TV signals on tuner number 6,22,24,35,42,49 and 60. When i reached 71 it hanged.&lt;/span&gt;&lt;br /&gt;&lt;span style="COLOR: rgb(0,0,153)"&gt;&lt;span style="COLOR: rgb(0,0,0)"&gt;4.&lt;/span&gt; The TV broadcasting system in India uses &lt;span style="COLOR: rgb(153,0,0)"&gt;PAL B&lt;/span&gt; standard. But unfortunately there was not any standard in the tuner like that it was &lt;span style="COLOR: rgb(153,0,0)"&gt;PAL&lt;/span&gt; or &lt;span style="COLOR: rgb(153,0,0)"&gt;PAL_BG&lt;/span&gt;. Unfortunately the tuners on which I got the TV signal was of varying standards. They were:&lt;/span&gt;&lt;br /&gt;&lt;span style="COLOR: rgb(255,0,0)"&gt;6 - Temic NTSC&lt;/span&gt;&lt;br /&gt;&lt;span style="COLOR: rgb(255,0,0)"&gt;22 - Temic PAL/SECAM multi&lt;/span&gt;&lt;br /&gt;&lt;span style="COLOR: rgb(255,0,0)"&gt;24 - Philips PAL/SECAM multi&lt;/span&gt;&lt;br /&gt;&lt;span style="COLOR: rgb(255,0,0)"&gt;35 - Temic PAL_DK/SECAM_2&lt;/span&gt;&lt;br /&gt;&lt;span style="COLOR: rgb(255,0,0)"&gt;42 - Philips 1236D ATSC/NTSC Dual&lt;/span&gt;&lt;br /&gt;&lt;span style="COLOR: rgb(255,0,0)"&gt;49 - Microtune 4042 FI5 ATSC/NTSC Dual in&lt;/span&gt;&lt;br /&gt;&lt;span style="COLOR: rgb(255,0,0)"&gt;60 - Thomson DTT 761X(ATSC/NTSC)&lt;/span&gt;&lt;br /&gt;&lt;span style="COLOR: rgb(0,0,153)"&gt;One thing to note here is &lt;span style="COLOR: rgb(153,0,0)"&gt;PAL_DK&lt;/span&gt; is as much as different to &lt;span style="COLOR: rgb(153,0,0)"&gt;PAL&lt;/span&gt; as &lt;span style="COLOR: rgb(102,0,0)"&gt;PAL&lt;/span&gt; to &lt;span style="COLOR: rgb(153,0,0)"&gt;NTSC&lt;/span&gt;. In all the cases i was able to get only picture but no sound from my card. Also I was not able to scan the channels because there was a message 'No Frequency' in &lt;span style="COLOR: rgb(255,0,0)"&gt;TvTime&lt;/span&gt;. So i guess the card number is not correct as well as the tuner number.&lt;/span&gt;&lt;br /&gt;&lt;span style="COLOR: rgb(0,0,153)"&gt;So in last 'm again where i started from. The main problem is the card itself. It doesn't specify sufficient about it in its &lt;span style="COLOR: rgb(153,0,0)"&gt;EEPROM&lt;/span&gt;.&lt;br /&gt;&lt;span style="COLOR: rgb(0,0,0); FONT-STYLE: italic"&gt;Solution:&lt;/span&gt;&lt;br /&gt;Problem solved on &lt;span style="COLOR: rgb(255,0,0)"&gt;27/06/07&lt;/span&gt;&lt;br /&gt;Actually the problem was &lt;span style="COLOR: rgb(102,0,0)"&gt;tvtime&lt;/span&gt; software, which just couldn't recognize my card for my thousands of attempts. It's really thousand attempts, I wasted too much time for trying different cards and tuners. I installed &lt;span style="COLOR: rgb(153,0,0)"&gt;kdetv&lt;/span&gt; that comes with fedora 7. First i tried different cards from my chosen 37 cards ( I identified the cards that have the same input as my&lt;span style="COLOR: rgb(102,0,0)"&gt; Frontech&lt;/span&gt; card ) and &lt;span style="COLOR: rgb(255,0,0)"&gt;tuner number 5&lt;/span&gt;. In first attempt I got only one channel that can be barely seen. Then i tried the &lt;span style="COLOR: rgb(255,0,0)"&gt;card=17 tuner=37&lt;/span&gt; and I got four channels with good picture. Then from channel configuration of &lt;span style="COLOR: rgb(102,0,0)"&gt;kdetv&lt;/span&gt; I chose manual channel selection, didn't touch the maximum and minimum frequency and set the interval for searching 1MHz and I got all the channels.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_1re-4T5zH7k/RofzreLJWPI/AAAAAAAAACI/4PUQ3B8GDZ0/s1600-h/Screenshot-Channel+Wizard-1.png"&gt;&lt;img id="BLOGGER_PHOTO_ID_5082298632670632178" style="FLOAT: left; MARGIN: 0pt 10px 10px 0pt; CURSOR: pointer" alt="" src="http://4.bp.blogspot.com/_1re-4T5zH7k/RofzreLJWPI/AAAAAAAAACI/4PUQ3B8GDZ0/s400/Screenshot-Channel+Wizard-1.png" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="COLOR: rgb(0,0,153)"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_1re-4T5zH7k/Rofz0OLJWQI/AAAAAAAAACQ/l-zMK3Uf6Zs/s1600-h/Screenshot-Channel+Wizard.png"&gt;&lt;img id="BLOGGER_PHOTO_ID_5082298782994487554" style="FLOAT: left; MARGIN: 0pt 10px 10px 0pt; CURSOR: pointer" alt="" src="http://3.bp.blogspot.com/_1re-4T5zH7k/Rofz0OLJWQI/AAAAAAAAACQ/l-zMK3Uf6Zs/s400/Screenshot-Channel+Wizard.png" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="COLOR: rgb(0,0,153)"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_1re-4T5zH7k/Rofz7eLJWRI/AAAAAAAAACY/ADgVkhEkyRs/s1600-h/Screenshot-Finetuning.png"&gt;&lt;img id="BLOGGER_PHOTO_ID_5082298907548539154" style="FLOAT: left; MARGIN: 0pt 10px 10px 0pt; CURSOR: pointer" alt="" src="http://4.bp.blogspot.com/_1re-4T5zH7k/Rofz7eLJWRI/AAAAAAAAACY/ADgVkhEkyRs/s400/Screenshot-Finetuning.png" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="TEXT-ALIGN: left"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="COLOR: rgb(0,0,153)"&gt;&lt;br /&gt;But now I was not getting any sound. I again searched the internet and found the answer. I changed the &lt;span style="COLOR: rgb(255,0,0)"&gt;card&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="COLOR: rgb(0,0,153)"&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;number to 3&lt;/span&gt; and everything get solved. I added the line &lt;span style="COLOR: rgb(255,0,0)"&gt;options saa7134 card=3 tuner=37&lt;/span&gt; in &lt;span style="COLOR: rgb(255,0,0)"&gt;/etc/modprobe.conf&lt;/span&gt; so that the module will be automatically loaded at the boot time.&lt;/span&gt;&lt;/span&gt; &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4866942919376580688-6414286642915028233?l=mann-linuxproject.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mann-linuxproject.blogspot.com/feeds/6414286642915028233/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4866942919376580688&amp;postID=6414286642915028233' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4866942919376580688/posts/default/6414286642915028233'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4866942919376580688/posts/default/6414286642915028233'/><link rel='alternate' type='text/html' href='http://mann-linuxproject.blogspot.com/2007/06/problem3.html' title='Fedora: Frontech TV Tuner Card Installation'/><author><name>Mann</name><uri>http://www.blogger.com/profile/02912625514121067807</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_1re-4T5zH7k/RoQY9OLJWKI/AAAAAAAAABg/Okw7LgOnRjA/s72-c/0606.jpg' height='72' width='72'/><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4866942919376580688.post-4307111552991883401</id><published>2007-06-27T16:09:00.001+05:30</published><updated>2007-10-21T14:22:24.094+05:30</updated><title type='text'>Linux: Internet Sharing</title><content type='html'>&lt;span style="font-size:100%;"&gt;&lt;span style="COLOR: rgb(255,0,0);font-size:130%;" &gt;12/06/07- Unable to share the internet connection between fedora and Windows xp systems&lt;/span&gt;&lt;br /&gt;&lt;span style="FONT-STYLE: italic"&gt;Symptoms:&lt;/span&gt;&lt;br /&gt;&lt;span style="COLOR: rgb(0,0,153)"&gt;&lt;span style="COLOR: rgb(0,0,0)"&gt;1.&lt;/span&gt; Unable to connect from windows xp laptop to internet through fedora desktop system. The gateway for windows xp was set rightly it was 192.168.0.1. That is the ip address of fedora system.&lt;/span&gt;&lt;br /&gt;&lt;span style="FONT-STYLE: italic"&gt;Solution:&lt;/span&gt;&lt;br /&gt;&lt;span style="COLOR: rgb(0,0,153)"&gt;problem solved on&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;12/06/07&lt;/span&gt;&lt;br /&gt;1. &lt;span style="COLOR: rgb(0,0,153)"&gt;I did the following changes:&lt;/span&gt;&lt;br /&gt;&lt;span style="COLOR: rgb(0,0,153)"&gt;i went to &lt;span style="COLOR: rgb(255,0,0)"&gt;/etc/sysconfig/network-scripts/ifcfg-eth0&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="COLOR: rgb(0,0,153)"&gt;it was something like:&lt;/span&gt;&lt;br /&gt;&lt;span style="COLOR: rgb(255,0,0)"&gt;# Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+&lt;/span&gt;&lt;br /&gt;&lt;span style="COLOR: rgb(255,0,0)"&gt;DEVICE=eth0&lt;/span&gt;&lt;br /&gt;&lt;span style="COLOR: rgb(255,0,0)"&gt;BOOTPROTO=none&lt;/span&gt;&lt;br /&gt;&lt;span style="COLOR: rgb(255,0,0)"&gt;HWADDR=00:16:76:87:37:37&lt;/span&gt;&lt;br /&gt;&lt;span style="COLOR: rgb(255,0,0)"&gt;ONBOOT=yes&lt;/span&gt;&lt;br /&gt;&lt;span style="COLOR: rgb(255,0,0)"&gt;TYPE=Ethernet&lt;/span&gt;&lt;br /&gt;&lt;span style="COLOR: rgb(255,0,0)"&gt;USERCTL=no&lt;/span&gt;&lt;br /&gt;&lt;span style="COLOR: rgb(255,0,0)"&gt;IPV6INIT=no&lt;/span&gt;&lt;br /&gt;&lt;span style="COLOR: rgb(255,0,0)"&gt;PEERDNS=yes&lt;/span&gt;&lt;br /&gt;&lt;span style="COLOR: rgb(255,0,0)"&gt;NETMASK=255.255.255.0&lt;/span&gt;&lt;br /&gt;&lt;span style="COLOR: rgb(255,0,0)"&gt;IPADDR=192.168.0.1&lt;/span&gt;&lt;br /&gt;&lt;span style="COLOR: rgb(0,0,153)"&gt;I added one line there to form a LAN&lt;/span&gt;&lt;br /&gt;&lt;span style="COLOR: rgb(255,0,0)"&gt;BROADCAST=192.168.0.255&lt;/span&gt;&lt;br /&gt;&lt;span style="COLOR: rgb(0,0,153)"&gt;It enabled fedora system to listen to all the systems in LAN.&lt;/span&gt;&lt;br /&gt;&lt;span style="COLOR: rgb(0,0,153)"&gt;&lt;span style="COLOR: rgb(0,0,0)"&gt;2. &lt;/span&gt;I went to &lt;span style="COLOR: rgb(255,0,0)"&gt;/etc/rc.d/rc.local&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="COLOR: rgb(0,0,153)"&gt;and added the following lines in the file&lt;/span&gt;&lt;br /&gt;&lt;span style="COLOR: rgb(255,0,0)"&gt;/sbin/iptables --flush&lt;/span&gt;&lt;br /&gt;&lt;span style="COLOR: rgb(255,0,0)"&gt;/sbin/iptables --table nat --flush&lt;/span&gt;&lt;br /&gt;&lt;span style="COLOR: rgb(255,0,0)"&gt;/sbin/iptables --delete-chain&lt;/span&gt;&lt;br /&gt;&lt;span style="COLOR: rgb(255,0,0)"&gt;/sbin/iptables --table nat --delete-chain&lt;/span&gt;&lt;br /&gt;&lt;span style="COLOR: rgb(255,0,0)"&gt;/sbin/iptables --table nat --append POSTROUTING --out-interface ppp0 -j MASQUERADE&lt;/span&gt;&lt;br /&gt;&lt;span style="COLOR: rgb(255,0,0)"&gt;/sbin/iptables --append FORWARD --in-interface eth0 -j ACCEPT&lt;/span&gt;&lt;br /&gt;&lt;span style="COLOR: rgb(255,0,0)"&gt;echo 1 &gt; /proc/sys/net/ipv4/ip_forward&lt;/span&gt;&lt;br /&gt;&lt;span style="COLOR: rgb(0,0,153)"&gt;&lt;span style="COLOR: rgb(0,0,0)"&gt;3.&lt;/span&gt; I opened windows system and changes the DNS Server address to those of my ISP TATA VSNL. Of course i didnt change the gateway address.&lt;/span&gt;&lt;br /&gt;&lt;span style="COLOR: rgb(0,0,153)"&gt;and its done my dear friend.&lt;/span&gt;&lt;br /&gt;&lt;span style="COLOR: rgb(0,0,153)"&gt;I'm very happy to solve this problem because the way i used to form a LAN i didnt found that help on net. there was a command &lt;span style="COLOR: rgb(255,0,0)"&gt;/sbin/ifconfig eth0 192.168.0.1 netmask 255.255.255.0 broadcast 192.168.0.255&lt;/span&gt; but you have to run it every time you boot or add it in &lt;span style="COLOR: rgb(255,0,0)"&gt;/etc/rc.d/rc.local&lt;/span&gt; file. But i chose my own alternate option.&lt;/span&gt;&lt;br /&gt;&lt;span style="COLOR: rgb(0,0,153)"&gt;Second thing was we have to run the &lt;span style="COLOR: rgb(255,0,0)"&gt;iptables&lt;/span&gt; command manually every time system boots. so i added them in &lt;span style="COLOR: rgb(255,0,0)"&gt;/etc/rc.d/rc.local&lt;/span&gt; file. And it was also not easy u have to find the absolute path for the &lt;span style="COLOR: rgb(255,0,0)"&gt;iptables&lt;/span&gt; command. Luckily fedora has all its commands in &lt;span style="COLOR: rgb(255,0,0)"&gt;/sbin&lt;/span&gt; directory. So I finally set it up. And god I spent my six hours on it. Trying and failing trying and failing. But in last I succeeded.&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4866942919376580688-4307111552991883401?l=mann-linuxproject.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mann-linuxproject.blogspot.com/feeds/4307111552991883401/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4866942919376580688&amp;postID=4307111552991883401' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4866942919376580688/posts/default/4307111552991883401'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4866942919376580688/posts/default/4307111552991883401'/><link rel='alternate' type='text/html' href='http://mann-linuxproject.blogspot.com/2007/06/problem2.html' title='Linux: Internet Sharing'/><author><name>Mann</name><uri>http://www.blogger.com/profile/02912625514121067807</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
