enable tomcat support for temporary URL

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Cristiano
    replied
    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.

    Leave a comment:


  • ronniev
    started a topic enable tomcat support for temporary URL

    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] [email protected][#] 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 [email protected]
        <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
    [email protected][#] mkdir -p /usr/local/apache/conf/userdata/std/1/nobody/hostname/

    [email protected][#] 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.
Working...
X