access .jsp pages by using the temporay URL

If  domain does not points to the server and you want to access .jsp pages by using the temporary URL
(ex: http://domain.com/~username )
Solution:
Add the following code in server.xml file under the virtual host entry for any domain.
<Listener className="org.apache.catalina.startup.UserConfig"
directoryName="public_html" homeBase="/home"
userClass="org.apache.catalina.startup.HomesUserDatabase"/>

For example :
Web files would need to be in directories such as /home/username/public_html .You can change public_html to be any sub directory into which your users put their personal web pages.
=================================
<Host name=”domain.com” appBase=”/home/username/public_html”>
<Alias>www.domain.com</Alias>
<Listener className="org.apache.catalina.startup.UserConfig"
directoryName="public_html" homeBase="/home"
userClass="org.apache.catalina.startup.HomesUserDatabase"/>

<Context path=”” reloadable=”true” docBase=”/home/username/public_html” debug=”1″/>
<Context path=”/manager” debug=”0″ privileged=”true”
docBase=”/usr/local/jakarta/tomcat/server/webapps/manager”>
</Context>
</Host>
=================================
Restart tomcat and httpd service on the server.
Note: The domain.com is the domain which is hosted on same server and jsp support enabled for that domain,because your domain is not pointed to server and so you can access temporary url by using the different domain name.

Leave a Comment