tomcat installaiton final document

19
Web Application (Webapp) A web application (or webapp), unlike standalone application, runs over the Intern Examples of webapps are google, amazon, eba, facebook and twitter. A webapp is tpicall a 3-tier (or multi-tier ) client-server database application run over the Internet as illustrated in the diagram below. It comprises !ve components" #. $%%& 'erver" E.g., Apache $%%& 'erver, Apache %omcat 'erver, icrosoft Internet Information 'erver (II'), nginx, oogle *eb 'erver ( *'), and others. +. $%%& lient (or *eb -rowser)" E.g., Internet Explorer ( 'IE), ire ox, hrome, 'a others. /. 0atabase" E.g., 1pen2source '34, Apache 0erb, m'34, '34ite, &ostgre'34, 1pen15ce6s -ase7 ommercial 1racle, I- 0-+, 'A& '-ase, ' '34 'erver, ' Access7 and others. 8. lient2'ide &rograms" could be written in $% 4 orm, 9ava'cript, :-'cript, lash, others. ;. 'erver2'ide &rograms" could be written in 9ava 'ervlet<9'&, A'&, &$&, &erl, &thon others. %he tpical use2case is" #. A user, via a web browser ($%%& client), issues a =>4 re?uest to an $%%& server to webapp.

Upload: manoj-kavedia

Post on 08-Oct-2015

29 views

Category:

Documents


0 download

DESCRIPTION

tomcat

TRANSCRIPT

Web Application (Webapp)A web application (or webapp), unlike standalone application, runs over the Internet. Examples of webapps are google, amazon, ebay, facebook and twitter.A webapp is typically a 3-tier (or multi-tier) client-server database application run over the Internet as illustrated in the diagram below. It comprises five components:1. HTTP Server: E.g., Apache HTTP Server, Apache Tomcat Server, Microsoft Internet Information Server (IIS), nginx, Google Web Server (GWS), and others.2. HTTP Client (or Web Browser): E.g., Internet Explorer (MSIE), FireFox, Chrome, Safari, and others.3. Database: E.g., Open-source MySQL, Apache Derby, mSQL, SQLite, PostgreSQL, OpenOffice's Base; Commercial Oracle, IBM DB2, SAP SyBase, MS SQL Server, MS Access; and others.4. Client-Side Programs: could be written in HTML Form, JavaScript, VBScript, Flash, and others.5. Server-Side Programs: could be written in Java Servlet/JSP, ASP, PHP, Perl, Python, CGI, and others.

The typical use-case is:1. A user, via a web browser (HTTP client), issues a URL request to an HTTP server to start a webapp.2. A client-side program (such as an HTML form) is loaded into client's browser.3. The user fills up the query criteria in the form.4. The client-side program sends the query parameters to a server-side program.5. The server-side program receives the query parameters, queries the database and returns the query result to the client.6. The client-side program displays the query result on the browser.7. The process repeats.1.2Hypertext Transfer Protocol (HTTP) HTTP is an application layer protocol runs over TCP/IP. The IP provides support for routing and addressing (via an unique IP address for machines on the Internet); while TCP supports multiplexing via 64K ports from port number 0 to 65535. The default port number assigned to HTTP is TCP port 80. HTTP is an asynchronous request-response application-layer protocol. A client sends a request message to the server. The server then returns a response message to the client. HTTP is a pull protocol, a client pulls a page from the server (instead of server pushes pages to the clients). The syntax of the message is defined in the HTTP specification.

1.3Apache Tomcat HTTP ServerApache Tomcat is a Java-capable HTTP server, which could execute special Java programs known as Java Servlet and Java Server Pages (JSP). It is the official Reference Implementation (RI) for Java Servlets and JavaServer Pages (JSP) technologies. Tomcat is an open-source project, under the "Apache Software Foundation" (which also provides the most use, open-source, industrial-strength Apache HTTP Server). The mother site for Tomcat is http://tomcat.apache.org. Alternatively, you can find tomcat via the Apache mother site @ http://www.apache.org.Tomcat was originally written by James Duncan Davison (then working in Sun), in 1998, based on an earlier Sun's server called Java Web Server (JWS). It began at version 3.0 after JSWDK 2.1 it replaced. Sun subsequently made Tomcat open-source and gave it to Apache.The various Tomcat releases are:1. Tomcat 3.x (1999): RI for Servlet 2.2 and JSP 1.1.2. Tomcat 4.x (2001): RI for Servlet 2.3 and JSP 1.2.3. Tomcat 5.x (2002): RI for Servlet 2.4 and JSP 2.0.4. Tomcat 6.x (2006): RI for Servlet 2.5 and JSP 2.1.5. Tomcat 7.x (2010): RI for Servlet 3.0, JSP 2.2 and EL 2.2.6. Tomcat 8.x (2013): RI for Servlet 3.1, JSP 2.3, EL 3.0 and Java WebSocket 1.0.Tomcat is an HTTP application runs over TCP/IP. In other words, the Tomcat server runs on a specific TCP port in a specific IP address. The default TCP port number for HTTP protocol is 80, which is used for the production HTTP server. For test HTTP server, you can choose any unused port number between 1024 and 65535.PreRequirement Apt-getTheAdvanced Package Tool, orAPT, is afree softwareuser interfacethat works withcore librariesto handle the installation and removal of software on theDebianGNU/Linux distributionand its variants.APT simplifies the process of managing software onUnix-likecomputer systems by automating the retrieval, configuration and installation ofsoftware packages, either from precompiled files or bycompilingsource code.APT was originally designed as a front-end fordpkgto work with Debian's.debpackages, but it has since been modified to also work with theRPM Package Managersystem viaAPT-RPM.TheFinkproject has ported APT toMac OS Xfor some of its own package management tasks,and APT is also available inOpenSolaris.Theapt-getutility is a powerful and free package management command line program, that is used to work withUbuntus APT(Advanced Packaging Tool) library to perform installation of new software packages, removing existing software packages, upgrading of existing software packages and even used to upgrading the entire operating system.Nameapt-get - APT package handling utility - command-line interfaceSynopsisapt-get [options] [-o config=string] [-c=cfgfile] command [pkg]Descriptionapt-getis the command-line tool for handling packages, and may be considered the user's "back-end" to other tools using the APT library. Several "front-end" interfaces exist, such as synaptic and aptitude.CommandsUnless the-h, or--helpoption is given, one of the commands below must be present.

What is apt-cache?Theapt-cachecommand line tool is used for searching apt software package cache. In simple words, this tool is used to search software packages, collects information of packages and also used to search for what available packages are ready for installation onDebianorUbuntubased systems.

25 Useful Basic Commands of APT-GET and APT-CACHE for Package ManagementThis article explains how quickly you can learn toinstall,remove,updateandsearchsoftware packages usingapt-getandapt-cachecommands from the command line. This article provides some useful commands that will help you to handle package management inDebian/Ubuntubased systems.

APT-GET and APT-CACHE CommandsAPT-CACHE 5 Useful Basic Commands1. How Do I List All Available Packages?To list all the available packages, type the following command.$ apt-cachepkgnamesesseract-ocr-epopipenightdreamsmumudvbtbb-exampleslibsvm-javalibmrpt-hmtslam0.9libboost-timer1.50-devkcm-touchpadg++-4.5-multilib...2. How Do I Find Out Package Name and Description of Software?To find out the package name and with it description before installing, use the search flag. Using search withapt-cachewill display a list of matched packages with short description. Lets say you would like to find out description of package vsftpd, then command would be.$ apt-cache search vsftpdvsftpd - lightweight, efficient FTP server written for securityccze - A robust, modular log coloriserftpd - File Transfer Protocol (FTP) serveryasat - simple stupid audit toolTo find and list down all the packages starting with vsftpd, you could use the following command.$ apt-cachepkgnamesvsftpdvsttpd3. How Do I Check Package Information?For example, if you would like to check information of package along with it short description say (version number, check sums, size, installed size, category etc). Use show sub command as shown below.$ apt-cache show netcatPackage: netcatPriority: optionalSection: universe/netInstalled-Size: 30Maintainer: Ubuntu Developers Original-Maintainer: Ruben Molina Architecture: allVersion: 1.10-40Depends: netcat-traditional (>= 1.10-39)Filename: pool/universe/n/netcat/netcat_1.10-40_all.debSize: 3340MD5sum: 37c303f02b260481fa4fc9fb8b2c1004SHA1: 0371a3950d6967480985aa014fbb6fb898bcea3aSHA256: eeecb4c93f03f455d2c3f57b0a1e83b54dbeced0918ae563784e86a37bcc16c9Description-en: TCP/IP swiss army knife -- transitional package This is a "dummy" package that depends on lenny's default version ofnetcat, to ease upgrades. It may be safely removed.Description-md5: 1353f8c1d079348417c2180319bdde09Bugs: https://bugs.launchpad.net/ubuntu/+filebugOrigin: Ubuntu4. How Do I Check Dependencies for Specific Packages?Use the showpkg sub command to check the dependencies for particular software packages. whether those dependencies packages are installed or not. For example, use the showpkg command along with package-name.$ apt-cacheshowpkgvsftpdPackage: vsftpdVersions: 2.3.5-3ubuntu1 (/var/lib/apt/lists/in.archive.ubuntu.com_ubuntu_dists_quantal_main_binary-i386_Packages) Description Language: File: /var/lib/apt/lists/in.archive.ubuntu.com_ubuntu_dists_quantal_main_binary-i386_Packages MD5: 81386f72ac91a5ea48f8db0b023f3f9b Description Language: en File: /var/lib/apt/lists/in.archive.ubuntu.com_ubuntu_dists_quantal_main_i18n_Translation-en MD5: 81386f72ac91a5ea48f8db0b023f3f9b

Reverse Depends: ubumirror,vsftpdharden-servers,vsftpdDependencies: 2.3.5-3ubuntu1 - debconf (18 0.5) debconf-2.0 (0 (null)) upstart-job (0 (null)) libc6 (2 2.15) libcap2 (2 2.10) libpam0g (2 0.99.7.1) libssl1.0.0 (2 1.0.0) libwrap0 (2 7.6-4~) adduser (0 (null)) libpam-modules (0 (null)) netbase (0 (null)) logrotate (0 (null)) ftp-server (0 (null)) ftp-server (0 (null)) Provides: 2.3.5-3ubuntu1 - ftp-server Reverse Provides:5. How Do I Check statistics of CacheThe stats sub command will display overall statistics about the cache. For example, the following command will display Total package names is the number of packages have found in the cache.$ apt-cache statsTotal package names: 51868 (1,037 k)Total package structures: 51868 (2,490 k) Normal packages: 39505 Pure virtual packages: 602 Single virtual packages: 3819 Mixed virtual packages: 1052 Missing: 6890Total distinct versions: 43015 (2,753 k)Total distinct descriptions: 81048 (1,945 k)Total dependencies: 252299 (7,064 k)Total ver/file relations: 45567 (729 k)Total Desc/File relations: 81048 (1,297 k)Total Provides mappings: 8228 (165 k)Total globbed strings: 286 (3,518 )Total dependency version space: 1,145 kTotal slack space: 62.6 kTotal space accounted for: 13.3 M

6. How to Update System PackagesThe update command is used to resynchronize the package index files from the their sources specified in/etc/apt/sources.listfile. The update command fetched the packages from their locations and update the packages to newer version.$ sudo apt-get update[sudo] password for tecmint: Ign http://security.ubuntu.com quantal-security InReleaseGet:1 http://security.ubuntu.com quantal-security Release.gpg [933 B] Get:2 http://security.ubuntu.com quantal-security Release [49.6 kB] Ign http://in.archive.ubuntu.com quantalInReleaseIgn http://in.archive.ubuntu.com quantal-updates InReleaseGet:3 http://repo.varnish-cache.org precise InRelease [13.7 kB] Ign http://in.archive.ubuntu.com quantal-backportsInReleaseHit http://in.archive.ubuntu.com quantalRelease.gpgGet:4 http://security.ubuntu.com quantal-security/main Sources [34.8 kB] Get:5 http://in.archive.ubuntu.com quantal-updates Release.gpg [933 B] ...7. How to Upgrade Software PackagesThe upgrade command is used to upgrade all the currently installed software packages on the system. Under any circumstances currently installed packages are not removed or packages which are not already installed neither retrieved and installed to satisfy upgrade dependencies.$ sudo apt-get upgradeReading package lists... DoneBuilding dependency tree Reading state information... DoneThe following packages have been kept back:linux-headers-genericlinux-image-generic wine1.5 wine1.5-i386The following packages will be upgraded:activity-log-manager-common activity-log-manager-control-centeradium-theme-ubuntualacartealsa-base app-install-data-partner appmenu-gtk appmenu-gtk3 apportapport-gtk aptapt-transport-https apt-utilsaptdaemonaptdaemon-data at-spi2-core bamfdaemon base-files bind9-host ...However, if you want to upgrade, unconcerned of whether software packages will be added or removed to fulfill dependencies, use the dist-upgrade sub command.$ sudo apt-get dist-upgrade8. How Do I Install or Upgrade Specific Packages?The install sub command is tracked by one or more packages wish for installation or upgrading.$ sudo apt-get install netcatReading package lists... DoneBuilding dependency tree Reading state information... DoneThe following extra packages will be installed:netcat-traditionalThe following NEW packages will be installed:netcatnetcat-traditional0 upgraded, 2 newly installed, 0 to remove and 328 not upgraded.Need to get 67.1 kB of archives.After this operation, 186 kB of additional disk space will be used.Do you want to continue [Y/n]? yGet:1 http://in.archive.ubuntu.com/ubuntu/ quantal/universe netcat-traditional i386 1.10-40 [63.8 kB]Get:2 http://in.archive.ubuntu.com/ubuntu/ quantal/universe netcat all 1.10-40 [3,340 B]Fetched 67.1 kB in 1s (37.5 kB/s)Selecting previously unselected package netcat-traditional.(Reading database ... 216118 files and directories currently installed.)Unpacking netcat-traditional (from .../netcat-traditional_1.10-40_i386.deb) ...Selecting previously unselected package netcat.Unpacking netcat (from .../netcat_1.10-40_all.deb) ...Processing triggers for man-db ...Setting up netcat-traditional (1.10-40) ...Setting up netcat (1.10-40) ...9. How I can Install Multiple Packages?You can add more than one package name along with the command in order to install multiple packages at the same time. For example, the following command will install packages nethogs and goaccess.$ sudo apt-get install nethogsgoaccessReading package lists... DoneBuilding dependency tree Reading state information... Donegoaccess is already the newest version.nethogs is already the newest version.0 upgraded, 0 newly installed, 0 to remove and 328 not upgraded.10. How to Install Several Packages using WildcardWith the help of regular expression you can add several packages with one string. For example, we use*wildcard to install several packages that contains the *name* string, name would be package-name.$ sudo apt-get install '*name*'11. How to install Packages without UpgradingUsing sub no-upgrade command will prevent already installed packages from upgrading.$ sudo apt-get install packageName --no-upgradeReading package lists... DoneBuilding dependency tree Reading state information... DoneSkipping vsftpd, it is already installed and upgrade is not set.0 upgraded, 0 newly installed, 0 to remove and 328 not upgraded.12. How to Upgrade Only Specific PackagesThe only-upgrade command do not install new packages but it only upgrade the already installed packages and disables new installation of packages.$ sudo apt-get install packageName --only-upgradeReading package lists... DoneBuilding dependency tree Reading state information... Donevsftpd is already the newest version.0 upgraded, 0 newly installed, 0 to remove and 328 not upgraded.13. How Do I Install Specific Package Version?Lets say you wish to install only specific version of packages, simply use the = with the package-name and append desired version.$ sudo apt-get install vsftpd=2.3.5-3ubuntu1Reading package lists... DoneBuilding dependency tree Reading state information... Donevsftpd is already the newest version.0 upgraded, 0 newly installed, 0 to remove and 328 not upgraded.14. How Do I Remove Packages Without ConfigurationTo un-install software packages without removing their configuration files (for later re-use the same configuration). Use theremove command as shown.$ sudo apt-get remove vsftpd[sudo] password for tecmint: Reading package lists... DoneBuilding dependency tree Reading state information... DoneThe following packages will be REMOVED:vsftpd0 upgraded, 0 newly installed, 1 to remove and 328 not upgraded.After this operation, 364 kB disk space will be freed.Do you want to continue [Y/n]? y(Reading database ... 216156 files and directories currently installed.)Removing vsftpd ...vsftpd stop/waitingProcessing triggers for ureadahead ...Processing triggers for man-db ...15. How Do I Completely Remove PackagesTo remove software packages including their configuration files, use the purge sub command as shown below.$ sudo apt-get purge vsftpdReading package lists... DoneBuilding dependency tree Reading state information... DoneThe following packages will be REMOVED:vsftpd*0 upgraded, 0 newly installed, 1 to remove and 328 not upgraded.After this operation, 0 B of additional disk space will be used.Do you want to continue [Y/n]? y(Reading database ... 216107 files and directories currently installed.)Removing vsftpd ...Purging configuration files for vsftpd ...Processing triggers for ureadahead ...Alternatively, you can combine both the commands together as shown below.$ sudo apt-get remove --purge vsftpdReading package lists... DoneBuilding dependency tree Reading state information... DoneThe following packages will be REMOVED:vsftpd*0 upgraded, 0 newly installed, 1 to remove and 328 not upgraded.After this operation, 364 kB disk space will be freed.Do you want to continue [Y/n]? y(Reading database ... 216156 files and directories currently installed.)Removing vsftpd ...vsftpd stop/waitingPurging configuration files for vsftpd ...Processing triggers for ureadahead ...Processing triggers for man-db ...16. How I Can Clean Up Disk SpaceThe clean command is used to free up the disk space by cleaning retrieved (downloaded).debfiles (packages) from the local repository.$ sudo apt-get clean17. How Do I Download Only Source Code of PackageTo download only source code of particular package, use the option download-only source with package-name as shown.$ sudo apt-get --download-only source vsftpdReading package lists... DoneBuilding dependency tree Reading state information... DoneNeed to get 220 kB of source archives.Get:1 http://in.archive.ubuntu.com/ubuntu/ quantal/main vsftpd 2.3.5-3ubuntu1 (dsc) [1,883 B]Get:2 http://in.archive.ubuntu.com/ubuntu/ quantal/main vsftpd 2.3.5-3ubuntu1 (tar) [188 kB]Get:3 http://in.archive.ubuntu.com/ubuntu/ quantal/main vsftpd 2.3.5-3ubuntu1 (diff) [30.5 kB]Fetched 220 kB in 4s (49.1 kB/s)Download complete and in download only mode18. How Can I Download and Unpack a PackageTo download and unpack source code of a package to a specific directory, type the following command.$ sudo apt-get source vsftpdReading package lists... DoneBuilding dependency tree Reading state information... DoneNeed to get 220 kB of source archives.Get:1 http://in.archive.ubuntu.com/ubuntu/ quantal/main vsftpd 2.3.5-3ubuntu1 (dsc) [1,883 B]Get:2 http://in.archive.ubuntu.com/ubuntu/ quantal/main vsftpd 2.3.5-3ubuntu1 (tar) [188 kB]Get:3 http://in.archive.ubuntu.com/ubuntu/ quantal/main vsftpd 2.3.5-3ubuntu1 (diff) [30.5 kB]Fetched 220 kB in 1s (112 kB/s) gpgv: Signature made Thursday 24 May 2012 02:35:09 AM IST using RSA key ID 2C48EE4Egpgv: Can't check signature: public key not founddpkg-source: warning: failed to verify signature on ./vsftpd_2.3.5-3ubuntu1.dscdpkg-source: info: extracting vsftpd in vsftpd-2.3.5dpkg-source: info: unpacking vsftpd_2.3.5.orig.tar.gzdpkg-source: info: unpacking vsftpd_2.3.5-3ubuntu1.debian.tar.gzdpkg-source: info: applying 01-builddefs.patchdpkg-source: info: applying 02-config.patchdpkg-source: info: applying 03-db-doc.patchdpkg-source: info: applying 04-link-local.patchdpkg-source: info: applying 05-whitespaces.patchdpkg-source: info: applying 06-greedy.patchdpkg-source: info: applying 07-utf8.patchdpkg-source: info: applying 08-manpage.patchdpkg-source: info: applying 09-s390.patchdpkg-source: info: applying 10-remote-dos.patchdpkg-source: info: applying 11-alpha.patchdpkg-source: info: applying 09-disable-anonymous.patchdpkg-source: info: applying 12-ubuntu-use-snakeoil-ssl.patch19. How Can I Download, Unpack and Compile a PackageYou can also download, unpack and compile the source code at the same time, using option compile as shown below.$ sudo apt-get --compile source goaccess[sudo] password for tecmint: Reading package lists... DoneBuilding dependency tree Reading state information... DoneNeed to get 130 kB of source archives.Get:1 http://in.archive.ubuntu.com/ubuntu/ quantal/universe goaccess 1:0.5-1 (dsc) [1,120 B]Get:2 http://in.archive.ubuntu.com/ubuntu/ quantal/universe goaccess 1:0.5-1 (tar) [127 kB]Get:3 http://in.archive.ubuntu.com/ubuntu/ quantal/universe goaccess 1:0.5-1 (diff) [2,075 B]Fetched 130 kB in 1s (68.0 kB/s)gpgv: Signature made Tuesday 26 June 2012 09:38:24 AM IST using DSA key ID A9FD4821gpgv: Can't check signature: public key not founddpkg-source: warning: failed to verify signature on ./goaccess_0.5-1.dscdpkg-source: info: extracting goaccess in goaccess-0.5dpkg-source: info: unpacking goaccess_0.5.orig.tar.gzdpkg-source: info: unpacking goaccess_0.5-1.debian.tar.gzdpkg-buildpackage: source package goaccessdpkg-buildpackage: source version 1:0.5-1dpkg-buildpackage: source changed by Chris Taylor dpkg-buildpackage: host architecture i386dpkg-source --before-build goaccess-0.5dpkg-checkbuilddeps: Unmet build dependencies: debhelper (>= 9) autotools-dev libncurses5-dev libglib2.0-dev libgeoip-devautoconfdpkg-buildpackage: warning: build dependencies/conflicts unsatisfied; abortingdpkg-buildpackage: warning: (Use -d flag to override.)...20. How Do I Download a Package Without InstallingUsing download option, you can download any given package without installing it. For example, the following command will only download nethogs package to current working directory.$ sudo apt-get download nethogsGet:1 Downloading nethogs 0.8.0-1 [27.1 kB]Fetched 27.1 kB in 3s (7,506 B/s)21. How Do I Check Change Log of Package?The changelog flag downloads a package change-log and shows the package version that is installed.$ sudo apt-get changelogvsftpdvsftpd (2.3.5-3ubuntu1) quantal; urgency=low

* Merge from Debian testing (LP: #1003644). Remaining changes: + debian/vsftpd.upstart: migrate vsftpd to upstart. + Add apport hook (LP: #513978): - debian/vsftpd.apport: Added. - debian/control: Build-depends on dh-apport. - debian/rules: Add --with apport. + Add debian/watch file. + debian/patches/09-disable-anonymous.patch: Disable anonymous loginby default. (LP: #528860) * debian/patches/12-ubuntu-us-snakeoil-ssl.patch: Use snakeoil SSLcertificates and key.

-- Andres Rodriguez Wed, 23 May 2012 16:59:36 -0400...22. How Do I Check Broken Dependencies?The check command is a diagnostic tool. It used to update package cache and checks for broken dependencies.$ sudo apt-get check[sudo] password for tecmint: Reading package lists... DoneBuilding dependency tree Reading state information... Done23. How Do I Search and Build Dependencies?This build-dep command searches the local repositories in the system and install the build dependencies for package. If the package does not exists in the local repository it will return an error code.$ sudo apt-get build-depnetcatThe following NEW packages will be installed:debhelper dh-apparmor html2text po-debconf quilt0 upgraded, 5 newly installed, 0 to remove and 328 not upgraded.Need to get 1,219 kB of archives.After this operation, 2,592 kB of additional disk space will be used.Do you want to continue [Y/n]? yGet:1 http://in.archive.ubuntu.com/ubuntu/ quantal/main html2text i386 1.3.2a-15build1 [91.4 kB]Get:2 http://in.archive.ubuntu.com/ubuntu/ quantal/main po-debconf all 1.0.16+nmu2ubuntu1 [210 kB]Get:3 http://in.archive.ubuntu.com/ubuntu/ quantal/main dh-apparmor all 2.8.0-0ubuntu5 [9,846 B]Get:4 http://in.archive.ubuntu.com/ubuntu/ quantal/main debhelper all 9.20120608ubuntu1 [623 kB]Get:5 http://in.archive.ubuntu.com/ubuntu/ quantal/main quilt all 0.60-2 [285 kB]Fetched 1,219 kB in 4s (285 kB/s)...24. How I Can Auto clean Apt-Get Cache?The autoclean command deletes all.debfiles from/var/cache/apt/archivesto free-up significant volume of disk space.$ sudo apt-get autocleanReading package lists... DoneBuilding dependency tree Reading state information... Done25. How I Can Auto remove Installed Packages?The autoremove sub command is used to auto remove packages that were certainly installed to satisfy dependencies for other packages and but they were now no longer required. For example, the following command will remove an installed package with its dependencies.$ sudo apt-get autoremovevsftpdReading package lists... DoneBuilding dependency tree Reading state information... DonePackage 'vsftpd' is not installed, so not removed0 upgraded, 0 newly installed, 0 to remove and 328 not upgraded.

What is Sudosudo(/sudu/[2]or/sudo/[2][3]) is aprogramforUnix-likecomputeroperating systemsthat allows users to run programs with the security privileges of another user (normally thesuperuser, or root).[4]Its name is a contraction of "substitute user do", meaning to do something as a different user (typically as root, the "superuser").[5]Unlike the su command, users typically supply their ownpasswordtosudorather than the root password. After authentication, and if the/usr/local/etc/sudoers(sometimes found at /etc/sudoers)configuration filepermits the user access, then the system will invoke the requested command. The sudoers configuration file enables a huge amount of configurability, including but not limited to: enabling root commands only from the invoking terminal; not requiring a password for certain commands; requiring a password per user or group; requiring re-entry of a password every time or never requiring a password at all for a particular command line. It can also be configured to permit passing arguments or multiple commands, and even supports commands with regular expressions.NAMEsudo, sudoedit - execute a command as another userSYNOPSISsudo-h|-K|-k|-L|-l|-V|-vsudo[-bEHPS] [-pprompt] [-uusername|#uid] [VAR=value] {-i|-s|command}sudoedit[-S] [-pprompt] [-uusername|#uid] file ...DESCRIPTIONsudoallows a permitted user to execute acommandas the superuser or another user, as specified in thesudoersfile. The real and effective uid and gid are set to match those of the target user as specified in the passwd file and the group vector is initialized based on the group file (unless the-Poption was specified). If the invoking user is root or if the target user is the same as the invoking user, no password is required. Otherwise,sudorequires that users authenticate themselves with a password by default (NOTE:in the default configuration this is the users password, not the root password). Once a user has been authenticated, a timestamp is updated and the user may then use sudo without a password for a short period of time (5minutes unless overridden insudoers).When invoked assudoedit, the-eoption (described below), is implied.sudodetermines who is an authorized user by consulting the file/etc/sudoers. By givingsudothe-vflag, a user can update the time stamp without running acommand. The password prompt itself will also time out if the users password is not entered within5minutes (unless overridden viasudoers).If a user who is not listed in thesudoersfile tries to run a command viasudo, mail is sent to the proper authorities, as defined at configure time or in thesudoersfile (defaults toroot). Note that the mail will not be sent if an unauthorized user tries to run sudo with the-lor-vflags. This allows users to determine for themselves whether or not they are allowed to usesudo.Ifsudois run by root and theSUDO_USERenvironment variable is set,sudowill use this value to determine who the actual user is. This can be used by a user to log commands through sudo even when a root shell has been invoked. It also allows the-eflag to remain useful even when being run via a sudo-run script or program. Note however, that the sudoers lookup is still done for root, not the user specified bySUDO_USER.sudocan log both successful and unsuccessful attempts (as well as errors) tosyslog(3), a log file, or both. By defaultsudowill log viasyslog(3) but this is changeable at configure time or via thesudoersfile.

How to Install Tomcat 8 and Get Started with Java Servlet ProgrammingStep OneInstall JavaInstalling Java withapt-getis easy. First, update the package index:sudo apt-get updateThen, check if Java is not already installed:java -versionIf it returns "The program java can be found in the following packages", Java hasn't been installed yet, so execute the following command:sudo apt-get install default-jreThis will install the Java Runtime Environment (JRE). If you instead need the Java Development Kit (JDK), which is usually needed to compile Java applications (for exampleApache Ant,Apache Maven,EclipseandIntelliJ IDEAexecute the following command:sudo apt-get install default-jdkThat is everything that is needed to install Java.Then, depending on the version you want to install, execute one of the following commands:Oracle JDK 6This is an old version but still in use.sudo apt-get install oracle-java6-installerOracle JDK 7This is the latest stable version.sudo apt-get install oracle-java7-installerOracle JDK 8sudo apt-get install oracle-java8-installerManaging Java (optional)When there are multiple Java installations on your Computer, the Java version to use as default can be chosen. To do this, execute the following command:sudo update-alternatives --config javaIt will usually return something like this if you have 2 installations (if you have more, it will of course return more):There are 2 choices for the alternative java (providing /usr/bin/java).

SelectionPathPriorityStatus

*0/usr/lib/jvm/java-7-oracle/jre/bin/java 1062auto mode

1/usr/lib/jvm/java-6-openjdk-amd64/jre/bin/java 1061manual mode

2/usr/lib/jvm/java-7-oracle/jre/bin/java1062manual mode

Press enter to keep the current choice[*], or type selection number:You can now choose the number to use as default. Do this to check for the Java compiler (javac):

sudo update-alternatives --configjavacIt is the same selection screen as the previous command and should be used in the same way. This command can be executed for all other commands which have different installations. In Java, this includes but is not limited to:keytool,javadocandjarsigner.

Create an environmental variable JAVA_HOME by typing following lines in terminali) $JAVA_HOME=/usr/lib/jvm/jdk1.7.0_15ii) $PATH=$PATH:$HOME/bin:$JAVA_HOME/biniii) $JRE_HOME=/usr/lib/jvm/jre1.7.0_15iv) $PATH=$PATH:$HOME/bin:$JRE_HOME/binv) $export JAVA_HOMEvi) $export JRE_HOMEvii) $export PATH

Step TwoInstall Tomcat1. Gotohttp://tomcat.apache.org Download Tomcat 7.0 "7.0.{xx}" (where{xx}denotes the latest upgrade number) Binary distribution Core "tar.gz" package (e.g., "apache-tomcat-7.0.{xx}.tar.gz", about 8 MB).

2.File is Down Loaded In Downloads Folder.

3.Extract files from that tar file and store it under a separate directory.

4.Installation can be done through apt-get by typing:

sudo apt-get install tomcat7It will ask for admin password.

5.Create a simple html page as follows and save as hello.jsp

HelloHello World

6.Type sudo nautilus in terminal without double codesA window will appear, in that open path filesystem/var/lib/samba/In this directory, make a new folder usershares if it is not present.

7.Now open path filesystem/var/lib/tomcat7/webapps8.In that directory, create a new folder jsp and put the hello.jsp file in that directory.

9.To run in browser type URL http://localhost:8080/jsp/hello.jsp or

http://YOURIPADDRESS:8080/jsp/hello.jsp 8080 is a port number for apache tomcat server.Note: ip address can be found by typing ifconfig in terminal.

Conclusion : To be Written by student