Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2008
    Posts
    123

    Thumbs up enable tomcat support for temporary URL

    How to enable tomcat support for temporary/testing URL (ex: http://hostname/~username )

    If you want to enable tomcat for temporary/testing URL then refer below steps :

    1] root@server[#] vi /usr/local/jakarata/tomcat/conf/server.xml

    Add the below code in server.xml file for virtual host entry tab

    Code:
     <Listener className="org.apache.catalina.startup.UserConfig"
     directoryName="public_html" homeBase="/home"
     userClass="org.apache.catalina.startup.HomesUserDatabase"/>
    For example :

    Code:
    <Host name="hostname" appBase="/usr/local/apache/htdocs">
              <Alias>www.hostname</Alias>
    
    <Listener className="org.apache.catalina.startup.UserConfig"
    directoryName="public_html" homeBase="/home"
    userClass="org.apache.catalina.startup.HomesUserDatabase"/>
    
              <Context path="" reloadable="true" docBase="/usr/local/apache/htdocs" debug="1"/>
              <Context path="/manager" debug="0" privileged="true"
                  docBase="/usr/local/jakarta/tomcat/server/webapps/manager">
             </Context>
     </Host>
    Save and quit.

    2] Then open the httpd.conf file and search the virtual host entry for the server's hostname and add the line.

    For Apache 1 :
    Code:
    Include "/usr/local/apache/conf/userdata/std/1/nobody/hostname/*.conf"
    For Apache 2 :
    Code:
    Include "/usr/local/apache/conf/userdata/std/2/nobody/hostname/*.conf"
    For ex:

    Code:
    <VirtualHost serverip:80>
        ServerName hostname
        DocumentRoot /usr/local/apache/htdocs
        ServerAdmin cpanel@eukhost.com
        <IfModule mod_suphp.c>
            suPHP_UserGroup nobody nobody
        </IfModule>
    Include "/usr/local/apache/conf/userdata/std/1/nobody/hostname/*.conf"
    </VirtualHost>

    Same for https

    Code:
    <VirtualHost serverip:443>
    .
    .
    .
    .
    Include "/usr/local/apache/conf/userdata/std/1/nobody/hostname/*.conf"
    </VirtualHost>
    save and quit.

    3] After that create the folder
    root@server[#] mkdir -p /usr/local/apache/conf/userdata/std/1/nobody/hostname/

    root@server[#] vi /usr/local/apache/conf/userdata/std/1/nobody/hostname/cp_jkmount.conf

    Then insert the below code:

    Code:
    <IfModule mod_jk.c>
      JkMount /*.jsp ajp13
      JkMount /servlet/* ajp13
      JkMount /servlets/* ajp13
      JkMount /*.* ajp13
     JkMount /* ajp13
     JkMount /*.jspx ajp13
    </IfModule>
    Save and Quit.

    Note : Restart Tomcat and Apache services.

    Note : Replace "hostname" with your server original host name.

    That's all you are done.

  2. #2

    Thumbs up

    Thanks Ronnie for sharing it. I have been searching for such a solution. Much appreciated
    This will surely help the users who wish to test the website during the website development process.
    Cristiano
    Dedicated Server Hosting by eUKhost Ltd.
    r1soft backup plans by eUkhost Ltd.
    MSN :: cristiano @ eukhost.com
    Skype :: cristiano.dawson

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •