You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Andrew Standley <an...@ecnetwork.co.nz> on 2001/10/04 02:06:08 UTC

tomcat + apache + virtual host - context problem -- help !!

Hi,
    We have one sun box with two IPs, not name-based. I want to run one
apache, one tomcat but two tomcat web apps. They live in
/export/home/usrlocal/tomcat/webapps/ . Both have servlets and jsp. The
servlets live under

/usr/local/tomcat/webapps/cusweb/WEB-INF/classes/nz/co/ecnetwork/customs/
and
/usr/local/tomcat/webapps/ecnweb/WEB-INF/classes/nz/co/ecnetwork/customs/


I can access boths static pages, but can't seem to configure it for tomcat,
especially using ports for http posting to an upload servlet..
Ports are 80 for normal, 8081 for upload, 443 for https access

The servername is the same in htpd.conf and server.xml, and I have tried
adding JkMOunts within the VirtualHost tags. But I can't get it working
correctly.

a static page that calls a servlet is defined thus

    <FORM NAME="form1" METHOD="post" ACTION="/servlet/Login">


and the tomcat webapps/WEB-INF/web.xml says

    <servlet>
        <servlet-name>Login</servlet-name>
        <servlet-class>nz.co.ecnetwork.customs.LoginServlet</servlet-class>
    </servlet>


other files are shown below

Httpd.conf::::::>

LoadModule jk_module libexec/mod_jk.so

JkWorkersFile /export/home/usrlocal/tomcat/conf/workers.properties
JkLogFile /export/home/usrlocal/tomcat/logs/mod_jk.log

JkLogLevel error


JkMount /*.jsp ajp12
JkMount /servlet/* ajp12


Alias /cusweb "/export/home/usrlocal/tomcat/webapps/cusweb"
<Directory "/export/home/usrlocal/tomcat/webapps/cusweb">
    Options Indexes FollowSymLinks
</Directory>

JkMount /cusweb/servlet/* ajp12
JkMount /cusweb/*.jsp ajp12

<Location "/cusweb/WEB-INF/">
    AllowOverride None
    deny from all
</Location>

<Location "/cusweb/META-INF/">
    AllowOverride None
    deny from all
</Location>

<VirtualHost 202.135.190.42:80>
ServerName devx400.ecnetwork.co.nz
DocumentRoot "/usr/local/tomcat/webapps/cusweb/root"
</VirtualHost>

<VirtualHost 202.135.190.42:8081>
ServerName devx400.ecnetwork.co.nz
DocumentRoot "/usr/local/tomcat/webapps/cusweb"
</VirtualHost>

<IfDefine SSL>
<VirtualHost 202.135.190.42:443>
DocumentRoot "/usr/local/tomcat/webapps/cusweb"
ServerName devx400.ecnetwork.co.nz
ErrorLog /usr/local/apache/logs/cusweb_error_log
TransferLog /usr/local/apache/logs/cusweb_access_log

SSLEngine on

SSLCipherSuite ALL:!ADH:!EXP56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL

SSLCertificateFile /usr/local/apache/conf/ssl.crt/server.crt

SSLCertificateKeyFile /usr/local/apache/conf/ssl.key/server.key






<Files ~ "\.(cgi|shtml|phtml|php3?)$">
	SSLOptions +StdEnvVars
</Files>
<Directory "/usr/local/apache/cgi-bin">
	SSLOptions +StdEnvVars
</Directory>

SetEnvIf User-Agent ".*MSIE.*" \
	nokeepalive ssl-unclean-shutdown \
	downgrade-1.0 force-response-1.0

CustomLog /usr/local/apache/logs/ssl_request_log \
	"%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"

</VirtualHost>

</IfDefine>



<VirtualHost 202.135.190.22:80>
ServerName devx400_2.ecnetwork.co.nz
DocumentRoot "/usr/local/tomcat/webapps/ecnweb/root"
</VirtualHost>

<VirtualHost 202.135.190.22:8081>
ServerName devx400_2.ecnetwork.co.nz
DocumentRoot "/usr/local/tomcat/webapps/ecnweb"
</VirtualHost>

<IfDefine SSL>


<VirtualHost 202.135.190.22:443>

DocumentRoot "/usr/local/tomcat/webapps/ecnweb"
ServerName devx400_2.ecnetwork.co.nz
ServerAdmin john@ecnetwork.co.nz
ErrorLog /usr/local/apache/logs/ecnweb_error_log
TransferLog /usr/local/apache/logs/ecnweb_access_log

SSLEngine on

SSLCipherSuite ALL:!ADH:!EXP56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL

SSLCertificateFile /usr/local/apache/conf/ssl.crt/server.crt

SSLCertificateKeyFile /usr/local/apache/conf/ssl.key/server.key






<Files ~ "\.(cgi|shtml|phtml|php3?)$">
	SSLOptions +StdEnvVars
</Files>
<Directory "/usr/local/apache/cgi-bin">
	SSLOptions +StdEnvVars
</Directory>

SetEnvIf User-Agent ".*MSIE.*" \
	nokeepalive ssl-unclean-shutdown \
	downgrade-1.0 force-response-1.0

CustomLog /usr/local/apache/logs/ssl_request_log \
	"%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"

</VirtualHost>

</IfDefine>




server.xml::::>

    <Host name="devx400.ecnetwork.co.nz" >
      <Context path="/" docBase="webapps/cusweb" debug="0" reloadable="true"
>
      </Context>
    </Host>


    <Host name="devx400_2.ecnetwork.co.nz" >
      <Context path="/" docBase="webapps/ecnweb" debug="0" reloadable="true"
>
      </Context>
    </Host>



Using this I can't access the cusweb servlets but I can if I remove the
<Host tags around it in the server.xml file.

Andy Standley
ECNETWORK