<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Sebastian Mogilowskis Blog &#187; virtual host</title>
	<atom:link href="http://www.mogilowski.net/lang/en-us/tag/virtual-host/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mogilowski.net</link>
	<description>Just another blog about administration, linux and other stuff</description>
	<lastBuildDate>Wed, 08 Feb 2012 12:16:33 +0000</lastBuildDate>
	<language>en-us</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Install Coldfusion 8 Multiserver on Debian 5.0 Lenny with Apache 2</title>
		<link>http://www.mogilowski.net/lang/en-us/2009/02/23/install-coldfusion-8-multiserver-on-debian-50-lenny-with-apache-2</link>
		<comments>http://www.mogilowski.net/lang/en-us/2009/02/23/install-coldfusion-8-multiserver-on-debian-50-lenny-with-apache-2#comments</comments>
		<pubDate>Mon, 23 Feb 2009 10:51:03 +0000</pubDate>
		<dc:creator>sebastian</dc:creator>
				<category><![CDATA[Coldfusion]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[multiserver]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[virtual host]]></category>

		<guid isPermaLink="false">http://www.mogilowski.net/?p=313</guid>
		<description><![CDATA[This article describes, how to install Adobe Coldfusion 8 with Multiserver configuration. You can use this configuration for an ISP like coldfusion setup. Each instance/virtual host will have its own Coldfusion administrator with custom settings. 1. Prerequirements: * Apache 2 is installed and running correctly. * libstdc++5 is installed. aptitude install libstdc++5 * You have [...]]]></description>
			<content:encoded><![CDATA[<p><span lang="en-us">This article describes, how to install Adobe Coldfusion 8 with Multiserver configuration. You can use this configuration for an ISP like coldfusion setup. Each instance/virtual host will have its own Coldfusion administrator with custom settings.</span></p>
<h3><span lang="en-us">1. Prerequirements:</span></h3>
<p><span lang="en-us">* Apache 2 is installed and running correctly.</span></p>
<p><span lang="en-us">* libstdc++5 is installed.</span></p>
<pre>aptitude install libstdc++5</pre>
<p><span lang="en-us">* You have a domain for your virtual hosts. (www.testsrv.local)</span></p>
<p><span lang="en-us">* You have downloaded the latest linux coldfusion installer from www.adobe.com (coldfusion-801-lin64.bin for example)</span></p>
<h3><span lang="en-us">2. Install coldfusion:</span></h3>
<pre>
chmod +x coldfusion-801-lin64.bin
./coldfusion-801-lin64.bin
</pre>
<p><span lang="en-us"><strong>Note:</strong> This is the 64-Bit installer. If you don&#8217;t have an 64-bit operating system, you need the 32-bit version (coldfusion-801-lin.bin).</span></p>
<p><span lang="en-us">Configuration settings:</span></p>
<pre>
CHOOSE LOCALE BY NUMBER: 1
PRESS &#60;ENTER&#62; TO CONTINUE: &#60;ENTER&#62;
PRESS &#60;ENTER&#62; TO CONTINUE: &#60;ENTER&#62;
...
DO YOU ACCEPT THE TERMS OF THIS LICENSE AGREEMENT? (Y/N): Y
Installation Choice: 1 (Install new version of Adobe ColdFusion 8 with a serial number)
Serial Number: XXXX-XXXX-XXXX-XXXX-XXXX-XXXX
Choose one of the following options:: 2 (Multiserver configuration)
Is there already a multiserver configuration of Adobe ColdFusion 8, or Macromedia JRun 4, installed?: 2 (No)
Select an option: 5 (Continue with installation)
Default Install Folder: /opt/jrun4 &#60;ENTER&#62;
PRESS &#60;ENTER&#62; TO CONTINUE: &#60;ENTER&#62;
PRESS &#60;ENTER&#62; TO CONTINUE: &#60;ENTER&#62;
...
DO YOU ACCEPT THE TERMS OF THIS LICENSE AGREEMENT? (Y/N): Y
Serial Number:: &#60;ENTER&#62;
Earlier Versions of Adobe ColdFusion installed?
ENTER THE NUMBER FOR YOUR CHOICE, OR PRESS &#60;ENTER&#62; TO ACCEPT THE DEFAULT: 2 (No)
Configure Webserver: 1 (Add Web Server Configuration)
Select "Apache" 1
Directory: /etc/apache2
File: /usr/sbin/apache2
File: /etc/init.d/apache2
Choice: 4 (Continue with installation)
Directory: (DEFAULT: /etc/htdocs): /var/www
User Name: (DEFAULT: nobody): &#60;ENTER&#62;
Password: &#60;Default Development Password&#62;
Enable RDS  (Y/N): Y
Password: &#60;Your Password&#62;
PRESS &#60;ENTER&#62; TO CONTINUE: &#60;ENTER&#62;

Time for a cup of coffee ...

Press Enter to exit the installer: &#60;ENTER&#62;
</pre>
<h3><span lang="en-us">3. Create an init script:</span></h3>
<p><span lang="en-us">On Suse or Redhat you can use &#60;pre&#62;/opt/jrun4/bin/cf-init.sh install&#60;pre&#62; to create an init script but on Ubuntu or Debian you have to create your own script:</span></p>
<pre>vim /etc/init.d/coldfusion8multi</pre>
<pre>
#!/bin/sh
# MultiServer cfusion instance Init-Script

CF_DIR="/opt/jrun4"

cfstart() {
echo "The ColdFusion 8 server is starting up and will be available shortly."
nohup $CF_DIR/bin/jrun -start cfusion &#62; $CF_DIR/logs/cfusion-event.log &#38;
echo "======================================================================"
echo "ColdFusion 8 has been started."
echo "ColdFusion 8 will write logs to $CF_DIR/logs/cfusion-event.log"
echo "======================================================================"
}

cfstop() {
echo "Stopping ColdFusion 8, please wait"
nohup $CF_DIR/bin/jrun -stop cfusion
echo "ColdFusion 8 has been stopped"
}

case $1 in
    start)
        cfstart
    ;;
    stop)
        cfstop
    ;;
    restart)
        cfstop

    cfstart
    ;;
esac

exit 0
</pre>
<p><span lang="en-us">Install the init script:</span></p>
<pre>update-rc.d coldfusion8multi defaults</pre>
<p><span lang="en-us">Start the coldfusion server:</span></p>
<pre>/etc/init.d/coldfusion8multi start</pre>
<p><span lang="en-us">Setting up apache connector:</span></p>
<pre>/opt/jrun4/bin/cf-connectors.sh</pre>
<p><span lang="en-us">This will install and configurate the &#8220;mod_jrun22&#8243; for the apache webserver. (/etc/apache2/httpd.conf)</span></p>
<pre>
# JRun Settings
LoadModule jrun_module /opt/jrun4/lib/wsconfig/1/mod_jrun22.so
&#60;IfModule mod_jrun22.c&#62;
    JRunConfig Verbose false
    JRunConfig Apialloc false
    JRunConfig Ignoresuffixmap false
    JRunConfig Serverstore /opt/jrun4/lib/wsconfig/1/jrunserver.store
    JRunConfig Bootstrap 127.0.0.1:51020
    #JRunConfig Errorurl url &#60;optionally redirect to this URL on errors&#62;
    #JRunConfig ProxyRetryInterval 600 &#60;number of seconds to wait before trying to reconnect to unreachable clustered server&#62;
    #JRunConfig ConnectTimeout 15 &#60;number of seconds to wait on a socket connect to a jrun server&#62;
    #JRunConfig RecvTimeout 300 &#60;number of seconds to wait on a socket receive to a jrun server&#62;
    #JRunConfig SendTimeout 15 &#60;number of seconds to wait on a socket send to a jrun server&#62;
    AddHandler jrun-handler .jsp .jws .cfm .cfml .cfc .cfr .cfswf
&#60;/IfModule&#62;
</pre>
<p><span lang="en-us">Restart the apache webserver:</span></p>
<pre>/etc/init.d/apache2 restart</pre>
<p><span lang="en-us">Now you can open the coldfusion administrator:</span></p>
<pre>http://&#60;SERVER&#62;/CFIDE/administrator/index.cfm</pre>
<p><span lang="en-us">Complete the installation in the coldfusion administrator.</span></p>
<h3><span lang="en-us">4. Configurate an new coldfusion instance and virtual host:</span></h3>
<p><span lang="en-us">First you have to create a new instance with the &#8220;Instance Manager&#8221;. Open the coldfusion administrator and select &#8220;Enterprise Manager&#8221; and choose &#8220;Instance Manager&#8221;. The next step is to select &#8220;Add New Instance&#8221; and enter a &#8220;Server Name&#8221; for your new cf instance &#8220;webapp1&#8243; for example and press &#8220;Submit&#8221;.</span></p>
<p><span lang="en-us">Jrun creates a new server directory &#8220;/opt/jrun4/servers/webapp1&#8243; and starts the instance. In the &#8220;Instance Manager&#8221; you can see the new instance and the HTTP-Port &#8220;8301&#8243; for example. Now you can access the coldfusion administrator of the instance with: &#8220;http://&#60;SERVER&#62;:8301/CFIDE/administrator/index.cfm&#8221;</span></p>
<p><span lang="en-us">The document root is in &#8220;/opt/jrun4/servers/webapp1/cfusion.ear/cfusion.war/&#8221;.</span></p>
<p><span lang="en-us">You can create a simple test file:</span></p>
<pre>vim /opt/jrun4/servers/webapp1/cfusion.ear/cfusion.war/test.cfm</pre>
<pre>
&#60;h2&#62;Test&#60;/h2&#62;
&#60;cfset test="Hello World"&#62;
&#60;cfoutput&#62;#test#&#60;/cfoutput&#62;
</pre>
<p><span lang="en-us">You can open the Test-script with &#8220;http://&#60;SERVER&#62;:8301/test.cfm&#8221;.</span></p>
<p><span lang="en-us">Now create a new virtual host &#8220;webapp1&#8243;.</span></p>
<pre>vim /etc/apache2/sites-available/webapp1</pre>
<pre>
&#60;VirtualHost *&#62;
    ServerName www.testsrv.local

    &#60;IfModule mod_jrun22.c&#62;
        JRunConfig Verbose false
        JRunConfig Apialloc false
        JRunConfig Ignoresuffixmap false
        JRunConfig Serverstore /opt/jrun4/lib/wsconfig/1/jrunserver.store
        JRunConfig Bootstrap 127.0.0.1:51000
        #JRunConfig Errorurl url &#60;optionally redirect to this URL on errors&#62;
        #JRunConfig ProxyRetryInterval 600 &#60;number of seconds to wait before trying to reconnect to unreachable clustered server&#62;
        #JRunConfig ConnectTimeout 15 &#60;number of seconds to wait on a socket connect to a jrun server&#62;
        #JRunConfig RecvTimeout 300 &#60;number of seconds to wait on a socket receive to a jrun server&#62;
        #JRunConfig SendTimeout 15 &#60;number of seconds to wait on a socket send to a jrun server&#62;
        AddHandler jrun-handler .jsp .jws .cfm .cfml .cfc .cfr .cfswf
    &#60;/IfModule&#62;

    DocumentRoot /opt/jrun4/servers/webapp1/cfusion.ear/cfusion.war/
    &#60;Directory /opt/jrun4/servers/webapp1/cfusion.ear/cfusion.war/&#62;
        Options Indexes FollowSymLinks MultiViews
        AllowOverride None
        Order allow,deny
        allow from all
    &#60;/Directory&#62;

    ErrorLog /var/log/apache2/error.log
    CustomLog /var/log/apache2/access.log combined
&#60;/VirtualHost&#62;
</pre>
<p><span lang="en-us"><strong>Note:</strong> Very important is that line &#8220;JRunConfig Bootstrap 127.0.0.1:51000&#8243;. Foreach multiserver instance coldfusion creates an own port for the &#8220;JRunProxyService&#8221;. This port is defined in the &#8220;jrun.xml&#8221; of the instance.</span></p>
<pre>vim /opt/jrun4/servers/webapp1/SERVER-INF/jrun.xml</pre>
<pre>
...
&#60;service class="jrun.servlet.jrpp.JRunProxyService" name="ProxyService"&#62;
...
&#60;attribute name="port"&#62;51000&#60;/attribute&#62;
&#60;attribute name="deactivated"&#62;false&#60;/attribute&#62;
...
&#60;/service&#62;
...
</pre>
<p><span lang="en-us">Now install the new virtual host:</span></p>
<pre>a2ensite webapp1</pre>
<p><span lang="en-us">and reload the apache webserver:</span></p>
<pre>/etc/init.d/apache2 reload</pre>
<p><span lang="en-us">Now you can access your test script with &#8220;http://www.testsrv.local/test.cfm&#8221;.</span></p>
<p><span lang="en-us">And you can access the coldfusion administrator with &#8220;http://www.testsrv.local/CFIDE/administrator/index.cfm&#8221;.</span></p>
<p><span lang="en-us">You should do some extra configurations like restrict the access to CFIDE with an additional &#8220;.htaccess&#8221; file, restrict the directory listing and some other apache security settings.</span></p>
<h3><span lang="en-us">5. Modify init script:</span></h3>
<p><span lang="en-us">The coldfusion server does&#8217;t start the instance on startup. You have to add all instances to your init script. Here is an modified version for &#8220;webapp1&#8243;:</span></p>
<pre>
#!/bin/sh
# MultiServer cfusion instance Init-Script

CF_DIR="/opt/jrun4"

cfstart() {
echo "The ColdFusion 8 server is starting up and will be available shortly."
nohup $CF_DIR/bin/jrun -start cfusion &#62; $CF_DIR/logs/cfusion-event.log &#38;
nohup $CF_DIR/bin/jrun -start -childVM webapp1 &#62; $CF_DIR/servers/webapp1/cfusion.ear/cfusion.war/WEB-INF/cfusion/logs/cfusion-event.log &#38;
echo "======================================================================"
echo "ColdFusion 8 has been started."
echo "ColdFusion 8 will write logs to $CF_DIR/logs/cfusion-event.log"
echo "======================================================================"
}

cfstop() {
    echo "Stopping ColdFusion 8, please wait"
    nohup $CF_DIR/bin/jrun -stop cfusion
    nohup $CF_DIR/bin/jrun -stop -childVM webapp1
    echo "ColdFusion 8 has been stopped"
}

case $1 in
    start)
        cfstart
    ;;
    stop)
        cfstop
    ;;
    restart)
        cfstop
        sleep 20
        cfstart
    ;;
esac

exit 0
</pre>
<p><span lang="en-us"><strong>Note: </strong>You can create an own init script for each instance, too. You don&#8217;t need the main cfusion application to run the instances.</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.mogilowski.net/lang/en-us/2009/02/23/install-coldfusion-8-multiserver-on-debian-50-lenny-with-apache-2/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Deploy OpenBlueDragon on Tomcat 6 in a virtual host environment</title>
		<link>http://www.mogilowski.net/lang/en-us/2008/11/24/deploy-openbluedragon-on-tomcat-6-in-a-virtual-host-environment</link>
		<comments>http://www.mogilowski.net/lang/en-us/2008/11/24/deploy-openbluedragon-on-tomcat-6-in-a-virtual-host-environment#comments</comments>
		<pubDate>Mon, 24 Nov 2008 21:35:14 +0000</pubDate>
		<dc:creator>sebastian</dc:creator>
				<category><![CDATA[Coldfusion]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[bluedragon]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[host]]></category>
		<category><![CDATA[hosts]]></category>
		<category><![CDATA[lenny]]></category>
		<category><![CDATA[open]]></category>
		<category><![CDATA[openbluedragon]]></category>
		<category><![CDATA[tomcat]]></category>
		<category><![CDATA[virtual]]></category>
		<category><![CDATA[virtual host]]></category>
		<category><![CDATA[virtual hosts]]></category>
		<category><![CDATA[virtualhost]]></category>
		<category><![CDATA[virtualhosts]]></category>

		<guid isPermaLink="false">http://www.mogilowski.net/?p=154&#038;lang=de-de</guid>
		<description><![CDATA[This article describes how to deploy OpenBlueDragon server on Tomcat in a virtual hosts environment. Please read my Apache Tomcat 6 Article for the base setup. If you install the BlueDragon server in seperate virtual hosts, each will have an own coldfusion administrator with own settings. 1. Download Download &#8220;J2EE WAR Distribution&#8221; from http://www.openbluedragon.org/download.cfm. 2. [...]]]></description>
			<content:encoded><![CDATA[<p><span lang="en-us">This article describes how to deploy OpenBlueDragon server on Tomcat in a virtual hosts environment. Please read my <a href="http://www.mogilowski.net/?p=121">Apache Tomcat 6 Article</a> for the base setup.</span></p>
<p><span lang="en-us">If you install the BlueDragon server in seperate virtual hosts, each will have an own coldfusion administrator with own settings.</span></p>
<h3>1. Download</h3>
<p><span lang="en-us">Download &#8220;J2EE WAR Distribution&#8221; from <a href="http://www.openbluedragon.org/download.cfm" target="_blank">http://www.openbluedragon.org/download.cfm</a>.</span></p>
<h3><span lang="en-us">2. Prepare system</span></h3>
<h3><span lang="en-us">2.1 Modify the virtual host in tomcat</span></h3>
<pre>
vim /opt/tomcat/conf/server.xml
</pre>

<pre>
&#60;!-- www.testsrv.local --&#62;
&#60;host name=&#34;www.testsrv.local&#34; appBase=&#34;/var/www/vhost1/htdocs&#34; unpackWARs=&#34;true&#34; autoDeploy=&#34;true&#34;&#62;
    &#60;context path=&#34;&#34; docBase=&#34;openbluedragon&#34; debug=&#34;0&#34; reloadable=&#34;true&#34;/&#62;
    &#60;valve className=&#34;org.apache.catalina.valves.AccessLogValve&#34; directory=&#34;/var/www/vhost1/logs&#34;  prefix=&#34;tomcat_access_&#34; suffix=&#34;.log&#34; pattern=&#34;common&#34; resolveHosts=&#34;false&#34;/&#62;
&#60;/host&#62;
</pre>
<h3><span lang="en-us">2.2 Modify the virtual host in apache</span></h3>
<pre>
vim /etc/apache2/sites-enabled/vhost1
</pre>
<pre>
&#60;virtualhost www.testsrv.local:80&#62;
    JkMount /*.cfm default
    JkMount /*.cfc default
    JkMount /*.cfchart default
    DirectoryIndex index.cfm index.html index.htm
    ServerName www.testsrv.local
    ServerAdmin servermaster@testsrv.local
    DocumentRoot /var/www/vhost1/htdocs/openbluedragon
    ErrorLog /var/www/vhost1/logs/error.log
    CustomLog /var/www/vhost1/logs/access.log common
    &#60;directory /var/www/vhost1/htdocs/openbluedragon&#62;
        Options -Indexes
    &#60;/directory&#62;
    &#60;directory /var/www/vhost1/htdocs/openbluedragon/WEB-INF&#62;
        Options -Indexes
        AllowOverride None
        deny from all
    &#60;/directory&#62;
&#60;/virtualhost&#62;
</pre>
<h3><span lang="en-us">3. Deploy the WAR file to a virtual host</span></h3>
<p><span lang="en-us">Copy the downloaded openbluedragon.war file into /var/www/vhost1/htdocs/</span></p>
<p><em><span lang="en-us">Note: Tomcat will unpack this WAR file and create the cfusion diretory. After that, you can delete the WAR file.</span></em></p>
<h3><span lang="en-us">4. Apply configuration</span></h3>
<pre>
/etc/init.d/tomcat restart
/etc/init.d/apache2 reload
</pre>
<h3><span lang="en-us">5. Test configuration</span></h3>
<p><span lang="en-us">Now you can test your installation by opening the BlueDragon CFML test page:</span></p>
<p>http://www.testsrv.local/index.cfm</p>
<h3>6. Administration</h3>
<p><span lang="en-us">On <a href="http://bdadmin.riaforge.org" target="_blank">http://bdadmin.riaforge.org</a> you can get a web admin for the OpenBlueDragon server.</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.mogilowski.net/lang/en-us/2008/11/24/deploy-openbluedragon-on-tomcat-6-in-a-virtual-host-environment/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Install Tomcat 6 on Debian (Lenny) with virtual hosts and Apache2 integration</title>
		<link>http://www.mogilowski.net/lang/en-us/2008/11/24/install-tomcat-6-on-debian-lenny-with-virtual-hosts-and-apache2-integration</link>
		<comments>http://www.mogilowski.net/lang/en-us/2008/11/24/install-tomcat-6-on-debian-lenny-with-virtual-hosts-and-apache2-integration#comments</comments>
		<pubDate>Mon, 24 Nov 2008 21:29:50 +0000</pubDate>
		<dc:creator>sebastian</dc:creator>
				<category><![CDATA[Coldfusion]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[6]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[apache2]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[lenny]]></category>
		<category><![CDATA[mod_jk]]></category>
		<category><![CDATA[tomcat]]></category>
		<category><![CDATA[virtual host]]></category>
		<category><![CDATA[virtual hosts]]></category>
		<category><![CDATA[virtualhost]]></category>
		<category><![CDATA[virtualhosts]]></category>

		<guid isPermaLink="false">http://www.mogilowski.net/?p=121&#038;lang=de-de</guid>
		<description><![CDATA[This article is a new version of my Apache Tomcat 5.5 article. In this version i descripe the installation of the open bluedragon in a seperate article. This article only describes how to install Apache Tomcat 6 on Debian Lenny, Apache2 integration and virtual hosts. Tocat 6 is not available over the regular sources on [...]]]></description>
			<content:encoded><![CDATA[<p><span lang="en-us">This article is a new version of my Apache Tomcat 5.5 article.  In this version i descripe the installation of the open bluedragon in a seperate article. This article only describes how to install Apache Tomcat 6 on Debian Lenny, Apache2 integration and virtual hosts. Tocat 6 is not available over the regular sources on Debain Lenny (and Etch) it need to be installed by hand. (On Ubuntu you can get Tomcat 6 with an apt-Installation)</span></p>
<p><strong><span lang="en-us" style="color:red;">UPDATE: Please read the new article:</span> <a target="_blank" href="http://www.mogilowski.net/2010/12/11/install-tomcat-7-on-debian-lenny-with-virtual-hosts-and-apache2-integration/">Tomcat 7 on Debian</a></strong></p>
<h3><span lang="en-us">1. Install Java 6 runtime:</span></h3>
<p><span lang="en-us">Choose one of the following Java JDK installations:</span></p>
<h3>1.1 OpenJDK</h3>
<pre>
aptitude install java6-runtime
</pre>
<h3>1.2 Sun JDK (non-free)</h3>
<pre>
vim /etc/apt/sources
</pre>
<pre>
deb http://ftp.de.debian.org/debian/ lenny main non-free
deb-src http://ftp.de.debian.org/debian/ lenny main non-free
</pre>
<pre>
aptitude update
aptitude install sun-java6-jdk
</pre>
<p><em><span lang="en-us">Note: Keep in mind that you need a different Apache connector configuration if you use the Sun JDK.</span></em></p>
<h3>2. Download Tomcat</h3>
<p>Download Tomcat 6 <span lang="en-us">from</span> <a title="Tomcat 6" href="http://tomcat.apache.org/download-60.cgi" target="_blank">Tomcat 6 Download</a> <span lang="en-us">page</span>.</p>
<p><span lang="en-us">For example:</span></p>
<pre>
wget http://apache.imsam.info/tomcat/tomcat-6/v6.0.18/bin/apache-tomcat-6.0.18.tar.gz
</pre>
<h3><span lang="en-us">3. Install Tomcat</span></h3>
<pre>
tar -xzvf apache-tomcat-6.0.18.tar.gz
mv apache-tomcat-6.0.18 /opt/tomcat
</pre>
<h3><span lang="en-us">4. Create Init-Script</span></h3>
<pre>
vim /etc/init.d/tomcat
</pre>
<pre>
#!/bin/sh
# Tomcat Init-Script
case $1 in
    start)
        sh /opt/tomcat/bin/startup.sh
    ;;
    stop)
        sh /opt/tomcat/bin/shutdown.sh
    ;;
    restart)
        sh /opt/tomcat/bin/shutdown.sh
        sh /opt/tomcat/bin/startup.sh
    ;;
esac
exit 0
</pre>
<pre>
update-rc.d tomcat defaults
</pre>
<h3><span lang="en-us">5. Activate the Tomcat manager</span></h3>
<pre>
vim /opt/tomcat/conf/tomcat-users.xml
</pre>
<pre>
&#60;?xml version='1.0' encoding='utf-8'?&#62;
&#60;tomcat-users&#62;
    &#60;role rolename="manager"/&#62;
    &#60;role rolename="admin"/&#62;
    &#60;user username="YOUR_USERNAME" password="YOUR_PASSWORD" roles="admin,manager"/&#62;
&#60;/tomcat-users&#62;
</pre>
<h3>6. Start Tomcat</h3>
<pre>
/etc/init.d/tomcat start
</pre>
<p><span lang="en-us">Now you can access the Tomcat manager with http://SERVER:8080/manager/html.</span></p>
<h3><span lang="en-us">5. Install Apache2 connector</span></h3>
<p><span lang="en-us">You can use the Tomcat as a standalone webserver, but the apache webserver has more features and you can use the apache modules. (mod_rewrite for example)</span></p>
<pre>
aptitude install apache2 libapache2-mod-jk
</pre>
<pre>
vim /etc/apache2/workers.properties
</pre>
<pre>
workers.tomcat_home=/opt/tomcat
workers.java_home=/usr/lib/jvm/java-6-openjdk
ps=/
worker.list=default
worker.default.port=8009
worker.default.host=localhost
worker.default.type=ajp13
worker.default.lbfactor=1
</pre>
<p><em><span lang="en-us">Note: Replace &#8220;/usr/lib/jvm/java-6-openjdk&#8221; with &#8220;/usr/lib/jvm/java-6-sun&#8221; if you using the non-free Sun Java runtime.</span></em></p>
<p><span lang="en-us">JK configuration file</span></p>
<pre>
vim /etc/apache2/conf.d/jk.conf
</pre>
<pre>
&#60;ifmodule mod_jk.c&#62;
    JkWorkersFile /etc/apache2/workers.properties
    JkLogFile /var/log/apache2/mod_jk.log
    JkLogLevel error
&#60;/ifmodule&#62;
</pre>
<pre>
/etc/init.d/apache2 stop
/etc/init.d/tomcat restart
/etc/init.d/apache2 start
</pre>
<h3><span lang="en-us">6. Create a new VirtualHost</span></h3>
<p><span lang="en-us">Creating a new VirtualHost: (In Apache <strong>AND</strong> Tomcat)</span></p>
<h3><span lang="en-us">6.1 Create directories</span></h3>
<pre>
mkdir /var/www/vhost1
mkdir /var/www/vhost1/htdocs
mkdir /var/www/vhost1/logs
</pre>
<pre>
vim /etc/apache2/sites-available/vhost1
</pre>
<h3>6.2 Apache</h3>
<pre>
&#60;virtualhost www.testsrv.local&#62;
    JkMount /*.jsp default
    ServerName www.testsrv.local
    ServerAdmin servermaster@testsrv.local
    DocumentRoot /var/www/vhost1/htdocs
    ErrorLog /var/www/vhost1/logs/error.log
    CustomLog /var/www/vhost1/logs/access.log common
    &#60;directory /var/www/vhost1/htdocs&#62;
        Options -Indexes
    &#60;/directory&#62;
&#60;/virtualhost&#62;
</pre>
<p><span lang="en-us"><em>Note:</em> You can forward all files &#8220;<em>JkMount /*</em>&#8221; or all files in a folder &#8220;<em>JkMount /folder/*</em>&#8221; to the Tomcat, too.</span></p>
<pre>
a2ensite vhost1
/etc/init.d/apache2 reload
</pre>
<h3>6.3 Tomcat</h3>
<pre>
vim /opt/tomcat/conf/server.xml
</pre>
<pre>
&#60;!-- www.testsrv.local --&#62;
&#60;host name=&#34;www.testsrv.local&#34; appBase=&#34;/var/www/vhost1&#34; unpackWARs=&#34;true&#34; autoDeploy=&#34;true&#34;&#62;
    &#60;context path=&#34;&#34; docBase=&#34;htdocs&#34; debug=&#34;0&#34; reloadable=&#34;true&#34;/&#62;
    &#60;valve className=&#34;org.apache.catalina.valves.AccessLogValve&#34; directory=&#34;/var/www/vhost1/logs&#34;  prefix=&#34;tomcat_access_&#34; suffix=&#34;.log&#34; pattern=&#34;common&#34; resolveHosts=&#34;false&#34;/&#62;
&#60;/host&#62;
</pre>
<pre>
/etc/init.d/tomcat restart
</pre>
<p><em><span lang="en-us">Note: You can add additional domains with:</span></em></p>
<pre>
&#60;alias&#62;additionaldomain.com&#60;/alias&#62;
</pre>
<p><em></em></p>
<h3><span lang="en-us">7. Create a Testpage</span></h3>
<pre>
vim /var/www/vhost1/htdocs/test.jsp
</pre>
<pre>
&#60;html&#62;
    &#60;head&#62;
        &#60;title&#62;Hello World&#60;/title&#62;
    &#60;/head&#62;
    &#60;body&#62;
        &#60;h1&#62;Hello World&#60;/h1&#62;
        Today is: &#60;%= new java.util.Date().toString() %&#62;
    &#60;/body&#62;
&#60;/html&#62;
</pre>
<p><span lang="en-us">Now you can test your configuration with http://www.testsrv.local/test.jsp</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.mogilowski.net/lang/en-us/2008/11/24/install-tomcat-6-on-debian-lenny-with-virtual-hosts-and-apache2-integration/feed</wfw:commentRss>
		<slash:comments>62</slash:comments>
		</item>
		<item>
		<title>VirtualHosts,OpenBlueDragon with Tomcat 5.5, Apache2 (mod_jk) on Debian Etch</title>
		<link>http://www.mogilowski.net/lang/en-us/2008/05/31/virtualhosts-mit-openbluedragon-unter-tomcat-55-apache2-mod_jk-auf-debian-etch</link>
		<comments>http://www.mogilowski.net/lang/en-us/2008/05/31/virtualhosts-mit-openbluedragon-unter-tomcat-55-apache2-mod_jk-auf-debian-etch#comments</comments>
		<pubDate>Sat, 31 May 2008 09:24:13 +0000</pubDate>
		<dc:creator>sebastian</dc:creator>
				<category><![CDATA[Coldfusion]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[apache2]]></category>
		<category><![CDATA[bluedragon]]></category>
		<category><![CDATA[cfm]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[etch]]></category>
		<category><![CDATA[jsp]]></category>
		<category><![CDATA[mod_jk]]></category>
		<category><![CDATA[openbluedragon]]></category>
		<category><![CDATA[tomcat]]></category>
		<category><![CDATA[virtual host]]></category>
		<category><![CDATA[virtualhost]]></category>

		<guid isPermaLink="false">http://www.mogilowski.net/?p=24</guid>
		<description><![CDATA[NewAtlanta announced in March, that they will publish an OpenSource version of the BlueDragon ColdFusion server. Integrating OpenBlueDragon into the classic Linux/MySQL environment, will be a real alternative to PHP (LAMP) webservers. This howto describes how you can install OpenBlueDragon with Tomcat 5.5 on Debian Etch. The Tomcat server will be connected with mod_jk with [...]]]></description>
			<content:encoded><![CDATA[<p><span lang="en-us">NewAtlanta announced in March, that they will publish an OpenSource version of the BlueDragon ColdFusion server. Integrating</span><span lang="en-us"> <a title="Open BlueDragon" href="http://www.openbluedragon.org" target="_blank">OpenBlueDragon</a> int</span><span lang="en-us">o the classic Linux/MySQL environment, will be a real alternative to PHP (LAMP) webservers.<br />
</span></p>
<p><span lang="en-us">This howto describes how you can install <a title="Open BlueDragon" href="http://www.openbluedragon.org" target="_blank">OpenBlueDragon</a> with Tomcat 5.5 on Debian Etch. The <a title="Tomcat" href="http://tomcat.apache.org" target="_blank">Tomcat</a><a title="mod_jk" href="http://tomcat.apache.org/connectors-doc/" target="_blank"> </a></span><span lang="en-us">server will be connected wi</span><span lang="en-us">th </span><span lang="en-us"><a title="mod_jk" href="http://tomcat.apache.org/connectors-doc/" target="_blank">mod_jk</a> with the <a title="Apache2" href="http://httpd.apache.org" target="_blank">Apache2</a> webserver. </span></p>
<p><span lang="en-us">You can use this howto without the OpenBlueDragon parts to install an Tomcat server together with Apache2.</span></p>
<p><span lang="en-us">There are a few reasons to install Tomcat with Apache2. You can use Apache to buffer slow connections, take advantage of Apache features such as cgi and PHP,  use Apache modules such as mod_rewrite or you can isolate virtual hosts in their own Tomcat instances</span>.</p>
<p><span lang="en-us">For the Tomcat installation you need the Sun Java JDK. You have to edit /etc/apt/sources.list and add the &#8220;non-free&#8221; pakets:</span></p>
<pre><span lang="en-us">deb http://ftp.debian.org/debian/ main <strong>non-free</strong>
</span>deb-src http://ftp.debian.org/debian/ main <span lang="en-us"><strong>non-free</strong></span></pre>
<p><span lang="en-us">Now you can install the Sun Java JDK:</span></p>
<pre># aptitude update
# aptitude install sun-java5-jdk</pre>

<p><span lang="en-us">After that you can install the Tomcat server:</span></p>
<pre># aptitude install tomcat5.5 tomcat5.5-admin tomcat5.5-webapps</pre>
<p><span lang="en-us">You can test the installation with this URL: http://SERVER:8180</span></p>
<p><span lang="en-us">The next step is to configurate the users for the Tomcat management:</span></p>
<pre># /etc/init.d/tomcat5.5 stop
# vim /var/lib/tomcat5.5/conf/tomcat-users.xml</pre>
<pre>&#60;?xml version='1.0' encoding='utf-8'?&#62;
&#60;tomcat-users&#62;
&#60;role rolename="admin"/&#62;
&#60;role rolename="manager"/&#62;
&#60;role rolename="tomcat"/&#62;
&#60;user username="admin"
password="foobar"
roles="tomcat,admin,manager"/&#62;
&#60;/tomcat-users&#62;

# vim /etc/default/tomcat5.5
TOMCAT5_SECURITY=<strong>no
</strong></pre>
<pre># /etc/init.d/tomcat5.5 start</pre>
<p><span lang="en-us">Of course you have to change the password to your own one. You need the TOMCAT5_SECURITY setting only for the Tomcat administraton webinterface. If you don&#8217;t need the administration, you can keep the setting or restore it if you have finished the configuration.</span></p>
<p><span lang="en-us">Now you can use the Tomcat manager application with this URL: http://SERVER:8180/manager/html and the administrator with this URL: http://SERVER:8180/admin</span></p>
<p><span lang="en-us">You will find a deploy section in the manager. There you can upload and deploy the <em>openbluedragon.war</em> file.</span></p>
<p><span lang="en-us">After the restart of the Tomcat server with &#8220;<em>/etc/init.d/tomcat5.5 restart</em>&#8221; you will find openbluedragon in the application list of the Tomcat manager.</span></p>
<p><span lang="en-us">Installation of the Apache2 Tomcat connector:</span></p>


<pre># aptitude install apache2 libapache2-mod-jk
# vim /etc/apache2/workers.properties

workers.tomcat_home=/usr/share/tomcat5.5
workers.java_home=/usr/lib/jvm/java-1.5.0-sun-1.5.0.14
ps=/
worker.list=default
worker.default.port=8009
worker.default.host=localhost
worker.default.type=ajp13
worker.default.lbfactor=1
JK Konfigurationsdatai
# vim /etc/apache2/conf.d/jk.conf
&#60;IfModule mod_jk.c&#62;
    JkWorkersFile /etc/apache2/workers.properties
    JkLogFile /var/log/apache2/mod_jk.log
    JkLogLevel error
&#60;/IfModule&#62;</pre>
<pre># /etc/init.d/apache2 stop
# /etc/init.d/tomcat5.5 restart
# /etc/init.d/apache2 start</pre>
<p><span lang="en-us">Creating a new VirtualHost: (In Apache <strong>AND</strong> Tomcat)</span></p>
<p><span lang="en-us">Prepare directories:</span></p>
<pre># mkdir /var/www/vhost1
# mkdir /var/www/vhost1/htdocs
# mkdir /var/www/vhost1/logs</pre>
<p><span lang="en-us">Copy WEB-INF:</span></p>
<pre># cp /var/lib/tomcat5.5/webapps/openbluedragon/WEB-INF /var/www/vhost1/htdocs/</pre>
<p><span lang="en-us">Creating Apache VirtualHost:</span></p>
<pre># vim /etc/apache2/sites-available/vhost1</pre>
<pre>&#60;VirtualHost www.testsrv.local&#62;
    JkMount /*.cfm default
    JkMount /*.cfc default
    JkMount /*.jsp default
    ServerName www.testsrv.local
    ServerAdmin servermaster@testsrv.local
    DocumentRoot /var/www/vhost1/htdocs
    ErrorLog /var/www/vhost1/logs/error.log
    CustomLog /var/www/vhost1/logs/access.log common
    &#60;Location /WEB-INF/ &#62;
      AllowOverride None
      deny from all
    &#60;/Location&#62;
&#60;/VirtualHost&#62;</pre>
<pre># a2ensite vhost1
# /etc/init.d/apache2 reload</pre>
<p><span lang="en-us"><em>Note:</em> You can forward all files &#8220;<em>JkMount /*</em>&#8221; or all files in a folder &#8220;<em>JkMount /folder/*</em>&#8221; to the Tomcat, too.</span></p>
<p><span lang="en-us">Creating Tomcat host:</span></p>
<pre># vim /etc/tomcat5.5/server.xml</pre>
<pre>&#60;!-- www.testsrv.local --&#62;
&#60;Host name="www.testsrv.local" appBase="/var/www/vhost1"
      unpackWARs="true" autoDeploy="true"&#62;
      &#60;Context path="" docBase="htdocs" debug="0" reloadable="true"/&#62;
      &#60;Valve className="org.apache.catalina.valves.AccessLogValve"
             directory="/var/www/vhost1/logs"  prefix="tomcat_access_" suffix=".log"
             pattern="common" resolveHosts="false"/&#62;
&#60;/Host&#62;</pre>
<p><span lang="en-us">At least you have to restart the Apache and the Tomcat:</span></p>
<pre># /etc/init.d/tomcat5.5 restart
# /etc/init.d/apache2 restart</pre>
<p><strong>[UPDATE]</strong><br />
<span lang="en-us">There is a new version of this article available <a href="http://www.mogilowski.net/?p=121">Tomcat 6 with Lenn</a>y and <a href="http://www.mogilowski.net/?p=154">OpenBlueDragon on Tomcat 6</a>.</span><br />
</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mogilowski.net/lang/en-us/2008/05/31/virtualhosts-mit-openbluedragon-unter-tomcat-55-apache2-mod_jk-auf-debian-etch/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using apc
Database Caching 47/100 queries in 0.071 seconds using apc
Object Caching 816/874 objects using apc
Content Delivery Network via cdn.mogilowski.net

Served from: www.mogilowski.net @ 2012-02-08 12:28:24 -->
