Java

Use Tomcat as web server: Configure vritual hosts

No GoodNeed ImprovementOKGoodExcellent (No Ratings Yet)
Loading ... Loading ...

If you want to use Tomcat as web application server and you want to configure virtual hosts, here is how:

1, Install Tomcat.

2, Edit server.xml

<Server port="8005" shutdown="SHUTDOWN">
<Service name=”Catalina”>
<Connector port=”8080″ maxHttpHeaderSize=”8192″
maxThreads=”150″ minSpareThreads=”25″ maxSpareThreads=”75″
enableLookups=”false” redirectPort=”8443″ acceptCount=”100″
connectionTimeout=”20000″ disableUploadTimeout=”true” />
<Connector port=”8443″ maxHttpHeaderSize=”8192″
maxThreads=”150″ minSpareThreads=”25″ maxSpareThreads=”75″
enableLookups=”false” disableUploadTimeout=”true”
acceptCount=”100″ scheme=”https” secure=”true”
clientAuth=”false” sslProtocol=”TLS” />
<Connector port=”8009″
enableLookups=”false” redirectPort=”8443″ protocol=”AJP/1.3″ />
<Connector port=”8082″
maxThreads=”150″ minSpareThreads=”25″ maxSpareThreads=”75″
enableLookups=”false” acceptCount=”100″ connectionTimeout=”20000″
proxyPort=”80″ disableUploadTimeout=”true” />
<Engine name=”Standalone” defaultHost=”localhost” jvmRoute=”jvm1″>
<Engine name=”Catalina” defaultHost=”localhost”>

<Host name=”localhost” appBase=”webapps”
unpackWARs=”true” autoDeploy=”true”
xmlValidation=”false” xmlNamespaceAware=”false”>
</Host>

<!– This Host is the first “Virtual Host”: www.metrohomedb.com –>
<Host name=”
www.metrohomedb.com” appBase=”/usr/local/apache-tomcat-5.5.23/webapps/ROOT”>
<Context path=”" docBase=”.”/>
</Host>
<!– This Host is the second “Virtual Host”:
www.researchgrantdatabase.com –>
<Host name=”
www.researchgrantdatabase.com” appBase=”/home/grantdb/lucene”>
<Context path=”" docBase=”.”/>
</Host>

</Engine>

</Service>

</Server>

3, Put your Java/J2EE application into web root directory, e.g., /home/grantdb/dbsight

4, Restart Tomcat

/etc/rc.d/init.d/tomcat restart

Popularity: 2%

Comments (1)

Full-text search using Apache Lucene search engine

No GoodNeed ImprovementOKGoodExcellent (No Ratings Yet)
Loading ... Loading ...

Comments