Menu

Showing posts with label Learning. Show all posts
Showing posts with label Learning. Show all posts

Machine Learning Techniques | AIML Guide

Machine learning (ML) is a branch of artificial intelligence (AI) that allows computers to learn from data and make decisions or predictions. Let’s explore the main types of machine learning techniques in simple and easy terms.

  1. Supervised Learning

    In supervised learning, we train a model using a dataset that includes both input data and the corresponding correct output. The goal is to learn a mapping from inputs to outputs so that the model can predict the output for new data.

    Classification: Predicts categories (e.g., identifying emails as spam or not spam).

    Regression: Predicts continuous values (e.g., estimating house prices).

    Examples: Linear Regression, Decision Trees, and Neural Networks.


  2. Unsupervised Learning

    Unsupervised learning works with data that doesn’t have labeled outputs. The model tries to find patterns and relationships in the data.

    Clustering: Groups similar data points together (e.g., customer segmentation).

    Dimensionality Reduction: Reduces the number of features in the data (e.g., Principal Component Analysis).

    Examples: K-Means Clustering and Hierarchical Clustering.


  3. Semi-Supervised Learning

    Semi-supervised learning uses a small amount of labeled data and a medium amount of unlabeled data. This approach can improve learning accuracy when labeling data is expensive or time-consuming.


    Example: Self-training algorithms that iteratively label the unlabeled data.


  4. Self-Supervised Learning

    In self-supervised learning, the model generates its own labels from the data. This technique is often used in natural language processing.


    Example: Predicting the next word in a sentence (used in language models like GPT).


  5. Reinforcement Learning

    Reinforcement learning involves training an agent to make a series of decisions by rewarding it for good actions and penalizing it for bad ones. The agent learns to maximize cumulative rewards over time.


    Example: Training a robot to navigate a maze or an AI to play a game like chess.



Key Concepts

    Agent: The learner or decision-maker.

    Environment: The world with which the agent interacts.

    Actions: The moves the agent can make.

    Rewards: Feedback from the environment to evaluate actions.


Conclusion

Machine learning offers various techniques for different types of data and problems. Understanding these high-level categories helps in choosing the right approach for your task. Whether it’s predicting outcomes with supervised learning, finding patterns with unsupervised learning, or optimizing actions with reinforcement learning, each technique has unique applications.


Read more about types of machine learning techniques:

Supervised Learning Technique

Unsupervised Learning Technique

Self-supervised Learning Technique


Do you stop reading article or post which is written in language that you dont understand?

Do you stop learning when you find something which is not written in the language which you understand or speaks? Don't let something written in a different language stop you to learn!.

In todays world, there are n number of translation tools available near to us to translate and understand what someone written or writting using their native language. These tools helping billion of people in the world to understand and learn the things from different world, it could be about culture, heritage, scrciptures, and anicient documents. 

Very frequently use translation tool in the world today.

  1. Bing Translate
  2. Google Translate

Setup DynamoDB in local machine and use as SQL

DynamoDB is a NoSQL database provided by Amazon. Those who are working on Dynamo DB always have to connect and work on dynamo DB using the web browser. But now Amazon came with NoSQL workbench that is an application which helps developers to connect with dynamo DB instance hosted on Amazon or local dynamo DB installed in local machine. Let's see how a NoSQL workbenchhelps developer and how a developer can connect and use NoSQL Workbench.
 

Prerequisite

You should have the latest Docker installed in your local machine.

Install and Setup DynamoDB

 
1. Run the docker.
2. Download the latest DynamoDB Docker image. 
2.1 Open a command prompt and run this command to download the docker image file for dynamo DB.
The command needs to run docker pull amazon/dynamodb-local

Download dynamo DB docker image
Download dynamo DB docker image


2.2 To start the docker run the following command docker run -d 8000:8000 amazon/dynamodb-local
Status of docker image downloading

2.3 Check the status of docker using command >> docker ps


3. Download the NoSQL workbench tool from Amazon site.  

4. Open the NoSQL workbench, go to operation builder and click on "Add connection" to create a new database connection.
NoSQL benchmark for Amazon DynamoDB
NoSQL benchmark for Amazon DynamoDB

5. Now NoSQL benchmark is connected with dynamoDB. You can now run your SQL command and perform transactions.

Hope this helps you! Thank You!  

If else || nested if statement in JSTL

Today we will discuss about; how to write simple if else and nested if else statements in JSTL.

If you have to check only a single value then you can use if statement "<c:if>" in JSTL. But if you want to achieve nested if else then you have to use <c:when> and <c:otherwise>.

Will will see both if and nested if else in JSTL with an example.

To use the JSTL in your JSP file we have to first import the JSTL tag library in our JSP file. Below is the import statement to where we are importing JSTL core tag library in our JSP. Specify a prefix to this tag which we will prefix further with our tag.

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 
prefix="c" use c when you use JSTL tags in your JSP file.
e.g. <c:if>, <c:choose>

Suppose we have a variable name which have a name of an user. let see how will check this using if statement in jstl.
Using <c:set> tag we can declare and set value to a variable. In below statement we are declaring a variable name and assigning its value RASHID.
<c:set var=name value="RASHID">
Now see the if condition 
 <c:if test="${name == 'RASHID'}">
 <c:set var=age value=23 />
</c:if>
Now we will using nested if else how will check the value of variable name in jstl.
<c:choose>
         <c:when test = "${name == 'RASHID'}">
            HIS NAME IS RASHID.
         </c:when>
         <c:when test = "${name == 'Ranjan'}">
            HIS NAME IS Ranjan.
         </c:when>
         <c:otherwise>
            No machtes....
         </c:otherwise>
 </c:choose>
Hope this will help you to understand the if else and nested if else condition using JSTL. Do let me know if you have any question and suggestions. 

If else condition in shell script with $? and grep command

In shell script condition check is very easy and simple using if else statements. Here is a example which we would like to discuss with our readers.

Scenario: We have a variable that contains long string value, user wants to find matching value from given string and perform check whether that text/character has matched from string value or or not.


#Program in Bash Shell
Line 1: CHECK_SOURCE="[main] INFO com.adobe.jcr.checknode.existence - Node does not exist"
line 2: echo $CHECK_SOURCE | grep -w -o -i 'Node exists'
Line 3: if [ $? == 0 ]; then
Line 4:        echo " matched"
Line 5: else 
Line 6: echo "not matched" 
Line 7: fi 

Explanation:

In line 1 we have declared a variable CHECK_SOURCE which have some value.
In line 2 we are finding text "Node exists" in value of variable CHECK_SOURCE using grep command.
In line 3 using if statement we are checking number of matches from last executed statement. $? sign will return number of matches. If text passed in grep command will find some matching text in variable then $? will number of matching otherwise it will return zero. 



Google Analytics questions and answers for beginner

1. What would you use to compare two date ranges in a report?

  1. Hourly, Day, Week, Month views in the time graph
  2. Real-time reports
  3. Date range comparison
  4. Account selector

2. What does the “Users” metric measure?

  1. The total number of visits to your website
  2. Users that had at least one session on your site in the given date range
  3. Users that landed on the homepage of your website
  4. Users who have signed up to an email newsletter on your website

3. In Google Analytics, what is the “Bounce Rate”?

  1. The number of times unique users returned to your website in a given time period
  2. The percentage of sessions in which a user exits from your homepage
  3. The percentage of total site exits
  4. The percentage of visits when a user landed on your website and exited without any interactions

4. In Google Analytics, what is a “dimension”?

  1. The total amount of revenue a business has made in a given date range.
  2. An attribute of a data set that can be organized for better analysis.
  3. A comparison of data between two date ranges.
  4. A report that offers information about your audience.

5. In Google Analytics, what is a “metric”?

  1. A dimension that can help you analyze site performance.
  2. The dates in your date range.
  3. A segment of data separated out in a report for comparison.
  4. The numbers in a data set often paired with dimensions.

6. In Google Analytics, what is a “secondary dimension”?

  1. An additional widget you can add to a dashboard for more specific analysis.
  2. An additional metric you can add to a report for more specific analysis.
  3. An additional dimension you can add to a report for more specific analysis.
  4. A visualization that allows you to view understand the impact of your data.

7. If you wish to see if report data is performing above or below the website average, which Google Analytics visualization should you choose?

  1. Pivot view
  2. Comparison view
  3. Performance view
  4. Percentage view

8. How do you increase the amount of data in a sampled Google Analytics report?

  1. Choose “Greater precision” in the sampling pulldown menu
  2. Choose “Faster response” in the sampling pulldown menu
  3. Apply additional filters
  4. Remove the Secondary Dimension

9. By selecting “Share Template Link” you can share your dashboard and your data with another user.

  1. True
  2. False

10. If you share a dashboard with others, they can change the information that shows on their dashboard

  1. True
  2. False

Correct Answers:

1. Date range comparison
2. Users that had at least one session on your site in the given date range
3. The percentage of visits when a user landed on your website and exited without any interactions
4. An attribute of a data set that can be organized for better analysis.
5. The numbers in a data set often paired with dimensions.
6. An additional dimension you can add to a report for more specific analysis.
7. Comparison view
8. Choose “Greater precision” in the sampling pulldown menu
9. False
10. True

Why Michael H. Hart keep Prophet Muhammad on top of most influencial person in history in his book The 100?

MUHAMMAD 570-632 

My choice of Muhammad to lead the list of the world's most influential persons may surprise some readers and may be questioned by others, but he was the only man in history who was supremely successful on both the religious and secular levels.
Of humble origins, Muhammad founded and promulgated one of the world's great religions, and became an immensely effective political leader. Today, thirteen centuries after his death, his influence is still powerful and pervasive.

The majority of the persons in this book had the advantage of being born and raised in centers of civilization, highly cultured or politically pivotal nations. Muhammad, however, was born in the year 570, in the city of Mecca, in southern Arabia, at that time a backward area of the world, far from the centers of trade, art, and learning. Orphaned at age six, he was reared in modest surroundings. Islamic tradition tells us that he was illiterate. His economic position improved when, at age twenty-five, he married a wealthy widow. Nevertheless, as he approached forty, there was little outward indication that he was a remarkable person.

Most Arabs at that time were pagans, who believed in many gods. There were, however, in Mecca, a small number of Jews and Christians; it was from them no doubt that Muhammad first learned of a single, omnipotent God who ruled the entire universe. When he was forty years old, Muhammad became convinced that this one true God (Allah) was speaking to him, and had chosen him to spread the true faith.

For three years, Muhammad preached only to close friends and associates. Then, about 613, he began preaching in public. As he slowly gained converts, the Meccan authorities came to consider him a dangerous nuisance. In 622, fearing for his safety, Muhammad fled to Medina (a city some 200 miles north of Mecca), where he had been offered a position of considerable political power.

This flight, called the Hegira, was the turning point of the Prophet's life. In Mecca, he had had few followers. In Medina, he had many more, and he soon acquired an influence that made him a virtual dictator. During the next few years, while Muhammad s following grew rapidly, a series of battles were fought between Medina and Mecca. This was ended in 630 with Muhammad's triumphant return to Mecca as conqueror. The remaining two and one-half years of his life witnessed the rapid conversion of the Arab tribes to the new religion. When Muhammad died, in 632, he was the effective ruler of all of southern Arabia.

The Bedouin tribesmen of Arabia had a reputation as fierce warriors. But their number was small; and plagued by disunity and internecine warfare, they had been no match for the larger armies of the kingdoms in the settled agricultural areas to the north. However, unified by Muhammad for the first time in history, and inspired by their fervent belief in the one true God, these small Arab armies now embarked upon one of the most astonishing series of conquests in human history. To the northeast of Arabia lay the large Neo-Persian Empire of the Sassanids; to the northwest lay the Byzantine, or Eastern Roman Empire, centered in Constantinople. Numerically, the Arabs were no match for their opponents. On the field of battle, though, the inspired Arabs rapidly conquered all of Mesopotamia, Syria, and Palestine. By 642, Egypt had been wrested from the Byzantine Empire, while the Persian armies had been crushed at the key battles of Qadisiya in 637, and Nehavend in 642.

But even these enormous conquests-which were made under the leadership of Muhammad's close friends and immediate successors, Abu Bakr and 'Umar ibn al-Khattab -did not mark the end of the Arab advance. By 711, the Arab armies had swept completely across North Africa to the Atlantic Ocean There they turned north and, crossing the Strait of Gibraltar, overwhelmed the Visigothic kingdom in Spain.

For a while, it must have seemed that the Moslems would overwhelm all of Christian Europe. However, in 732, at the famous Battle of Tours, a Moslem army, which had advanced into the center of France, was at last defeated by the Franks. Nevertheless, in a scant century of fighting, these Bedouin tribesmen, inspired by the word of the Prophet, had carved out an empire stretching from the borders of India to the Atlantic Ocean-the largest empire that the world had yet seen. And everywhere that the armies conquered, large-scale conversion to the new faith eventually followed.

Now, not all of these conquests proved permanent. The Persians, though they have remained faithful to the religion of the Prophet, have since regained their independence from the Arabs. And in Spain, more than seven centuries of warfare 5 finally resulted in the Christians reconquering the entire peninsula. However, Mesopotamia and Egypt, the two cradles of ancient civilization, have remained Arab, as has the entire coast of North Africa. The new religion, of course, continued to spread, in the intervening centuries, far beyond the borders of the original Moslem conquests. Currently it has tens of millions of adherents in Africa and Central Asia and even more in Pakistan and northern India, and in Indonesia. In Indonesia, the new faith has been a unifying factor. In the Indian subcontinent, however, the conflict between Moslems and Hindus is still a major obstacle to unity.

How, then, is one to assess the overall impact of Muhammad on human history? Like all religions, Islam exerts an enormous influence upon the lives of its followers. It is for this reason that the founders of the world's great religions all figure prominently in this book . Since there are roughly twice as many Christians as Moslems (Muslim) in the world, it may initially seem strange that Muhammad has been ranked higher than Jesus. There are two principal reasons for that decision. First, Muhammad played a far more important role in the development of Islam than Jesus did in the development of Christianity. Although Jesus was responsible for the main ethical and moral precepts of Christianity (insofar as these differed from Judaism), St. Paul was the main developer of Christian theology, its principal proselytizer, and the author of a large portion of the New Testament.

Muhammad, however, was responsible for both the theology of Islam and its main ethical and moral principles. In addition, he played the key role in proselytizing the new faith, and in establishing the religious practices of Islam. Moreover, he is the author of the Moslem holy scriptures, the Koran, a collection of certain of Muhammad's insights that he believed had been directly revealed to him by Allah. Most of these utterances were copied more or less faithfully during Muhammad's lifetime and were collected together in authoritative form not long after his death. The Koran therefore, closely represents Muhammad's ideas and teachings and to a considerable extent his exact words. No such detailed compilation of the teachings of Christ has survived. Since the Koran is at least as important to Moslems as the Bible is to Christians, the influence of Muhammed through the medium of the Koran has been enormous It is probable that the relative influence of Muhammad on Islam has been larger than the combined influence of Jesus Christ and St. Paul on Christianity. On the purely religious level, then, it seems likely that Muhammad has been as influential in human history as Jesus.

Furthermore, Muhammad (unlike Jesus) was a secular as well as a religious leader. In fact, as the driving force behind the Arab conquests, he may well rank as the most influential political leader of all time.

Of many important historical events, one might say that they were inevitable and would have occurred even without the particular political leader who guided them. For example, the South American colonies would probably have won their independence from Spain even if Simon Bolivar had never lived. But this cannot be said of the Arab conquests. Nothing similar had occurred before Muhammad, and there is no reason to believe that the conquests would have been achieved without him. The only comparable conquests in human history are those of the Mongols in the thirteenth century, which were primarily due to the influence of Genghis Khan. These conquests, however, though more extensive than those of the Arabs, did not prove permanent, and today the only areas occupied by the Mongols are those that they held prior to the time of Genghis Khan.

It is far different with the conquests of the Arabs. From Iraq to Morocco, there extends a whole chain of Arab nations united not merely by their faith in Islam, but also by their Arabic language, history, and culture. The centrality of the Koran in the Moslem religion and the fact that it is written in Arabic have probably prevented the Arab language from breaking up into mutually unintelligible dialects, which might otherwise have occurred in the intervening thirteen centuries. Differences and divisions between these Arab states exist, of course, and they are considerable, but the partial disunity should not blind us to the important elements of unity that have continued to exist. For instance, neither Iran nor Indonesia, both oil-producing states and both Islamic in religion, joined in the oil embargo of the winter of 1973-74. It is no coincidence that all of the Arab states, and only the Arab states, participated in the embargo.

We see, then, that the Arab conquests of the seventh century have continued to play an important role in human history, down to the present day. It is this unparalleled combination of secular and religious influence which I feel entitles Muhammad to be considered the most influential single figure in human history.


References:

Running Apache Tomcat 8.5 Servlet/JSP Container

Apache Tomcat 8.5 requires a Java Standard Edition Runtime Environment (JRE) version 7 or later.

Running With JRE 7 Or Later


(1) Download and Install a Java SE Runtime Environment (JRE)


(1.1) Download a Java SE Runtime Environment (JRE), release version 7 or later, from       http://www.oracle.com/technetwork/java/javase/downloads/index.html

(1.2) Install the JRE according to the instructions included with the
      release.

      You may also use a full Java Development Kit (JDK) rather than just
      a JRE.


(2) Download and Install Apache Tomcat


(2.1) Download a binary distribution of Tomcat from:


(2.2) Unpack the binary distribution so that it resides in its own
      directory (conventionally named "apache-tomcat-[version]").

      For the purposes of the remainder of this document, the name
      "CATALINA_HOME" is used to refer to the full pathname of that
      directory.

NOTE:  As an alternative to downloading a binary distribution, you can create your own from the Tomcat source code, as described in "BUILDING.txt".  You can either

  a)  Do the full "release" build and find the created distribution in the
      "output/release" directory and then proceed with unpacking as above, or

  b)  Do a simple build and use the "output/build" directory as       "CATALINA_HOME".  Be warned that there are some differences between the contents of the "output/build" directory and a full "release" distribution.

(3) Configure Environment Variables


Tomcat is a Java application and does not use environment variables directly.
Environment variables are used by the Tomcat startup scripts. The scripts use
the environment variables to prepare the command that starts Tomcat.

(3.1) Set CATALINA_HOME (required) and CATALINA_BASE (optional)

The CATALINA_HOME environment variable should be set to the location of the
root directory of the "binary" distribution of Tomcat.

The Tomcat startup scripts have some logic to set this variable
automatically if it is absent, based on the location of the startup script
in *nix and on the current directory in Windows. That logic might not work
in all circumstances, so setting the variable explicitly is recommended.

The CATALINA_BASE environment variable specifies location of the root
directory of the "active configuration" of Tomcat. It is optional. It
defaults to be equal to CATALINA_HOME.

Using distinct values for the CATALINA_HOME and CATALINA_BASE variables is
recommended to simplify further upgrades and maintenance. It is documented
in the "Multiple Tomcat Instances" section below.


(3.2) Set JRE_HOME or JAVA_HOME (required)

These variables are used to specify location of a Java Runtime
Environment or of a Java Development Kit that is used to start Tomcat.

The JRE_HOME variable is used to specify location of a JRE. The JAVA_HOME
variable is used to specify location of a JDK.

Using JAVA_HOME provides access to certain additional startup options that
are not allowed when JRE_HOME is used.

If both JRE_HOME and JAVA_HOME are specified, JRE_HOME is used.

The recommended place to specify these variables is a "setenv" script. See
below.


(3.3) Other variables (optional)

Other environment variables exist, besides the four described above.
See the comments at the top of catalina.bat or catalina.sh scripts for the list and a description of each of them.

One frequently used variable is CATALINA_OPTS. It allows specification of
additional options for the java command that starts Tomcat.

See the Java documentation for the options that affect the Java Runtime Environment.

See the "System Properties" page in the Tomcat Configuration Reference for the system properties that are specific to Tomcat.

A similar variable is JAVA_OPTS. It is used less frequently. It allows specification of options that are used both to start and to stop Tomcat as well as for other commands.

Note: Do not use JAVA_OPTS to specify memory limits. You do not need much memory for a small process that is used to stop Tomcat. Those settings belong to CATALINA_OPTS.

Another frequently used variable is CATALINA_PID (on *nix only). It specifies the location of the file where process id of the forked Tomcat java process will be written. This setting is optional. It will enable the following features:

 *  better protection against duplicate start attempts and
 *  allows forceful termination of Tomcat process when it does not react to
    the standard shutdown command.


(3.4) Using the "setenv" script (optional, recommended)

Apart from CATALINA_HOME and CATALINA_BASE, all environment variables can be specified in the "setenv" script. The script is placed either into CATALINA_BASE/bin or into CATALINA_HOME/bin directory and is named
setenv.bat (on Windows) or setenv.sh (on *nix). The file has to be readable.

By default the setenv script file is absent. If the script file is present both in CATALINA_BASE and in CATALINA_HOME, the one in CATALINA_BASE is preferred.

For example, to configure the JRE_HOME and CATALINA_PID variables you can
create the following script file:

On Windows, %CATALINA_BASE%\bin\setenv.bat:

  set "JRE_HOME=%ProgramFiles%\Java\jre7"
  exit /b 0

On *nix, $CATALINA_BASE/bin/setenv.sh:

  JRE_HOME=/usr/java/latest
  CATALINA_PID="$CATALINA_BASE/tomcat.pid"


The CATALINA_HOME and CATALINA_BASE variables cannot be configured in the setenv script, because they are used to locate that file.

All the environment variables described here and the "setenv" script are used only if you use the standard scripts to launch Tomcat. For example, if you have installed Tomcat as a service on Windows, the service wrapper launches Java directly and does not use the script files.


(4) Start Up Tomcat


(4.1) Tomcat can be started by executing one of the following commands:

  On Windows:

      %CATALINA_HOME%\bin\startup.bat

    or

      %CATALINA_HOME%\bin\catalina.bat start

  On *nix:

      $CATALINA_HOME/bin/startup.sh

    or

      $CATALINA_HOME/bin/catalina.sh start

(4.2) After startup, the default web applications included with Tomcat will be
      available by visiting:


(4.3) Further information about configuring and running Tomcat can be found in
      the documentation included here, as well as on the Tomcat web site:



(5) Shut Down Tomcat


(5.1) Tomcat can be shut down by executing one of the following commands:

  On Windows:

      %CATALINA_HOME%\bin\shutdown.bat

    or

      %CATALINA_HOME%\bin\catalina.bat stop

  On *nix:

      $CATALINA_HOME/bin/shutdown.sh

    or

      $CATALINA_HOME/bin/catalina.sh stop


Advanced Configuration - Multiple Tomcat Instances

In many circumstances, it is desirable to have a single copy of a Tomcat binary distribution shared among multiple users on the same server.  To make this possible, you can set the CATALINA_BASE environment variable to the directory that contains the files for your 'personal' Tomcat instance.

When running with a separate CATALINA_HOME and CATALINA_BASE, the files
and directories are split as following:

In CATALINA_BASE:

 * bin  - Only the following files:

           * setenv.sh (*nix) or setenv.bat (Windows),
           * tomcat-juli.jar

          The setenv scripts were described above. The tomcat-juli library
          is documented in the Logging chapter in the User Guide.

 conf - Server configuration files (including server.xml)

 lib  - Libraries and classes, as explained below

 logs - Log and output files

 webapps - Automatically loaded web applications

 work - Temporary working directories for web applications

 temp - Directory used by the JVM for temporary files (java.io.tmpdir)


In CATALINA_HOME:

 bin  - Startup and shutdown scripts

          The following files will be used only if they are absent in
          CATALINA_BASE/bin:

          setenv.sh (*nix), setenv.bat (Windows), tomcat-juli.jar

 lib  - Libraries and classes, as explained below

 endorsed - Libraries that override standard "Endorsed Standards"
              libraries provided by JRE. See Classloading documentation
              in the User Guide for details.
              This is only supported for Java <= 8.
              By default this "endorsed" directory is absent.

In the default configuration the JAR libraries and classes both in CATALINA_BASE/lib and in CATALINA_HOME/lib will be added to the common
classpath, but the ones in CATALINA_BASE will be added first and thus will be searched first.

The idea is that you may leave the standard Tomcat libraries in CATALINA_HOME/lib and add other ones such as database drivers into
CATALINA_BASE/lib.

In general it is advised to never share libraries between web applications, but put them into WEB-INF/lib directories inside the applications. See Classloading documentation in the User Guide for details.


It might be useful to note that the values of CATALINA_HOME and CATALINA_BASE can be referenced in the XML configuration files processed
by Tomcat as ${catalina.home} and ${catalina.base} respectively.

For example, the standard manager web application can be kept in CATALINA_HOME/webapps/manager and loaded into CATALINA_BASE by using
the following trick:

 * Copy the CATALINA_HOME/webapps/manager/META-INF/context.xml
   file as CATALINA_BASE/conf/Catalina/localhost/manager.xml

 * Add docBase attribute as shown below.

The file will look like the following:

  <?xml version="1.0" encoding="UTF-8"?>  <Context docBase="${catalina.home}/webapps/manager"    antiResourceLocking="false" privileged="true" >    <Valve className="org.apache.catalina.valves.RemoteAddrValve"         allow="127\.0\.0\.1" />  </Context>

See Deployer chapter in User Guide and Context and Host chapters in the Configuration Reference for more information on contexts and web application deployment.

Troubleshooting


There are only really 2 things likely to go wrong during the stand-alone
Tomcat install:

(1) The most common hiccup is when another web server (or any process for that
    matter) has laid claim to port 8080.  This is the default HTTP port that
    Tomcat attempts to bind to at startup.  To change this, open the file:

       $CATALINA_HOME/conf/server.xml

    and search for '8080'.  Change it to a port that isn't in use, and is
    greater than 1024, as ports less than or equal to 1024 require superuser
    access to bind under UNIX.

    Restart Tomcat and you're in business.  Be sure that you replace the "8080"
    in the URL you're using to access Tomcat.  For example, if you change the
    port to 1977, you would request the URL http://localhost:1977/ in your
    browser.

(2) The 'localhost' machine isn't found.  This could happen if you're behind a
    proxy.  If that's the case, make sure the proxy configuration for your
    browser knows that you shouldn't be going through the proxy to access the
    "localhost".

    In Firefox, this is under Tools/Preferences -> Advanced/Network ->
    Connection -> Settings..., and in Internet Explorer it is Tools ->
    Internet Options -> Connections -> LAN Settings.


Optional Components


The following optional components may be included with the Apache Tomcat binary
distribution. If they are not included, you can install them separately.

 1. Apache Tomcat Native library

 2. Apache Commons Daemon service launcher

Both of them are implemented in C language and as such have to be compiled
into binary code. The binary code will be specific for a platform and CPU
architecture and it must match the Java Runtime Environment executables
that will be used to launch Tomcat.

The Windows-specific binary distributions of Apache Tomcat include binary
files for these components. On other platforms you would have to look for
binary versions elsewhere or compile them yourself.

If you are new to Tomcat, do not bother with these components to start with.
If you do use them, do not forget to read their documentation.


Apache Tomcat Native library


It is a library that allows to use the "Apr" variant of HTTP and AJP
protocol connectors in Apache Tomcat. It is built around OpenSSL and Apache
Portable Runtime (APR) libraries. Those are the same libraries as used by
Apache HTTPD Server project.

This feature was especially important in the old days when Java performance
was poor. It is less important nowadays, but it is still used and respected
by many. See Tomcat documentation for more details.

For further reading:

Apache Tomcat documentation


    * Documentation for APR/Native library in the Tomcat User's Guide


    * Documentation for the HTTP and AJP protocol connectors in the Tomcat
      Configuration Reference



 - Apache Tomcat Native project home


 - Other projects

    * OpenSSL


    * Apache Portable Runtime


    * Apache HTTP Server


To disable Apache Tomcat Native library:

 - To disable Apache Tomcat Native library when it is installed, or
 - To remove the warning that is logged during Tomcat startup when the
   library is not installed:

   Edit the "conf/server.xml" file and remove "AprLifecycleListener" from
   it.

The binary file of Apache Tomcat Native library is usually named

  - "tcnative-1.dll" on Windows
  - "libtcnative-1.so" on *nix systems


Apache Commons Daemon


Apache Commons Daemon project provides wrappers that can be used to
install Apache Tomcat as a service on Windows or as a daemon on *nix
systems.

The Windows-specific implementation of Apache Commons Daemon is called
"procrun". The *nix-specific one is called "jsvc".

For further reading:

 - Apache Commons Daemon project


 - Apache Tomcat documentation

    * Installing Apache Tomcat


    * Windows service HOW-TO


The binary files of Apache Commons Daemon in Apache Tomcat distributions
for Windows are named:

  - "tomcat8.exe"
  - "tomcat8w.exe"

These files are renamed copies of "prunsrv.exe" and "prunmgr.exe" from
Apache Commons Daemon distribution. The file names have a meaning: they are used as the service name to register the service in Windows, as well as the
key name to store distinct configuration for this installation of "procrun". If you would like to install several instances of Tomcat 8.5 in parallel, you have to further rename those files, using the same naming scheme.