Apache Tomcat 6.0 - Virtual Hosting and Tomcat

2009/07/09 10:53

[출처] http://tomcat.apache.org/tomcat-6.0-doc/virtual-hosting-howto.html


Apache Tomcat 6.0

Virtual Hosting and Tomcat

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/ROOR (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.

크리에이티브 커먼즈 라이센스
Creative Commons License
이올린에 북마크하기
2009/07/09 10:53 2009/07/09 10:53
Posted by Marine™


댓글을 달아주세요

[로그인][오픈아이디란?]



Adding .FLV MIME Type in IIS

2009/07/09 10:49
Adding .FLV MIME Type in IIS Dot NET

2007/05/18 19:36

복사 http://blog.naver.com/koo1973/20037251523

Adding .FLV MIME Type in IIS
Ryan Moore(Software Engineer) Posted 5/16/2005
Comments (44) | Trackbacks (0)


.FLV files are already the best method for publishing video on the web, and are sure to become even better with the new enhancements in Flash 8. When serving .flv files off of a Windows Server 2003 (or any other Windows server I would imagine) requires setting up the MIME type on the server first (it isn't one of the native MIME types on MS servers).

You can figure out easily if your server is configured to support .flv files by posting a .flv file on a server and navigating to the URL of that .flv in a browser. If you see a LONG string of garbage on the screen, your server isn't set up for .FLVs and needs to have the MIME type set up.

Adding .flv MIME type in IIS

1) Select the site to configure in IIS, right click and select "Properties"
2) Under HTTP Headers Tab, select "File Types" under the MIME Map section and select "New Type"
3) Type ".flv" as the associated extension and "video/x-flv" as the content type.
4) Select "OK" and you're ready to fly!
 
크리에이티브 커먼즈 라이센스
Creative Commons License
이올린에 북마크하기
2009/07/09 10:49 2009/07/09 10:49
Posted by Marine™


댓글을 달아주세요

[로그인][오픈아이디란?]


BLOG main image
변해가는 세상은 뒤로 두고 by Marine™

카테고리

전체 (125)
Know (64)
Its Life (60)

최근에 받은 트랙백

글 보관함

달력

«   2009/07   »
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31  
Total : 124309
Today : 88 Yesterday : 79