!C99Shell v. 1.0 pre-release build #13!

Software: Apache. PHP/5.5.15 

uname -a: Windows NT SVR-DMZ 6.1 build 7600 (Windows Server 2008 R2 Enterprise Edition) i586 

SYSTEM 

Safe-mode: OFF (not secure)

C:\dmz\tomcat\webapps\docs\   drwxrwxrwx
Free 4.08 GB of 39.52 GB (10.32%)
Detected drives: [ a ] [ c ] [ d ] [ e ] [ f ]
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     virtual-hosting-howto.html (19.76 KB)      -rw-rw-rw-
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
Apache Tomcat 7 (7.0.42) - Virtual Hosting and Tomcat

      The Apache Tomcat Servlet/JSP Container

Apache Tomcat 7

Version 7.0.42, Jul 2 2013
Apache Logo

Links

User Guide

Reference

Apache Tomcat Development

Virtual Hosting and Tomcat

Table of Contents
Assumptions

For the sake of this how-to, assume you have a development host with two host names, ren and stimpy. Let's also assume one instance of Tomcat running, so $CATALINA_HOME refers to wherever it's installed, perhaps /usr/local/tomcat.

Also, this how-to uses Unix-style path separators and commands; if you're on Windows modify accordingly.

server.xml

At the simplest, edit the Engine portion of your server.xml file to look like this:

<Engine name="Catalina" defaultHost="ren">
    <Host name="ren"    appBase="renapps"/>
    <Host name="stimpy" appBase="stimpyapps"/>
</Engine>
    

Note that the directory structures under the appBase for each host should not overlap each other.

Consult the configuration documentation for other attributes of the Engine and Host elements.

Webapps Directory

Create directories for each of the virtual hosts:

mkdir $CATALINA_HOME/renapps
mkdir $CATALINA_HOME/stimpyapps
    
Configuring Your Contexts
General

Contexts are normally located underneath the appBase directory. For example, to deploy the foobar context as a war file in the ren host, use $CATALINA_HOME/renapps/foobar.war. Note that the default or ROOT context for ren would be deployed as $CATALINA_HOME/renapps/ROOT.war (WAR) or $CATALINA_HOME/renapps/ROOT (directory).

NOTE: The docBase for a context should never be the same as the appBase for a host.

context.xml - approach #1

Within your Context, create a META-INF directory and then place your Context definition in it in a file named context.xml. i.e. $CATALINA_HOME/renapps/ROOT/META-INF/context.xml This makes deployment easier, particularly if you're distributing a WAR file.

context.xml - approach #2

Create a structure under $CATALINA_HOME/conf/Catalina corresponding to your virtual hosts, e.g.:

mkdir $CATALINA_HOME/conf/Catalina/ren
mkdir $CATALINA_HOME/conf/Catalina/stimpy
      

Note that the ending directory name "Catalina" represents the name attribute of the Engine element as shown above.

Now, for your default webapps, add:

$CATALINA_HOME/conf/Catalina/ren/ROOT.xml
$CATALINA_HOME/conf/Catalina/stimpy/ROOT.xml
      

If you want to use the Tomcat manager webapp for each host, you'll also need to add it here:

cd $CATALINA_HOME/conf/Catalina
cp localhost/manager.xml ren/
cp localhost/manager.xml stimpy/
      
Further Information

Consult the configuration documentation for other attributes of the Context element.

Comments

Notice: This comments section collects your suggestions on improving documentation for Apache Tomcat.

If you have trouble and need help, read Find Help page and ask your question on the tomcat-users mailing list. Do not ask such questions here. This is not a Q&A section.

The Apache Comments System is explained here. Comments may be removed by our moderators if they are either implemented or considered invalid/off-topic.


Copyright © 1999-2013, Apache Software Foundation

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ ok ]

:: Make Dir ::
 
[ ok ]
:: Make File ::
 
[ ok ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 1.0 pre-release build #13 powered by Captain Crunch Security Team | http://ccteam.ru | Generation time: 0.0156 ]--