Thứ Tư, 18 tháng 7, 2018

How to create a VirtualHost for Tomcat

To create Tomcat VirtualHost you just need to edit tomcat_dir/conf/server.xml and inside Engine tag place following code:

<Host appbase="/home/apache-tomcat-7.0.90/webapps/sample" autodeploy="true" name="virtual_host_name" unpackwars="true">
   <Logger className="org.apache.catalina.logger.FileLogger" directory="logs" prefix="sample_catalina_logger." suffix=".txt" timestamp="true" />
   <Context path="" docBase="/home/apache-tomcat-7.0.90/webapps/sample" reloadable="true" />
   <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" prefix="sample_access_log." suffix=".txt" pattern="common" />
</Host>


Then you will be abble to access your like: virtual_host_name:8080.

Share This!


Không có nhận xét nào:

Đăng nhận xét