Apache-Tomcat: Difference between revisions

From QNAPedia
Jump to navigation Jump to search
m (1 revision imported)
 
No edit summary
Line 1: Line 1:
__NOTOC__ ''By AdNovea – June 2009 – version 1.0'' <br><br>
__NOTOC__ ''By AdNovea – June 2009 – version 1.0''


{| border="0"
{| border="0"
|- valign="top"
|- valign="top"
| [[Image:Tomcat.gif|Apache-Tomcat logo]] &nbsp;  
| [[File:Tomcat.gif|Apache-Tomcat logo]] &nbsp;
| Apache Tomcat is an implementation of the Java Servlet and JavaServer Pages technologies. The Java Servlet and JavaServer Pages specifications are developed under the Java Community Process.<br>Apache Tomcat powers numerous large-scale, mission-critical web applications across a diverse range of industries and organizations.
| Apache Tomcat is an implementation of the Java Servlet and JavaServer Pages technologies. The Java Servlet and JavaServer Pages specifications are developed under the Java Community Process.<br/>Apache Tomcat powers numerous large-scale, mission-critical web applications across a diverse range of industries and organizations.
|}
|}


= Installation =
= Installation =
<blockquote><span style="color:red">'''IMPORTANT: Apache-Tomcat requires the JRE QPKG [1] to be up and running.'''</span><br>  
<blockquote><span style="color:red">'''IMPORTANT: Apache-Tomcat requires the JRE QPKG [1] to be up and running.'''</span>
*Download, Install and Enable the '''JRE QPKG''' first  
*Download, Install and Enable the '''JRE QPKG''' first
*Download, Install and Enable the '''Apache-Tomcat QPKG'''.
*Download, Install and Enable the '''Apache-Tomcat QPKG'''.
<br> <small>[1] JRE QPKG is available only for the x86 QNAP Platform. Please refer to the SUN Java website about the release conditions for other processors.</small> <br> </blockquote>  
<br/><small>[1] JRE QPKG is available only for the x86 QNAP Platform. Please refer to the SUN Java website about the release conditions for other processors.</small><br/></blockquote>
= Apache-Tomcat Administration =
= Apache-Tomcat Administration =
<blockquote>In your browser enter the following address [2]: <pre>http://&lt;your_nas_ip&gt;:7080/
<blockquote>In your browser enter the following address [2]:<pre>http://&lt;your_nas_ip&gt;:7080/
</pre>  
</pre>
<small>[2] Forward the port to access the Apache-Tomcat server from external network</small> [[Image:Apache-tomcat admin.jpg|thumb|center|500px]]  
 
<small>[2] Forward the port to access the Apache-Tomcat server from external network</small> [[File:Apache-tomcat admin.jpg|thumb|center|500px]]


*To change the Apache-Tomcat port, edit the section below in the '''conf/server.xml''' file:
*To change the Apache-Tomcat port, edit the section below in the '''conf/server.xml''' file:
Line 22: Line 23:
               redirectPort="8443" /&gt;
               redirectPort="8443" /&gt;


</pre>  
</pre>
== Set up the Administrator account  ==


If the page here above is displayed, it means that Apache-Tomcat is running.<br> Nevertheless don't be surprised if you cannot access the '''Status''' or the '''Tomcat Manager.''' You must first setup the Admin account.<br> Open the '''usr/local/tomcat/conf/tomcat-users.xml''' file using an SFTP client like Transmit(OS X) or WinSCP(Windows), and using a text editor insert the content below between the tags (''change with secret''):  
== Set up the Administrator account ==
 
If the page here above is displayed, it means that Apache-Tomcat is running.<br/>Nevertheless don't be surprised if you cannot access the '''Status''' or the '''Tomcat Manager.''' You must first setup the Admin account.<br/>Open the '''usr/local/tomcat/conf/tomcat-users.xml''' file using an SFTP client like Transmit(OS X) or WinSCP(Windows), and using a text editor insert the content below between the tags (''change with secret''):
<pre>  &lt;role rolename="manager"/&gt;
<pre>  &lt;role rolename="manager"/&gt;
   &lt;user username="manager" password="password" roles="manager"/&gt;
   &lt;user username="manager" password="password" roles="manager"/&gt;
</pre>  
</pre>
<br>
 
 


*The '''conf/tomcat-users.xml''' manages all users permissions as shown in the example below:
*The '''conf/tomcat-users.xml''' manages all users permissions as shown in the example below:
Line 43: Line 46:
   &lt;user username="role1" password="tomcat" roles="role1"/&gt;
   &lt;user username="role1" password="tomcat" roles="role1"/&gt;
&lt;/tomcat-users&gt;
&lt;/tomcat-users&gt;
</pre> </blockquote>  
</pre>
= Adding applications =
</blockquote>
= Adding applications =
<blockquote>
<blockquote>
*Enter the '''Tomcat Manager'''.  
*Enter the '''Tomcat Manager'''.
*In '''WAR file to deploy''', browse to your WAR file  
*In '''WAR file to deploy''', browse to your WAR file
*Click '''Deploy''' [1].  
*Click '''Deploy''' [1].
*Your application appears in the '''List Applications'''  
*Your application appears in the '''List Applications'''
*Click the link in the list or http://your_nas_ip:7080/my_application
*Click the link in the list or [http://your_nas_ip:7080/my_application http://your_nas_ip:7080/my_application]
<small>[1] Deployed applcations are located under the '''Apache-Tomcat/webapps''' directory</small> </blockquote>  
<small>[1] Deployed applcations are located under the '''Apache-Tomcat/webapps''' directory</small></blockquote>
<span style="color: red">'''IMPORTANT: Removal of the Apache-Tomcat QPKG will remove all the deployed applications and associated data.'''</span> <br><br>  
<span style="color: red">'''IMPORTANT: Removal of the Apache-Tomcat QPKG will remove all the deployed applications and associated data.'''</span>
 
[[Category:Pages with broken file links]] [[Category:Web Server & Applications (Apache + PHP + MySQL / SQLite)|T]] [[Category:QPKG|Q]] [[Category:Tomcat|T]] [[Category:JRE|J]]
[[Category:Web_Server_&_Applications_(Apache_+_PHP_+_MySQL_/_SQLite)|T]] [[Category:QPKG|Q]] [[Category:Tomcat|T]] [[Category:JRE|J]]

Revision as of 17:41, 29 June 2015

By AdNovea – June 2009 – version 1.0
Apache-Tomcat logo   Apache Tomcat is an implementation of the Java Servlet and JavaServer Pages technologies. The Java Servlet and JavaServer Pages specifications are developed under the Java Community Process.
Apache Tomcat powers numerous large-scale, mission-critical web applications across a diverse range of industries and organizations.

Installation

IMPORTANT: Apache-Tomcat requires the JRE QPKG [1] to be up and running.

  • Download, Install and Enable the JRE QPKG first
  • Download, Install and Enable the Apache-Tomcat QPKG.


[1] JRE QPKG is available only for the x86 QNAP Platform. Please refer to the SUN Java website about the release conditions for other processors.

Apache-Tomcat Administration

In your browser enter the following address [2]:

http://<your_nas_ip>:7080/

[2] Forward the port to access the Apache-Tomcat server from external network

Apache-tomcat admin.jpg
  • To change the Apache-Tomcat port, edit the section below in the conf/server.xml file:
    <Connector port="7080" protocol="HTTP/1.1" 
               connectionTimeout="20000" 
               redirectPort="8443" />

Set up the Administrator account

If the page here above is displayed, it means that Apache-Tomcat is running.
Nevertheless don't be surprised if you cannot access the Status or the Tomcat Manager. You must first setup the Admin account.
Open the usr/local/tomcat/conf/tomcat-users.xml file using an SFTP client like Transmit(OS X) or WinSCP(Windows), and using a text editor insert the content below between the tags (change with secret):

  <role rolename="manager"/>
  <user username="manager" password="password" roles="manager"/>


  • The conf/tomcat-users.xml manages all users permissions as shown in the example below:
<?xml version='1.0' encoding='utf-8'?>
<tomcat-users>
  <role rolename="manager"/>
  <role rolename="tomcat"/>
  <role rolename="admin"/>
  <role rolename="role1"/>
  <user username="both" password="tomcat" roles="tomcat,role1"/>
  <user username="tomcat" password="tomcat" roles="tomcat"/>
  <user username="admin" password="admin" roles="admin,manager"/>
  <user username="role1" password="tomcat" roles="role1"/>
</tomcat-users>

Adding applications

  • Enter the Tomcat Manager.
  • In WAR file to deploy, browse to your WAR file
  • Click Deploy [1].
  • Your application appears in the List Applications
  • Click the link in the list or http://your_nas_ip:7080/my_application

[1] Deployed applcations are located under the Apache-Tomcat/webapps directory

IMPORTANT: Removal of the Apache-Tomcat QPKG will remove all the deployed applications and associated data.